5

I am using OneSignal to manage push notifications. Everything works great, but how do you deal with multiple users on the same device?

For example, player A logs into my app. OneSignal only sees them by their player id which is associated with the device.

Now Player A logs out, and logs back into my app as Player B. Because both Player A and Player B use the same device, OneSignal will send them the same notifications (because the Player id is device specific).

How can you differentiate between many different users on the same device using OneSignal then?

vikzilla
  • 3,998
  • 6
  • 36
  • 57
  • Can't you send the player name (PlayerA/PlayerB) as a tag value? – Paulw11 Mar 04 '17 at 21:49
  • @Paulw11 OneSignal does not allow targeting via tag from the mobile SDK, according to this post: http://stackoverflow.com/questions/41566879/swift-how-sending-a-post-notification-from-onesignal-sdk-to-specific-username – vikzilla Mar 05 '17 at 19:48
  • The fact that you are sending directly from the app is important informstion that you should have included in your question :). It is also probably not the best way; using a server is the typical approach. – Paulw11 Mar 05 '17 at 19:55
  • @Paulw11 I am using Firebase as my backend and not sure how I would handle anything server-side – vikzilla Mar 05 '17 at 19:59
  • After a user logs in on a device, you need to get the player_id and is push id and search through your database for the combination of those two things and then update the associated user id to the new user – Paulw11 Mar 05 '17 at 20:16
  • Update: Firebase now provides Server side cloud code (and push notification support), so I am able to solve my problem. – vikzilla Oct 22 '17 at 05:48
  • Do you used onesignal or not, if yes what was the solution? – Ali Sajid Apr 03 '19 at 08:50

0 Answers0