Silent push notifications only delivered if device is charging and/or app is foreground

We have experienced the same behavior and have been trying to understand why iOS decides to deliver some notifications and not others. What we have worked out so far is: Messages will get received more reliably in background when on wifi than on cellular data. In fact, when on a cellular network (3g/4g), if your … Read more

iOS push notification: how to detect if the user tapped on notification when the app is in background?

OK I finally figured out. In the target settings ➝ Capabilities tab ➝ Background Modes, if you check “Remote Notifications”, application:didReceiveRemoteNotification: will get triggered as soon as notification arrives (as long as the app is in the background), and in that case there is no way to tell whether the user will tap on the … Read more

registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later

For iOS<10 – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { //– Set Notification if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) { // iOS 8 Notifications [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [application registerForRemoteNotifications]; } else { // iOS < 8 Notifications [application registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)]; } //— your custom code return YES; } For iOS10 https://stackoverflow.com/a/39383027/3560390