[question]: Is it possible to renew the subscription?
How can we help?
I have an application in which I have several subscription IDs registered. In this case, I use OneSignal.initialize, which automatically sends the subscription. However, if the subscription is deleted or there is a problem, is it possible to automatically generate a new subscription for the user who has already given permission?
Currently, I can only generate a new subscription when I install the application again and OneSignal.initialize is called again.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hello, I have the same problem, I tried to find a solution in the onesignal documentation, but I couldn't find anything that could help me.
Any news?
I had a similar problem where one of my testing devices was in a bad state. The test device subscribed to my OneSignal app initially which was fine. Then I deleted the subscription from the dashboard on OneSignal. I installed a new version of the app on the test device and the subscription id / external id was persisted even though I had deleted it. Even uninstalling/reinstalling it seemed to cache the subscription id and external id on the device. Logging out of OneSignal and logging back in had no effect. This was really messed up beyond repair.
How I reproduced it with my second test:
- Create a new account with an active subscription to OneSignal app (staging)
- Create a new OneSignal app (staging 2)
- Change config to point from staging to staging-2, Rebuild and update the app on the device (not uninstall/reinstall)
Result
- No user/subscription was created on staging-2
- Subscription id and OneSignal id on the test device remained persistent with previous staging values.
Attempt to uninstall/reinstall the app
- After doing this the subscription and user was now created on staging-2 and I was able to send notifications.
To renew the subscription I had to create a new OneSignal app, Change the configs on the react native app and do a uninstall.reinstall before it worked. Luckily this was a staging environment but can't be replicated in production. So this needs to be looked at.
Thanks for providing that information @davram88. Let me take this to the team and try to investigate it a bit further.
@sherwinski any update on this? I cleared all my user data on my OneSignal dashboard but the app keeps on pulling the same subscription ID or getting it from the phone cache? Now I can't renew a new subscription by any means.
@davram88 Thanks for following up, here's what I've gathered since last time:
On Android, the expected behavior is:
- appID1, creates a Subscription
- put the app into the background, wait 30 seconds
- update the appID to appID2 in the OneSignal init code
- open the app after the 30 seconds to start a new session
- a new subscription for the device on appID2 should be created successfully
Some follow up questions that would help further debug:
- Make sure you have the latest version of our SDK in your app
- Is this on Android, iOS, or both?
- If Android, do both OneSignal App IDs use the same Firebase Project Service Account JSON file?
- When you changed the app ID, did you wait 30 seconds in between opening the app to start a new session?
Closing due to no response