I am receiving the same push notification twice in iOS9, although it is working fine in iOS8.
I have used the following code to register with push notifications:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]) { // use registerUserNotificationSettings UIUserNotificationSettings *setting = [UIUserNotificationSettings settingsForTypes:( UIUserNotificationTypeSound | UIUserNotificationTypeAlert|UIUserNotificationTypeBadge) categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:setting]; [[UIApplication sharedApplication] registerForRemoteNotifications]; } else { // use registerForRemoteNotifications [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert |UIRemoteNotificationTypeBadge)]; } #else // use registerForRemoteNotifications [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; #endif
Android devices with 2 copies of the app installed on the device can also receive duplicate notifications. This could happen if you have a production and staging / dev app installed at the same time with different Android package names.
If you've added multiple Instagram accounts, you may get push notifications from any account that has them turned on. This depends on when you last logged in and the number of devices that are logged in to an account.
As such, just a few minutes later, your device lights up, vibrates, or rings again to remind you of the same message notification a second time. The reason for this is that Apple sets notifications and alerts to repeat once by default on iOS devices.
Firstly, push notifications used to look like a spam email but get developed into personalised, interactive notifications that provide information and value with the shortest wording possible. They can be triggered based on a user's request or the action performed by a user.
I had this problem in several apps, and looks like duplicates appear if you call registerUserNotificationSettings:
more than 1 time.
More details in this answer: https://stackoverflow.com/a/35064911/4495995
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