Enable/Disable Apple Push Notification from iPhone app?

You can read your app’s permissions using UIRemoteNotificationType enabledTypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; and then performing a bitwise and operation with the different types to see which are enabled. You can also call unregisterForRemoteNotifications to disable notifications. The one thing you can’t do is turn on notifications, although you can direct the user.

How to handle push notifications if the application is already running?

You can implement application:didReceiveRemoteNotification: Here is a possible sample code: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { NSString *message = nil; id alert = [userInfo objectForKey:@”alert”]; if ([alert isKindOfClass:[NSString class]]) { message = alert; } else if ([alert isKindOfClass:[NSDictionary class]]) { message = [alert objectForKey:@”body”]; } if (alert) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@”Title” message:@”AThe … Read more

Starting app only if its not currently running

Use a “launch Intent” for your app, like this: PackageManager pm = getPackageManager(); Intent launchIntent = pm.getLaunchIntentForPackage(“your.package.name”); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, launchIntent, 0); Replace “your.package.name” with the name of your package from the Android manifest. Also, you should remove the special launchMode=”singleTask” from your manifest. Standard Android behaviour will do what you want.