Support Home > SDK Integration > iOS SDK Integration

iOS SDK Integration

DOCUMENT SUPERSEDED: The information that is contained within this document has been superseded. Refer to the current SDK integration support document for the latest integration instructions and procedures.

The Kochava SDK allows advertisers to integrate a single SDK to leverage the hundreds of ad network and publisher partners integrated with Kochava. This limits the number of 3rd party SDKs required to run a successful UA strategy and greatly reduces complexity during update cycles. Find documentation for other SDKs, plugins, and Server-to-Server Integrations here.

 

Minimum Requirements

  • Xcode 7 — if you are still using Xcode 6 please contact us for a compatible SDK
  • iOS 6

Integrating the SDK

Make the following additions and project settings changes to your project to use the Kochava Event Tracking Library.

 

  1. From the attached zip, copy the following files into your project’s folder using Finder:
  2. libTrackAndAd.a
    TrackAndAd.h

     

  3. Right-clicking on your project in Xcode, select “Add Files to (project name)” and add TrackAndAd.h to your project.
  4. Click on the project name at the top of the Project Navigator in Xcode. Then select Targets on the pane to the right, then “Build Phases” across the top. Click the drop-down titled “Link Binary With Libraries”. If not already listed, using the plus sign, add the following frameworks and libraries. The first several will be found in the main list which appears. The ones at the bottom of the list you will have to add via the “Add Other…” button and locate them in the Kochava Tracker files you downloaded.
    • UIKit.framework
    • Foundation.framework
    • AdSupport.framework
    • iAd.framework
    • CoreLocation.framework
    • SystemConfiguration.framework
    • libTrackAndAd.a

     

  5. In your AppDelegate’s header file, add the following:
  6. #import "TrackAndAd.h"

     

    Within the @interface section:

    #import "TrackAndAd.h"
    

     

    Under the @interface section:

    @property(readonly) KochavaTracker *kochavaTracker;

     

  7. In your AppDelegate’s source file, add the following:
  8. Under @implementation:

    @synthesize kochavaTracker;

     

    In didFinishLaunchingWithOptions:  

    kochavaTracker = [[KochavaTracker alloc] initKochavaWithParams:dictionary of parameters];

     

    NOTE:  This must be prior to “self.window.rootViewController = self.viewController;”, or similar.

     

    In your dealloc method:  

    [kochavaTracker release];

Calling the Constructor

By calling the Kochava Constructor, you have completed the basic integration with Kochava. The Constructor should be located in the logic of your application where things first startup.

 

Argument: An initialization dictionary

The initialization dictionary must contain a Kochava App Id.  All other information is optional.  Here is an example of an initialization dictionary:

 

Method: initKochavaWithParams

NSDictionary *initDict = [NSDictionary dictionaryWithObjectsAndKeys:
@"myKochavaAppGUID", @"kochavaAppId",
@"usd", @"currency", // optional - usd is default
@"0", @"limitAdTracking", // optional - 0 is default
@"0", @"enableLogging", // optional - 0 is default
identityLinkDictionary, @"identityLink", // optional
nil];
kochavaTracker = [[KochavaTracker alloc] initKochavaWithParams:initDict];

 

More details on each of the boolean values above can be found in their individual setter method documentation below.

The identityLink dictionary may contain one or two key/value pairs of strings and may be used to associate information with the device. For example, you could associate an internal userid which you want to connect to a user’s service identifier. There is more detailed information below under IdentityLink, which can be called at any time.

You might create your identityLinkDictionary, to be used in initKochavaWithParams, as follows:

NSDictionary *identityLinkDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
@"ABCD1234", @"myInternalUserID",
@"1235467890123456", @"service ID",
nil];

 

When this method is called, the Kochava Tracker reports device and app information to Kochava, should those values be different than the last time this information was reported.

 

Data sent by this method:

  • Device type (iPad, iPhone iPod touch)
  • iOS name and version (eg: iPhone OS 4.3.5)
  • Application version (eg: 1.2)
  • Your Kochava application ID
  • The currency in which your application functions (will default to USD)
  • If you’d like to enable console logging of Kochava library events (will default to NO)
  • Limiting app level ad tracking* (is NO by default)

 

