I have an app which had 7,000 users subscribed on Pushwoosh. We switched from Pushwoosh to OneSignal and updated our app with OneSignal documentation. New users downloading our app are getting subscribed to our push notifications but the old ones are not getting updated. Do we have to trigger permission to send push notification again ? Does Apple allow to do so ? What is the workaround this ?
OneSignal subcribers not updating after switching from Pushwoosh
550 Views Asked by Omkar Jadhav AtThere are 2 best solutions below
On
Notification Permissions & APNs Token
Notification permission is granted at the app level, so no matter what SDK / library is in your app it can read if the user has already accepted notifications and the APNs token.
The OneSignal iOS SDK does automatically check if permission is already granted and attempts to register for an APNs token. The OneSignal SDK will register the device with the app_id you put in your app and create a new player if it is the first time you opened the app since you added OneSignal.
APNs will return the same push token each time unless the user has fully uninstalled and reinstalled your app. However just in-case Apple were to deiced to rotate the token the OneSignal SDK does call the APNs register API to be sure.
Finding & Fixing The Issue
To find the issue I recommend the following;
- Only include one push notification SDK in your app at a time, it possible for SDKs to have conflicts due to method swizzling or other possible issues.
- In this case remove the Pushwoosh SDK if you using OneSignal.
- Try to reproduce the issue on a test device by upgrading your app.
- When testing the upgrade, I recommend enabling verbose logging in the OneSignal SDK.
OneSignal.setLogLevel(.LL_VERBOSE, visualLevel: .LL_NONE)
- Also observe at this point if you are getting a user on the OneSignal dashboard.
- If there was an issue getting an APNs token by the OneSignal SDK there will still be a user, they will just show as unsubscribed with details why.
- When testing the upgrade, I recommend enabling verbose logging in the OneSignal SDK.
This all depends on how you are getting the device push token from the user's device and sending it to OneSignal. A common mistake is to only get the device token the first time the user accepts the notification permission prompt. However, the device push token is subject to change randomly at any point in the future which can result in outdated device push tokens on the server used to send notifications.
To combat this, it is suggested to register for push notification every time the user launches the app. While this won't re-prompt them to accept notification permissions, it will fetch the device push token again. The push service you are using should then be updated with the new device token.
TL;DR: at every app launch register for a device push token and send it to your push server.