2

OneSignal is a free service that has an api to send notifications to different devices (Android, iOS).

When the user registers to our app, the OneSignal player_id (a device token id) is stored as a deviceToken in our own backend.

From our backend we store the deviceTokens (playerIds) for the user and send a request to OneSignal to store the userId as a tag to the OneSignal service.

Since one user can have multiple player_id's (devices), and one device can have multiple users, we use this as a filter when sending out notifications.

However when the user re-installs the app, the player_id can possibly change:

OneSignal Documentation: Player ID

(When does the OneSignal User / Player ID change?)

On Android, there isn't a method available that can be called to remove the deviceToken from OneSignal before uninstall:

Perform a task on uninstall in android

This basically means that our backend has no way to destroy unused devicetokens (when a device gets a new player_id after reinstall).
Also, we cannot send a request to OneSignal to remove expired player_ids.

I don't like this since our backend will continue trying to send notifications to devicetokens that are no longer valid.
This adds overhead and will pollute the system.

BSMP
  • 4,596
  • 8
  • 33
  • 44
html_programmer
  • 18,126
  • 18
  • 85
  • 158
  • 2
    This won't fix what you have now, but update the app to acknowledge notifications. If you don't get acknowledgement for a player id after a certain number of attempts or a certain amount of time, assume it's uninstalled and delete the record. – nasch Oct 01 '17 at 15:17
  • I have the same problem and I do not agree with the comment above. The issue is a user can still be inactive but LOGGED IN and using silently the app. The issue is that One Signal or FIrebase should get notified upon uninstall in order to remove certain ids. – oetoni Oct 09 '18 at 21:59
  • Very good question and I am thinking on the exact same thing. How did u mitigate this issue in the end? Please share... – Neel Oct 21 '18 at 19:38

0 Answers0