NOTE: If you wish to limit ad tracking at the application level, with respect to Kochava conversions, you can turn off ad tracking when you initialize the Kochava library or by an individual method for the purpose of changing the limit ad tracking state, which will be off by default (user opts-in to advertising).

 

(DEPRECATED)

Method: initWithKochavaAppId

Arguments:  kochavaAppId, currency (optional), enableLogging (optional), limitAdTracking (optional), isNewUser (optional)

If you are using the initWithKochavaAppId method currently, please start using initKochavaWithParams instead. If you have questions about initWithKochavaAppId, please forward them to us and we’ll be happy to assist you.

With each installation, Kochava gathers device information and sends it to the Kochava servers for analysis across each installation. Further, this information is ONLY sent in the following situations:

  • Upon initial installation
  • When the application is upgraded
  • When the operating system version is upgraded on the host device

By limiting the times that this information is sent, Kochava is optimizing performance of the SDK and only sending information when changes are made.

 

NOTE: That Kochava persists data in NSUserDefaults. All keys used are prefaced with com.kochava.KochavaTracker. You should be careful not to clear these keys or the SDK may perform unpredictably.


Toggling Console Logging

Console logging will be off by default, unless enabled via either the initial command or the enableConsoleLogging method, which takes only a bool as an argument. If you had enabled console logging when you initialized the library, you can also disable it via this method by passing NO to it.

(void)someMethodInMyApp { 
MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate.kochavaTracker enableConsoleLogging:YES]; // or NO to turn off 
}

Toggling Limit-Ad-Tracking

Ad tracking will be on by default, unless disabled via either the initial command or the setLimitAdTracking method, which takes only a bool as an argument.

(void)someMethodInMyApp {
...
MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate.kochavaTracker setLimitAdTracking:YES]; // or NO to remove limiting (opt-in)
...
}

Calling Event Methods

Sending Kochava post-install events is not a requirement. To track installation information, you do not need to do anything more than call the constructor for the tracker. Still, many advertisers want to understand and correlate the relationship between conversion and attribution source information with post-install behaviors. This can only be done by tracking post-install events.

Once the Constructor is called, Kochava event tracking methods can be called from anywhere within the application. Events will be coupled with the information sent by the Constructor to report events, based on user device and application information.

Events are not sent immediately to Kochava servers but queued, should the device not have connectivity.

 

Standard Events

Standard events help you to classify information in a way that the Kochava servers will be able to understand and provide tailored reporting. A standard event is sent by constructing an EventStandardParameters object, configuring it as desired, and then sending it to the tracker using its trackEventWithEventStandardParameters: method.

 

Prototypes:

To create an EventStandardParameter object:

   +  (instancetype)eventStandardParametersWithEventStandardParametersEnum:(EventStandardParametersEnum)eventStandardParametersEnum;

 

To create an event with EventStandardParameters:

   -  (void) trackEventWithEventStandardParameters:(EventStandardParameters *)eventStandardParameters;

 

Sample Code:

EventStandardParameters *eventStandardParameters = [EventStandardParameters eventStandardParametersWithEventStandardParametersEnum:EventStandardParametersEnumLevelComplete];
    
eventStandardParameters.userIdString = @"ABCDEF12345";

eventStandardParameters.levelString = @"1";

eventStandardParameters.scoreString = @"15500";

eventStandardParameters.descriptionString = @"some description";

eventStandardParameters.durationTimeIntervalNumber = @(65.0);
    
[self.kochavaTracker trackEventWithEventStandardParameters:eventStandardParameters];

 

 

Custom Events

FAA Limited Option: This feature is not available within Free App Analytics. Contact us for more information on upgrading to a paid Kochava account.

Custom events let you send event information beyond the standard parameters provided by the tracker.

 

NOTE: Event names may not be prepended with an underscore, as that convention is reserved for Kochava system events. (i.e. _INSTALL)

 

