I have UILocalNotification the has two buttons a cancel and view button when the application is in the background and the alert come up I click the view button and it opens on application but I have a method call that is ment to run if the launch option has a UILocalNotification object that is not working
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//notifcation key
UILocalNotification *notifcation = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (notifcation) {
NSLog(@"working");
}
}
Thanks for Help I have worked it out I thought that the launch options were passed to the application even if the app was in the background but that is not the case if application is in background and a local notification comes in the application delegates has the
didReceiveLocalNotificationmethod called I thought that was call when application was in foreground and when in the background application did launch with options was called but the options only has the local notification key when the app is closed (not in background) and the notification is call to start up the application.so if ay one else has te same issue make sure you use
method when you click your action button on the local notification alert to run and actions when you open your application from that notification alert button.