question

sjoerdperfors avatar image
sjoerdperfors asked

iOS AB testing - App keeps runnning in background

Hi There, Im trying to create a simple A/B test in iOS. My App is allowed to run on the background. If the user has disabled this or we stop the locationmanager from the background normally the app stops any timer. This is default behaviour in any background (location) iOS app. After integrating the Amazone SDK and setup the A/B test the app keeps running forever in the background. Which is not good. I tested this with a simple NSTimer which tells me with a simple NSLog that the app is still running. If I uncomment the Amazone AB code the app shutdowns nicely. TEST CODE: [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(logRunningApp) userInfo:nil repeats:TRUE]; - (void)logRunningApp { NSLog(@"Still runnning.."); } AB TEST CODE: insights = [AIAmazonInsights insightsWithCredentials:credentials]; [[insights abTestClient] variationsByProjectNames:[NSArray arrayWithObject:ABTestingProjectName] withCompletionHandler:^(id variationSet, NSError *error) { if(!error) { // request a Variation out of the VariationSet id buttonVariation = [variationSet variationForProjectName:ABTestingProjectName]; NSString *newButtonText = [buttonVariation variableAsString:@"footerFMProText" withDefault:@"PRO features"]; NSLog(@"New button text: %@", newButtonText); [proFeaturesButton setTitle:newButtonText forState:UIControlStateNormal]; } }]; id eventStart = [[insights eventClient] createEventWithEventType:@"FooterFMProButtonVisible"]; // Record the view event. [[insights eventClient] recordEvent:eventStart]; Think this is a bug in the Amazone SDK or is there something wrong with my implementation ? Best, Sjoerd Perfors
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Sjoerd, We have confirmed that at least as of the latest SDK release that the behavior you describe is accurate. You can also see it in the Xcode debug navigator that the application is still running as well. We have forwarded your request to the appropriate team internally for review and we will update the post once we get more information.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hello Sjoerd, Could you please send a link to the app that you found the issue to so that we can further help you diagnose the problem? Our contact us link is at: https://developer.amazon.com/help/contactus.html
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.