Upsight logo Back to top

Basic Messages

KTParamMap

Creating a Parameter Map


When a method accepts optional parameters, they must be sent as a KTParamMap.

KTParamMap

Required Parameters


N/A

KTParamMap

Optional Parameters


N/A

KTParamMap

Code Example


Initialize the paramMap.

KTParamMap* paramMap = [[[KTParamMap alloc] init] autorelease];

Now you can put arguments into this paramMap.

[paramMap put:argName value:argValue];

For example, if you wanted to add a subtype1, test_sub to your evt mssage, your optional parameter's paramMap would look like:

[paramMap put:@"st1" value:@"test_sub"];

startSession

Starting a Session


Call this method to initiate the SDK. An apa message will be sent on first run unless you pass false for shouldSendApplicationAddedAutomatically.

Note The Enterprise SDK creates a user identifier, referred to as the sender ID. This ID can be substituted with another identifier (i.e. Your own ID). When substituting with another identifier, ensure that it is an integer, otherwise it will not pass.

Warning Using a custom sender ID instead of the one generated by the SDK can result in potential drawbacks for marketing and analytics. For further information, please contact your CSM or Upsight Support.

startSession

Required Parameters


Parameter Type Description
ApiKeystring The API Key of your application. This key is automatically generated when you set up your application in your Dashboard.
modestring Determines whether you send data to Upsight Analytics Test or Production servers. For Production, set this parameter to: kKontagentSDKMode_PRODUCTION. For Test, set this parameter to: kKontagentSDKMode_TEST.

startSession

Optional Parameters


Parameter Type Description
senderIDunsigned 64-bit int A unique, unsigned 64-bit integer in the form of an NSString. This parameter denotes the unique identifier of the application user. If your application creates user IDs larger than 64-bits, you must convert the user ID to an unsigned 64-bit integer to send to Upsight Analytics. For more information, click here.
shouldSendApplicationAddedAutomaticallyboolean When TRUE, the applicationAdded request will be sent automatically from this startSession method.
customIDstring Customer specified ID which will be a part of su tag for apa messages.

startSession

Code Example


Start a session. The SDK generates a user ID automatically.

[Kontagent startSession:@"<api_key>" mode:<sdkMode>];

Start a session with acquisition tracking enabled.

[Kontagent startSession:@"<api_key>" mode:<sdkMode> enableAcquisitionTracking:YES];

Start a session by specifying your own user ID. This ID will be used in all subsequent messages and sessions.

[Kontagent startSession:@"<api_key>" senderId:@"<sender_id>" mode:<sdkMode>];

Start a session without sending an "Application Added" method on first run.

[Kontagent startSession:@"<api_key>" senderId:nil mode:<sdkMode> shouldSendApplicationAddedAutomatically:NO];

Start a session specifying your own user ID without sending an "Application Added" message on first run.

[Kontagent startSession:@"<api_key>" senderId:@"<sender_id>" mode:<sdkMode> shouldSendApplicationAddedAutomatically:NO];

Start a session specifying your own user ID without sending an "Application Added" message on first run and sending a custom ID for ad acquisition tracking.

[Kontagent startSession:@"<api_key>" senderId:@"<sender_id>" mode:<sdkMode> shouldSendApplicationAddedAutomatically:NO customID:@"<aCustomID>"];

stopSession

Stopping a Session


Call this method to close the session. No parameters are required.

stopSession

Required Parameters


No Required Parameters

stopSession

Optional Parameters


No Optional Parameters

stopSession

Code Example


When the application exits, you should call this to write all unsent calls to disk.

[Kontagent stop];

sendDeviceInformation

Sending Device Information


This method gathers device model and OS version on launch of the application. This method should be called upon every launch and no parameters are required, as the SDK will automatically capture device information.

sendDeviceInformation

Required Parameters


No required parameters.

sendDeviceInformation

Optional Parameters


Parameter Type Description
v_majstring Major version number. This represents your version number scheme, and is limited to 50 characters. Valid characters are a-z, A-Z, 0-9, -, ., and _.
datastring Additional data, a JSON object string representing a dictionary or map of key-value pairs. Click here for more information.

sendDeviceInformation

Code Example


This is also filled in automatically by the library.

[Kontagent sendDeviceInformation:nil];

Versioning information for your application.

[paramMap put:@"v_maj" value:<major ver>];

[Kontagent sendDeviceInformation:paramMap];