Track crashes in Adobe Analytics

oksana354432

20-07-2018

I compared iOS sdk with Android sdk and noticed that in iOS sdk isn't provided the ability to send additional context data with application lifecycle.
In Android sdk clearly stated that: To send additional context data with your lifecycle call by using Config.collectLifecycleData(Activity activity, Map<String, Object> contextData), you must override the onResume method for that Activity and ensure that you call super.onResume() after manually calling collectLifecycleData.

Is it possible for iOS?

Accepted Solutions (1)

Accepted Solutions (1)

AlexisCazes

MVP

23-07-2018

Core Implementation and Lifecycle

Include Additional Data with Lifecycle Calls

To include additional data with lifecycle metric calls, use collectLifecycleDataWithAdditionalData:

Important: Any data that is passed to the SDK through collectLifecycleDataWithAdditionalData: will be persisted in NSUserDefaults by the SDK. The SDK strips the values in the NSDictionary parameter that are not of the NSString or NSNumber types.

  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

  2.    NSMutableDictionary *contextData = [NSMutableDictionary dictionary];

  3.    [contextData setObject:@"Game" forKey:@"myapp.category"];

  4.    [ADBMobile collectLifecycleDataWithAdditionalData:contextData];

  5.    return YES;

  6. }

Answers (3)

Answers (3)

abrahame_easo

23-04-2019

collectLifecycleDataWithAdditionalData can be used to pass additional data layer variables on all lifecycle calls including the first one after install and the subsequent ones in future.

For this functionality to work, you would need to follow the instructions in the below link and section “Include Additional Data with Lifecycle Calls

https://marketing.adobe.com/resources/help/en_US/mobile/ios/dev_qs.html

Along with this, you will need to add the same collectLifecycleDataWithAdditionalData code into iOS applicationWillEnterForeground method as well. This is the part that helps send the additional data layer variables on the subsequent lifecycle calls after the first one.

abrahame_easo

18-04-2019

is that collectLifecycleDataWithAdditionalData supposed to pass the data on future lifecycle calls or just the first lifecycle call after the install?

For me additional context data set in only sent in the first install lifecycle call. is there any additional instructions we are missing here?