OneSignal-Android-SDK
OneSignal-Android-SDK copied to clipboard
Fail to deliver the message to the user due to Not Subscribed status after uninstall then reinstall the app.
Description:
Fail to deliver the message to the user due to Not Subscribed status after uninstall then reinstall the app.
Environment I'm using OneSignal version 4.4
Steps to Reproduce Issue:
- Install the app on the device. Then send the player_id_1 to our BE server. the BE server uses the API to send a push to the list of player_id. It was a success at the first install time of the app.
- Uninstall the app, then reinstall the app. now OneSignal generates a new player_id_1, we resend this new player_id to our BE to use to deliver push to the app. But it failed.
- I check the user on the Project on OneSignal, and see there are 2 users with player_id_1 and player_id_2. I noticed that the player_id_2 user is recorded as UnSubscribed user. This may be a reason why the notification can deliver to the user.
- After I delete the user has player_id_1, then I can able to send the push to the user with player_id_2
The questions are:
- What is the logic of marking the player_id_1 as a Not Subscribed user?
- Is there any way we can auto-remove the not active player_id_1 (when uninstalling the app) instead of doing manually in our backend?
- when sending a push to a list of player ids, why the user can not receive the push notification if one of them has a status that is not Subscribed although they are the same device and we didn't change anything for this user? In this case, is [player_id_1, player_id_2) on the same device.
For sending notification to specific user regardless of app uninstall and then install, you should use external user id (server id) to insure that user get notified. Every time app install the OneSignal registered as its new user & deploy new user id (player_id) with new token (push_token). The notifications are send by targeting the tokens.
For external id, if user get authentication by server then there is server id which is specific for user with email. i.e Google Authentication via Firebase...etc.
Thanks.
@Tan2NT Thanks for reporting with these step by step details!
Needs more details
I have a few more follow up questions however.
- Could you check what the
player.identifier
(aka pushToken) is for these two records in each step?- Wondering at any point if you have two player records with the same value here.
- In your step 4 above did you do anything else besides delete player_1?
Following up on your questions
What is the logic of marking the player_id_1 as a Not Subscribed user?
The "Not Subscribed" status means that Google never provided a pushToken to the OneSignal SDK or Google reported back to OneSignal the pushToken is no longer valid when OneSignal tried to send a notification last time.
Is there any way we can auto-remove the not active player_id_1 (when uninstalling the app) instead of doing manually in our backend?
It's not possible, since Android does not let you run any code when the app is being uninstalled. A notification has to be sent to it before Google will report the pushToken is no longer valid.
when sending a push to a list of player ids, why the user can not receive the push notification if one of them has a status that is not Subscribed although they are the same device and we didn't change anything for this user? In this case, is [player_id_1, player_id_2) on the same device.
Are you sending the notification from the dashboard or REST API? Can you provide how you are targeting them?
- Such as a Segment or
included_player_id
@m-asadullah That is a good suggestion, this may solve the issue for them, but without more detail from them I can't confirm. It definitely would simply the integration with OneSignal since you would no longer need to track player_ids for all the devices a user may have (or re-installs).
Closing issue due to no response. Please @ mention me if we need to revisit this issue.
We have an updated major release available for our Android SDK with many improvements and enhancements! Please refer to the migration guide for more information on upgrading.
Thanks!