When I click on a local notification from the notification centre I want to prevent it from opening my application, i.e when the notification is clicked nothing should happen other than just clearing it. Any idea how to do it?
For sure Apple will reject such app.
But below is what you can do if you want to do such thing, but this will open app.
In - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
, have below.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
//home button press programmatically
UIApplication *app = [UIApplication sharedApplication];
[app performSelector:@selector(suspend)];
//exit app when app is in background
exit(0);
}
In short, on opening app from push, kill the app.