iOS SDK (Manual)
Last updated
Last updated
Please have the following handy before beginning the integration:
Application identifier generated on the Apxor dashboard for your app (Read more on how to fetch the application identifier from Apxor dashboard)
App Bundle Id : Every app has a unique application ID that looks like com.example.myapp
. This id uniquely identifies the app on the device and also on the app store.
(Know more about bundle ids here)
The list of events to setup triggers and track goals, user properties that allows to personalize messages and to target better. (Read more on how you can setup here)
Note
If you are already using a separate analytics class where you are sending events to different platforms from a single place it is much faster to use our tracking guide to complete event logging to setup triggers and track goals.
In case you are logging events to third parties after each interaction, please use our Third party API guide to migrate all the events that you are sending to one of the supported third parties as listed in the guide.
Find the latest release notes here.
The Core Plugin is responsible for the basic event tracking
Download the above and Unzip to find ApxorSDK.framework
directory
Add ApxorSDK.framework
to your "Frameworks, Libraries and Embedded Content" list. (for xcode < 11, under “Embedded Binaries”)
Also add the libsqlite3.dylib
(or libsqlite3.0.tbd
) library to the same list.
Under build settings tab, in "Other Linker Flags", add -ObjC
, if not already present.
Add the following in the Run script phase in your build phases.
Add the libraries to your application's "Frameworks, Libraries and Embedded Content" list. (Click on the plugin name to download)
Apxor provides you two easy to use plugins for your Actions. They are:
This Plugin helps you create contextual surveys to capture your users' feedback, ratings, etc.
This Plugin helps you create real time actions.
Make sure to add the following dependency plugins as well,
The Secret Sauce
The Push Plugin allows you to send push notifications to your device in real time
The WYSIWYG Plugin allows you to preview your configured actions onto your device in real time
To Auto initialize SDK (Recommended), add the following inside your application
plist file.
Open your application's Info.plist as source code.
Copy paste the below piece of code, to create an entry for ApxorSDK.
To manually initialize SDK (Not Recommended), call ApxorSDK.initialize
method in your Applicaiton
class
Your plist should look something like this
First, you need to configure your app to ensure there is a URL Scheme with your application's bundle identifier as the value.
If your app already has a URL Scheme with your application's bundle identifier as the value, you can skip this step.
Configure URL Scheme
To configure URL scheme, goto your project settings, select Targets
. Click on the Info
tab.
Select the URL Types
, and click on the +
button to add a new URL Scheme.
Add a new URL Scheme with your bundle identifier
as the value.
Your bundle identifer will be in the format, com.xxxx.xxxx
Use the image below for reference.
Handling the deep link
Secondly, you'd need to enable Apxor to handle Apxor specific deeplinks.
In your application's AppDelegate
file, in the function application(_:open:options:)
, add the following code at the beginning,
Use the image below for reference.
This will ensure the Apxor specific deep links are handle by our SDK.
To use the push notifications feature, make sure the following lines exist in your application plist file under Apxor section.
To configure iOS Push notification via Apxor dashboard, you'd need to upload APNs Auth Key file along with it's ID (key ID), your Team ID, and your application's Bundle ID.
The APNs Auth Key is the best way to configure pushes, as you don't need to regenerate a certificate every year and also, this key can be used to configure Push notifications to sever of your applications (under the same apple developer account)
Things required to configure iOS Push notification:
Auth Key file
Key ID (usuallly the name of the Auth Key file)
Team ID (the 10 digit alphanumeric key)
Your app’s bundle ID (in the format com.abc.xyz)
See here on how to get these, Push notifications
Once you get those details, add the below code in your application's AppDelegate
file in the application
didRegisterForRemoteNotificationsWithDeviceToken
function.
The token can be passed in either the NSData
or NSString
format
If you haven't already used the code to Ask User for notifications permission, add the following function in your AppDelate
file.
Lookout for the following log
Click here for the guides to log user properties, events and event properties.