im not getting any launch options after a push notification; heres the code i have but non of the NSLogs seem to print in the debug area.
UILocalNotification *localNotif =
[launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (localNotif) {
NSString *itemName = [localNotif.userInfo objectForKey:@"aps"];
NSLog(@"Custom: %@", itemName);
} else {
NSLog(@"//////////////////////////");
}
when i open the app (via pressing view on the push notification) it goes to the didReceiveRemoteNotification script, im not sure if thats meant to happen..
thanks for reading.
Press and hold the Home button until you see the Siri screen. Tell Siri "Launch [app name]". Your app should launch immediately.
Your application receives push notifications through multiple paths, depending on the state of your app when it is received.
If your app is not launched (not even suspended in background), the launchOptions
will contain the notification payload (key UIApplicationLaunchOptionsRemoteNotificationKey
).
If it is already running or suspended in background, the app will receive the notifications via application:didReceiveRemoteNotification:
in your application delegate.
The process is the same for local notifications (UIApplicationLaunchOptionsLocalNotificationKey in application:didFinishLaunchingWithOptions: and application:didReceiveLocalNotification:
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With