NOTE: For examples of post-install events for iOS, refer to our Post-Install Event Examples support documentation.

 

No event pre-registration is required. To instrument an event, simply send an event name via the eventTitle parameter. Optionally, you can also send an eventValue.

Uses of the the optional eventValue parameter could be any of the following:

  • Gather in-app purchase information that can be used for LTV calculation.
  • A JSON formatted string, in which you want to track several data points.
  • Just some other piece of information, paired with the eventTitle.

 

If the string passed in eventValue is all numeric (and may include a decimal point), Kochava will automatically sum the amounts passed in eventValue for the same eventTitle. For example, if you sent the purchase amount of in-app purchases in eventValue and named eventTitle “IAP – Purchase Price”, Kochava would add up all the purchase amounts for you and present them as a total for “IAP – Purchase Price”.

Regardless of what is passed in eventValue, Kochava’s user dashboard will let you access all the data passed in eventValue for any eventTitle, and present a count of all times trackEvent passed any given eventTitle.

 

NOTE: If you pass a string of JSON represented data, only the root level (no nested chunks) is stored.  Also, a limit of 75 characters is applied for a non-JSON-decodable string passed as an event value.

 

Prototype:

(void) trackEvent:(NSString*)eventTitle :(NSString*)eventValue;

 

Sample Code:

You can call the tracking method from anywhere in your application. It is called by accessing it through the application’s delegate. Note that you’ll need to import your app delegate’s header file at the top of the file from which you call this method.

 

NOTE: In the example below, “Detail View” and “product list” are just examples for a particular scenario. Say an app has a bunch of items listed in a UITableView (like the Settings app on the iPhone). The user taps on one of the items in the list to go to a more detailed view. So the you want to log that the user went to the more detailed view of the product list (which was the item on the table table they tapped on). You might sent this pair of events to indicate the user went to a “Detail View” of the “product list”.

- (void)someMethodInMyApp {
        
           ...
 
           MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
           [delegate.kochavaTracker trackEvent:@"Detail View":@"product list"];
 
           ...
 
}

Sending App Store Receipts

Similar to the trackEvent method, a name/value pair with a Base64 encoded string containing an App Store receipt may be sent to Kochava servers.

 

Prototype:

 - (void) trackEvent:(NSString*)eventTitle withValue:(NSString*)eventValue 
        andReceipt:(NSString*)encodedReceipt;

 

NOTE: This event should be called like the trackEvent (normal post-install event), but adds a field for a Base64 encoded string of the App Store Receipt. For more information about retrieving the receipt, refer to Validating Receipts with the App Store support documentation.

 

NOTE: Sending the App Store Receipts should be used in conjunction with the iOS Purchase event. For an example of the proper format of an iOS Purchase event, refer to our Post-Install Event Examples support documentation.

 

Sample Code:

// Load the receipt from the app bundle.
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];
    
if (!receipt) { /* No local receipt -- handle the error. */
        
   NSString* encodedReceiptData = [receipt base64EncodedStringWithOptions:0];

   NSString *eventName = @"Purchase";
   NSDictionary *valuePayload = @{
                @"customer_id": myCustomerID,
                @"currency": myCurrency,
                @"sum": myPurchaseAmount,
                @"items_in_basket": [NSNumber numberWithInteger:myItems],
                @"checkout_as_guest": myIsGuestFlag
                };
        
   NSError *error;
   NSData *jsonData = [NSJSONSerialization dataWithJSONObject:valuePayload options:0 error:&error];
   if(jsonData)
   {
     NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
     [delegate.kochavaTracker trackEvent:eventName withValue:jsonString andReceipt:encodedReceiptData];
   }
}

Sending Spatial Events

 

FAA Limited Option: This feature is not available within Free App Analytics. Contact us for more information on upgrading to a paid Kochava account.

 

-(void)someMethodInMyApp {
...
MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
[delegate.kochavaTracker spatialEvent:@"my spatial event":1.0:3.33:-0.5];
...
}

Identity Link

