applicationDidBecomeActive: is called as a result of internal URL navigation

Originator:sash
Number:rdar://21710499 Date Originated:07-Jul-2015 01:26 PM
Status:Open Resolved:
Product:iOS SDK Product Version:7.x, 8.x, 9.x
Classification:Serious Bug Reproducible:Always
 
Summary:
if app calls calls -[UIApplication openURL:] with URL scheme assigned to the app itself, AppDelegate should not go through applicationWillResignActive / applicationDidBecomeActive

Steps to Reproduce:
Please use attached project.
Launch, click the button, observe log messages in console.

Actual Results:
Even though the URL is handled by the app itself, and it doesn’t become inactive, the app delegate receives both applicationWillResignActive & applicationDidBecomeActive callbacks.

Expected Results:
App delegate should not be notified about resigning active / returning to active state if URL is handled by the app itself.

Notes:
This behaviour violates app’s lifecycle, as it clearly doesn’t become active while URL is processed internally

Mu current workaround includes setting a boolean flag inside of -[UIApplicationDelegate application:openURL:sourceApplication:annotation:] and check for it in applicationDidBecomeActive which is not an optimal solution for many reasons.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!