0

I have an application that creates 6 UILocalNotifications each day, spaced at 2 hour intervals. Each notification is associated with a unique log entry screen. In the application's Navigation controller, the root of the stack is a UITableView with information about today and the six log entries that should be filled out for today.

I'd like the user to be able to swipe the notification from the notification center pull down screen (or from the lock screen) and go directly to the specific log entry screen they need to fill out.

I've looked for tutorials or documentation as to how this can be done, but I'm not having luck using the correct concepts for my search. Could anyone point me to some good resources to help me learn how to do this?

Thanks!

Doug Baker
  • 63
  • 1
  • 3

1 Answers1

0

In your application delegate, the main function - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; comes with launchOptions as you see. That launch option is null if the user opens the app normally. But if opens the app via a local notification, this launchOptions has an object with key "UIApplicationLaunchOptionsLocalNotificationKey". You can see the details of your local notification there and process it as you want

user1111278
  • 126
  • 4
  • If I happen to have my application open but it's in the background, -application:didFinishLaunchingWithOptions: doesn't fire, but -applicationDidBecomeActive: does. I've added this to the didFinishLaunchingWithOptions so I can view the details via console from Xcode: UILocalNotification *notification = [launchOptions objectForKey: UIApplicationLaunchOptionsLocalNotificationKey]; NSLog(@"UILocalNotification.description: %@", notification.description); But it's not showing anything because application:application didFinishLaunchingWithOptions: isn't firing. – Doug Baker Jan 08 '13 at 00:15
  • Right, it is not fired if the app is open but "- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification" does. You can recieve it there – user1111278 Jan 08 '13 at 12:19