Is there a way to know if the application did become active from a local notification?
I know there is a way to test if the application was launched from a local notification alert; but if it just was sitting out there the background, and received a notification?
I need to run different code, when the app has become active:
- From a local notification.
- Just has become active 🙂
Is there a way to do it?
I’m afraid Sylter is incorrect. When an app enters the foreground from the background, either by a direct user action or by a user response to a
UILocalNotification, it does not triggerapplicationDidFinishLaunchingWithOptions. It does, however, callapplicationWillEnterForegroundandapplicationDidBecomeActive. This can be verified with a couple ofNSLogs.So, the problem remains: if an app is entering the foreground from the background, there is no way to discover if the app is entering the foreground in response to a user’s response to a
UILocalNotification, or if it is merely entering the foreground. Except…Once the app has entered the foreground, it will receive the method
application:DidReceiveLocalNotification: if the app entered the foreground in response to aUILocalNotification.The problem is that any UI changes made within the
application:DidReceiveLocalNotification:method in response to receiving the UILocalNotification occur after the app has already entered the foreground, creating a disturbing experience for the user.Has anyone found a solution?