Every first time your app is sending local notification to lock screen you can just read them or push the lock button twice and see the list with two sliders: one for reading each notification and one for unlocking. As far as i know it's the default setting. Of course I'm talking about locked screen with an app in the background.
Is there any way to change the "first" unlock screen notifications behavior to have both "unlock" and notifications's "read" sliders - not only one entering app?
EDIT: or at least if I know which slider was used? seems unlikely, but won't hurt to ask ;)
No, you can't change any thing about the way the system handles push notification programmatically.
You app will only open if the sliders is used by the user. You can check whether your app is opened by local notification in the - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
. Just check if there is a notification.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].applicationFrame];
[self.window addSubview:self.tabBarController.view];
[self.window makeKeyAndVisible];
UILocalNotification *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
if (notification) {
[self performSelector:@selector(handleNotification:) withObject:notification afterDelay:0.1];
}
return YES;
}
// Recieved notification when running
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[self handleNotification:notification];
}
- (void) handleNotification:(UILocalNotification *)notification {
// Handle the notification
}