IdentityLink events provide the opportunity to “link different identities” together. For example, you may have assigned each user of your app an internal userid which you want to connect to a user’s service identifier. Using the IdentityLink method, you can send both your internal id and their service identifier and connect them in the Kochava database.

Kochava reports can be output to show additional identity information for devices in the Kochava database so that you can supplement your reports with internal identifiers that are useful to you and your application.

Although you can call the identityLink method any time, it is best called just once per data pair being connected and it is your responsibility to know you have or have not made that connection.

- (void)someMethodInMyApp {
    ...
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
        @"ABCD1234", @"myInternalUserID",
        @"1234567890123456", @"service_ID",
        nil];
 
    MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
    [delegate.kochavaTracker identityLinkEvent:dict];
    ...
}

Deep Link

Pass deep link events to Kochava using this method. After receiving the URI from your application via openURL:(NSURL *)url sourceApplication: in your application delegate, just pass the url and sourceApplication parameters to the sendDeepLink method. You can learn more about deep linking for iOS here.

-	(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
[kochavaTracker sendDeepLink:url:sourceApplication];

 

Starting with iOS 9, you can take advantage of Apple’s Universal Links.  Implementation directions for Universal Links can be found here: https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html

If you are not using Universal Links, you will need to register the URL scheme, taking the following approach:  https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Inter-AppCommunication/Inter-AppCommunication.html


Attribution Data Request (Onboarding Links)

Attribution data can be received from Kochava server, usually in less than 10 seconds from the initial application launch. You can receive attribution by a delegate to your host app, by asking for the attribution data at any point, or both. You MUST request attribution data from the server when you initialize the library for either of these approaches to work.

 

If you wish to receive attribution via a delegate, make sure you set the kochavaTracker.trackerDelegate after initializing the library.

NSDictionary *initDict = [NSDictionary dictionaryWithObjectsAndKeys:
          @"myKochavaAppGUID", @"kochavaAppId",
          @"0", @"enableLogging", // optional - 0 is default
          @"1", @"retrieveAttribution",

          nil];
kochavaTracker = [[KochavaTracker alloc] initKochavaWithParams:initDict];
kochavaTracker.trackerDelegate = self;

 

To receive attribution data via a callback, add the following handler to your application:

- (void) Kochava_attributionResult:(NSDictionary *)attributionResult
{
… do what you want with attributionResult
}

 

If you want to ask what attribution data has been retrieved from the server, at any time you can call the getAttributionData method.

- (void)someMethodInMyApp { 
      MyAppDelegate *delegate = (MyAppDelegate*)[[UIApplication sharedApplication] delegate];
NSDictionary *attributionResult = [delegate.kochavaTracker 
retrieveAttribution];
}

 

Sample Payload:

{
	"network": "KochavaTestVPPN_11_4",
	"network_id": "1484",
	"campaign": "SDK Testing",
	"tier": "",
	"tracker": "Tracker 3860a",
	"tracker_id": "kospeedyiostest4743213e08eeu4a8cb8b1107e4f6dc ",
	"site": "1",
	"country": "USA",
	"timestamp": 1426525910,
	"date": "2015-03-16 17:11:50",
	"ko_click_id": "ko_a13c55070ebf7174b",
	"user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",
	"click": {
		"meta": {
			"control_server": "172.18.95.75",
			"original_request": "campaign_id=kospeedyiostest4743213e08eeu4a8cb8b1107e4f6dc&network_id=1484&device_id=device_id&site_id=1&ko_click_id=ko_a13c55070ebf7174b&in_time=1426525887&inboarder=d4",
			"origination_ip": "84.175.168.54"
		},
		"id": 42,
		"deeplink": "",
		"date": "2015-03-16 17:11:27"
	},
	"install": {
		"meta": {
			"device": "iPhone-iOS-7.1.2",
			"control_server": "172.18.95.78",
			"matched_by": "fingerprint",
			"in_time": "1426525910",
			"inboarder": "d3",
			"debug": "1",
			"alt_device_id": "a:0:{}",
			"device_id": "DE5DCF67-116A-450A-E5A3-117A36341FA6",
			"device_id_type": "idfa",
			"origination_ip": "84.175.168.54",
			"device_limit_tracking": "1",
			"app_limit_tracking": "0",
			"device_ver": "iPhone-iOS-7.1.2",
			"affinity_group": "[{"app_name":"MobileMail.app\/MobileMail","mtime":"1412959477"},{"app_name":"MobileSafari.app\/MobileSafari","mtime":"1412959477"},{"app_name":"bardunity.app\/bardunity","mtime":"1426525900"}]",
			"advertiser_tracking_enabled": "0",
			"application_tracking_enabled": "1"
		},
		"id": 124
	}
}

 

sample.attribution.payload

 

With either approach, an NSDictionary will contain the attribution data.

 

Possible return values for the attribution NSDictionary:

  • nil – Either you didn’t indicate when you initialized that you would like to retrieve attribution, or attribution hasn’t yet been determined. Kochava attempts to determine attribution within the first several seconds after the application has been run the first time.
  • Contains a single key/value pair with attribution = false – represents an organic install.
  • Contains a NSDictionary with a variety of attribution information – indicate attribution was made and contains the details of that attribution.

The delegate approach will not return until attribution has been determined and will not return a nil.


Kochava Device ID Retrieval

If you would like to retrieve the Kochava Device ID from the SDK for your own use, you can call the following static method (if a Kochava Device ID has not yet been generated it will return an empty string):

NSString *kochavaDeviceId = [kochavaTracker getKochavaDeviceId];

Apple Watch

As the Kochava tracker object exists already in your host application, you will pass data you want to track from the WatchKit Extension to the host application using the openParentApplication method of the WKInterfaceController class. The host application will receive information in your application’s delegate via handleWatchKitExtensionRequest.

 

Associating an Apple Watch With Your Application

You are responsible for creating a protocol through which you wish to pass information between the WatchKit Extension and the host application, as there might be more information than just what you would track via Kochava. The examples below only illustrate how you might choose to pass this information.

- (void)willActivate {
    // This method is called when watch view controller is about to be visible to user




    [InterfaceController openParentApplication:@{ @"command": @"startHandlingWatch" }
                                         reply:^(NSDictionary *replyInfo, NSError *error) {
                                             // … do something with the reply (or not)
                                         }];




    [super willActivate];
}

 

In your application delegate, implement the handleWatchKitExtensionRequest to parse the data sent to it, so that it knows it should tell Kochava to associate the Apple Watch with your application. You will tell Kochava to associate the Apple Watch with your application by calling the handleWatchEvents method of the Kochava tracker object.

- (void)application:(UIApplication *)application
handleWatchKitExtensionRequest:(NSDictionary *)userInfo
              reply:(void (^)(NSDictionary *replyInfo))reply
{
// you may or may not choose to send an actual response back to the Extension
NSDictionary *response;




if ([[userInfo objectForKey:@"command"] isEqualToString:@"startHandlingWatch"])	{
[kochavaTracker handleWatchEvents];
response = nil;
}




reply(response);
}

 

Prototype:

- (void) handleWatchEvents;

 

Send an Apple Watch Event to Kochava

After you have associated an Apple Watch to your application, you may optionally send events which occur on the Apple Watch to Kochava for tracking. To do this you send information, again using a protocol you develop, from your WatchKit Extension to your host application.

-(void)somethingHappenedOnAppleWatch:(id)sender
{
[InterfaceController openParentApplication:@{ @"command": @"event" }
reply:^(NSDictionary *replyInfo, NSError *error) {
// … do something with the reply (or not)
}];
}

 

In your application delegate, implement the handleWatchKitExtensionRequest to parse the data sent to it, so that it knows it should send an event to track to Kochava. Likely, you would also pass additional information via the NSDictionary (userInfo), such as specific data you wish to track.

- (void)application:(UIApplication *)application
handleWatchKitExtensionRequest:(NSDictionary *)userInfo
              reply:(void (^)(NSDictionary *replyInfo))reply
{
NSDictionary *response;




if ( [[userInfo objectForKey:@"command"] isEqualToString:@"event"] )	{
[kochavaTracker trackWatchEvent:@"Apple Watch event" :@"Event value"];
response = nil;
}




reply(response);
}

 

Prototype:

- (void) trackWatchEvent:(NSString*)eventTitle :(NSString*)eventValue;

 

Kochava’s trackWatchEvent method is processed just like other post-install events and therefore the following applies to them:

  • Event names may not be prepended with an underscore, as that convention is reserved for Kochava system events. (i.e. _INSTALL)
  • No event pre-registration is required.  To instrument an event, simply send an event name via the eventTitle parameter.  Optionally, you can also send an eventValue.
  • Uses of the the optional eventValue parameter could be any of the following:
  • Gather in-app purchase information that can be used for LTV calculation.
  • A JSON formatted string, in which you want to track several data points.
  • Just some other piece of information, paired with the eventTitle.

 

If the string passed in eventValue is all numeric (and may include a decimal point), Kochava will automatically sum the amounts passed in eventValue for the same eventTitle. For example, if you sent the purchase amount of in-app purchases in eventValue and named eventTitle “IAP – Purchase Price”, Kochava would add up all the purchase amounts for you and present them as a total for “IAP – Purchase Price”.

Regardless of what is passed in eventValue, Kochava’s user dashboard will let you access all the data passed in eventValue for any eventTitle, and present a count of all times trackEvent passed any given eventTitle.

 

NOTE: If you pass a string of JSON represented data, only the root level (no nested chunks) is stored. Also there exists a limit of 75 total characters passed in eventValue.


iBeacon Detection

NOTE: iBeacon Detection is not included with the standard Kochava SDK , an iOS SDK capable of iBeacon detection is available upon request. For further information on iBeacon Detection, contact a Kochava Client Success Managers.


Swift Support

The Kochava iOS SDK supports the Swift programming language through “Swift Bridging”. Xcode will prompt you to configure an Objective-C bridging header when you add the Kochava library files to your project. Alternatively, you can add the bridging header manually.

 

Information on Objective-C / Swift bridging can be found here: https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/MixandMatch.html.

 

At the top of your AppDelegate, make sure the following line exists before any class prototypes:

var bridgeForKochava: KochavaTracker = KochavaTracker()

 

After adding the Kochava files to your Swift project and establishing the bridging header, you can access Kochava iOS library functions using the Kochava library Swift methods:

- (KochavaTracker*) swiftInitKochavaWithParams:(id)initDict;
- (void) swiftEnableConsoleLogging:(bool)enableLogging;
- (void) swiftTrackEvent:(id)eventTitle :(id)eventValue;
- (void) swiftIdentityLinkEvent:(id)identityLinkData;
- (void) swiftSpatialEvent:(id)eventTitle :(float)x :(float)y :(float)z;
- (void) swiftSetLimitAdTracking:(bool)limitAdTracking;
- (NSString*) swiftRetrieveAttribution;
- (void) swiftSendDeepLink:(id)url :(id)sourceApplication;
- (bool) swiftPresentInitAd;

 

NOTE: At the time of this release, callbacks from Objective-C to Swift are not yet supported in the Kochava SDK. This impacts any callbacks your application would receive from either retrieval of attribution from the server or any iBeacon boundary crossings.

 

These methods are used just like their Objective-C counterparts. See the documentation above on specifics. Here are a few examples you might use.

 

To initialize using Swift, in your AppDelegate class:

var kTracker: KochavaTracker
var kochavaInitDict: Dictionary = [
    "kochavaAppId": "—your Kochava App GUID—",
    "enableLogging":"1",
    "retrieveAttribution":"1"]
kTracker = bridgeForKochava.swiftInitKochavaWithParams(kochavaInitDict)
var delegate: KochavaTrackerClientDelegate

 

Within any Swift file, you could call a post-install event as follows:

bridgeForKochava.swiftTrackEvent("some name", "some value")

 

To see what attribution was retrieved from Kochava servers, you could call the following:

let attribution:(NSString) = bridgeForKochava.swiftRetrieveAttribution()

 

To pass an IdentityLink to the server, you could call the following:

var idLink: Dictionary = ["ID1": "ID2"]
bridgeForKochava.swiftIdentityLinkEvent(idLink)

Upload to App Store

NOTE: Around April 26, 2014, Apple modified their automatic code validation surrounding the gathering of the Advertising Identifier (IDFA). The following error indicates a problem with this validation process:

 

“Improper advertising identifier [IDFA] usage. Your app contains the Advertising Identifier [IDFA] API but your app is not respecting the Limit Ad Tracking setting in iOS.”

There have been no instances of the Kochava SDK triggering this error. Kochava’s SDK’s IDFA usage complies with Apple’s guidelines, and Kochava adheres to a user’s Limit Ad Tracking setting. Also, Kochava periodically submits apps with our library integrated to ensure that our SDK passes Apple validation.

 

If this error message appears when you try to submit an app to the app store, alert your Client Success Managers that you received it, and provide the following information:

  • Version of Kochava’s SDK that you are using
  • Whether or not you checked YES to answer the question, Does this app use the Advertiser Identifier (IDFA)?
  • Whether or not you checked any of the 3 boxes under: This app uses the Advertising Identifier to (select all that apply):
  • What other tracking/conversion SDKs, if any, you are using in your app

 

From this information, we can trouble-shoot.

 

A. Select the Following


Files For Download

You can download the SDK files below.  If you are using Cocoapods source the Cocoapods trunk and add ‘Kochava’ as a pod.

 

[itg-tooltip href=”https://assets.kochava.com/supportfreeappanalyticscom/uploads/2016/10/Kochava-iOS-SDK-Release-Notes_20160921.pdf” target=”_blank” tooltip-content=”<h6><strong>SDK Version – 20160921</strong></h6><br/><ul><br/><li><br/><h6>Added initializer parameter to pass custom identifier in install payload.</h6><br/></li><br/></ul><h6><strong><h6><strong>SDK Version – 20160914</strong></h6><br/><ul><br/><li><br/><h6>Added new method for sending post-install events using standardized keys and value types.</h6><br/></li><br/></ul><h6><strong>SDK Version – 20160823</strong></h6><br/><ul><br/><li><br/><h6>Removed cookie collection per Applie guidelines on use of SafariViewController. Inclusion of SafariServices.framework is no longer necessary.</li><br/></ul><br/><h6><strong>SDK Version – 20160823</strong></h6><br/><ul><br/><li><br/><h6>Optional cookie collection modified for iOS 10.</h6><br/></li><br/></ul><br/><h6><strong>SDK Version – 20160720</strong></h6><br/><ul><br/><li><br/><h6>Add network connection type, display brightness and device orientation to collected data on initialization.</h6><br/></li><br/></ul><br/><ul><br/><li><br/><h6>Add optional Google cookie collection.</h6><br/></li><br/></ul><br/><ul><br/><li><br/><h6>Guard against possible Apple bug where iAd attribution is passed with a nil value.</h6><br/></li><br/></ul><br/><ul><br/><li><br/><h6>Note that this version requires the inclusion of the following frameworks in your application: SystemConfiguration.framework and SafariServices.framework.</h6><br/></li><br/></ul><br/>”]Kochava iOS SDK Release Notes[/itg-tooltip]

 

 


Game Center Support

The Kochava iOS SDK with Game Center Support will automatically collect your users’ Game Center ID and alias.

In addition to the frameworks listed at the top of this page, you will need to include GameKit.framework in your project.

If you are using Cocoapods, source the Cocoapods trunk and add ‘Kochava-gc’ as a pod.

 

Kochava_ios_20160907-gc

 


Testing the Integration

For more information on testing the integration with Kochava, refer to our Testing an Integration with Free App Analytics support documentation.

 
 

Last Modified: May 19, 2022 at 4:16 pm