0

I am writing back end for mobile app, we are sending pushes (something like one user add another to buddies) he should accept it or decline via push notification(it is required), server got some feedback from notification, and do something.

I am familiar with two techniques about pushes, first I push directly on device using token, second is abstraction when user subscribes for channel and I send push notification on this channel. Id in my application is email, and I suggest to update device token in the database each time user login, and send push on it, but how should I identify device OS ?(IOS/Android)

1) How to scale it, if user have multiple devices, and when user will logout, and login from other device ?

May be there is common solutions for this problem.

Slow Harry
  • 1,857
  • 3
  • 24
  • 42
  • I would think you want your DB to have a table with the user's device token, type and maybe other standards like date added ect. Just add to that table with a reference to the user each time to login with a new device. I don't think it is a good design decision to update the device token every time the user logs into the app, but you may have your reasons. – Michael Jan 06 '14 at 23:44
  • @Michael let's consider user login with device of his friend – Slow Harry Jan 07 '14 at 05:36
  • @Michael may be there is other solution for this issue. I don't like this idea too. – Slow Harry Jan 07 '14 at 05:38
  • You can't know if a user has logged into a friends device. I would assume you are only pushing notifications to logged in users of your service, so it really shouldn't be an issue. You could remove on user logout. You wouldn't want only one device to push APNS to since many users will have multiple devices. If they are logged into more than one you should be pushing to them. – Michael Jan 07 '14 at 20:01
  • @Michael actually I should push notification even for offline users(for example messages from chat and buddy requests) In my application it is impossible to login on many devices at once. – Slow Harry Jan 08 '14 at 04:05
  • check atleast once: http://stackoverflow.com/questions/14156873/push-notification-in-ios/39368761#39368761 – Mr.Javed Multani Sep 08 '16 at 07:01

0 Answers0