Interceptd SDK targets iOS 10 or higher.
InterceptdSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'InterceptdSDK'
It is also required to set Always Embed Swift Libraries
to Yes
from Build Settings
for projects written in Objective-C
Application needs to import related modules to use InterceptdSDK. Add following lines to import
’s to achieve this;
import InterceptdSDK
@import InterceptdSDK;
You can check version of SDK with getSDKVersion
method
InterceptdAnalytics.getSDKVersion()
[InterceptdAnalytics getSDKVersion];
InterceptdSDK is required for tracking. Application cannot track any information before InterceptdSDK initialization is complete.
In application’s didFinishLaunchingWithOptions
callback, call InterceptdAnalytics.initialize
function with applicationId
parameter. This parameter should be your application id from Interceptd User Dashboard, you can use your application id for integration purposes. Check following code for sample;
InterceptdAnalytics.initialize(applicationId: "your-user-id")
[InterceptdAnalytics initialize:@"your-user-id"];
InterceptdSDK logging level can be changed with setLogLevel
after InterceptdAnalytics.initialize
call.
InterceptdAnalytics.setLogLevel(logLevel: .debug)
[InterceptdAnalytics setLogLevel:ASLogLevelDebug];
Using InterceptdSDK, you are able to track the frequency of custom events by placing the following code piece into your own application code. You can also attach data to your events. If you are planning to attach data to your event, make sure your dictionary is JSON serializable.
InterceptdAnalytics.track("event-name")
InterceptdAnalytics.track("event-name", data: ["string-key": json-serializable-any, ...])
[InterceptdAnalytics trackWithEventName:@"event-name"];
[InterceptdAnalytics trackWithEventName:@"event-name" data:@{@"string-key": @json-serializable-any, ...}];
Interceptd Mobile Team