vendredi 28 novembre 2014

Backgrounding behaviour when an outgoing phone call is made, iOS7 vs iOS8

When my iOS app makes a phone call by doing the following:



NSString *telephoneUrl = @"tel:12345678";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:telephoneUrl]];


what happens to the app lifecycle state?


e.g. if I put the following lines below the above phone call lines:



dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSLog(@"dispatch callback was called!!!");
});


On iOS 7, applicationDidEnterBackground is called, the above code doesn't run, and when the phone call terminates, I am inside the Phone app. The console lines are written only when i return to my app.


However, on iOS 8, only applicationWillResignActive is called and the app doesn't enter background, and you can actually see the log being written to the console while I am inside the phone call. When the call terminates, i am still inside my app.


Can someone confirm the behaviour, or point me to the relevant documentation?




Aucun commentaire:

Enregistrer un commentaire