Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: Is it possible to renew the subscription? #1758

Open
1 task done
TierryBr opened this issue Nov 5, 2024 · 6 comments
Open
1 task done

[question]: Is it possible to renew the subscription? #1758

TierryBr opened this issue Nov 5, 2024 · 6 comments

Comments

@TierryBr
Copy link

TierryBr commented Nov 5, 2024

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

  • I agree to follow this project's Code of Conduct
@sthephanyel
Copy link

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.

@mtebele
Copy link

mtebele commented Jan 29, 2025

Any news?

@davram88
Copy link

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.

@sherwinski
Copy link

Thanks for providing that information @davram88. Let me take this to the team and try to investigate it a bit further.

@davram88
Copy link

@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.

@sherwinski
Copy link

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants