Duplicated Notifications
Troubleshooting Duplicate Notifications
This page discusses the common reasons for seeing duplicate push notifications. If you see duplicate in-app messages, see Duplicated In-App Messages.
Known iOS and Android Issues
- Apple acknowledged an issue with iOS 17 that was fixed in iOS 17.3 details here.
- If using our Android SDK versions 4.4.1 - 4.6.2 please update to the latest versions of our SDK.
Same message sent multiple times
Usually duplicate notifications are due to sending the same push data multiple times with our API. Check your server code that API requests are not repeated with retries or other code errors.
If you are moving to OneSignal and continue to send push from a previous messaging system, this can also cause duplicates and you should discontinue sending from the previous messaging system when you start sending from OneSignal.
Multiple Push Notification SDK
Check to make sure you don't have another push notification plugin/SDK in your app as it could be trying to parse the OneSignal notification, showing it multiple times. Our SDKs have protections in place to help prevent this, but the other push SDK may not. See below What happens if I have 2 different Notification SDKs in my app?.
Multiple App Instances
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. This would result in two different subscription IDs and two different push tokens.
You can long press on each notification to ensure they are coming from the same app.
iOS: If there were 2 or more subscribed device records in our database with the same Push Token then the device would get 2 different notifications and each could be tapped on. We have checks to help prevent this from happening but can happen if you try importing the same token multiple times.
Web Push: Duplicate notifications happen when you add the OneSignal App ID to 2+ different origins and subscribe to those origins. See the definition of an origin.
Since Web Push subscriptions are tied to the user's browser profile and site origin, when you send a notification from the OneSignal App ID, it will show a notification per origin the user is subscribed under.
To fix this on your browser, reset your browser data for each origin you used under this App ID.
If you suspect this is an issue for multiple users, you will need to create a brand new OneSignal App and add the new App ID to your site's OneSignal init code.
Users will need to return to the site and subscribe again.
You can also get duplicate notifications on web if you subscribe to the same site on multiple browsers and/or the same browser but multiple Browser Profiles. When you click the push, it should open the browser under the browser profile you are subscribed under. You can reset your browser data to stop it from showing on either or both.
Still having problems? We're happy to help!
Make sure you are using the latest version of the OneSignal SDK and try to get a log from the device if you can reproduce it.
Include as much as you can of the following to help us find your issue quicker:
- Version of our SDK
- Version of the SDK
- Device OS version
- Building on Mac or Windows
- Xcode log or logcat of the app starting and the problem point
- Any other libraries or plugins in your app
- Details on reproducing your problem.
FAQ
What happens if I have 2 different Notification SDKs in my app?
On Android, our notification payload contains a “custom” key with a nested “i” value. If the notification payload received does not contain this, our SDK will not process the notification.
On iOS, we also have the same “custom” key with nested “i” value, however because Apple has a standard payload it will show all notification sent to the device. So if you send a push from your old platform to a device, do not send the same notification from OneSignal or the user will get it twice.
For iOS Click Handlers, depending on how you handle notification opens you might have to add a check for "custom": { "i": ""} as well. Or if you have your own format, we recommend checking for yours instead.
How to send push from a previous provider and OneSignal?
On Android, you should remove your previous provider's notification handling code upon adding OneSignal and releasing the app. As users update the app, the previous push code will be removed and they will not get push sent from that provider.
On iOS, you should add OneSignal and release the app update, but continue to send from the previous provider until you are ready to move only to OneSignal. If you send from both OneSignal and your previous provider to iOS, you may send duplicate notifications.
Updated 9 months ago