-1

My current understanding of APNS is that Apple will provide the different device token for each device. Based on device token, service provider will send the notification to device. So if we login with same account in two devices, then can we get single notification in two devices or only latest device? And if we send the notification to device,and device is in switch off mode.Then apns will return any error message and store that device token in feed back service list or wait for send the notification to device?

4
  • Sending the APNS Payload it's responsibility of developer and which account are you log in can you please clarify it? Mar 27, 2015 at 11:49
  • It might help to provide a clear example of the behavior scenarios you think are possible.
    – Dan Field
    Mar 27, 2015 at 12:16
  • @GsrIos is the issue solved or is anything still unclear?
    – nburk
    Mar 29, 2015 at 9:45
  • Yes.solved.I have one more doubt.Please check my question,i updated
    – Gsr Ios
    Mar 30, 2015 at 7:06

2 Answers 2

0

The precise question to your answer is that you can only get one push notification for the latest device that the user chose for login. Because of Apple's APNS architecture, it is not possible to receive the same device token on two different devices, regardless of both devices belong to the same user.

In order to send a notification to multiple devices, you'll have to adjust your data model in the backend such that one user can be associated with multiple device tokens. Then, when your event is triggered, you can send the notification to both devices (assumed of course the user is loggen in both).

0

Which same account are you talking about? Do you mean Apple Account? In any case, both devices will have different token.

If you somehow want to group devices according to accounts, you will have to do that at your server. You server should figure out that someone with same account has 2 different devices and 2 different tokens, so you send token to both devices.

Let's say users sign in to your application through facebook. If a user John Doe signs in to his iPhone using Facebook, his device will receive a token. If John Doe signs into his iPad using the same account, the device will receive a different token.

4
  • For example you can take facebook account.I login my account in my device and my friend device.Both deveices will get same notification about my account?
    – Gsr Ios
    Mar 27, 2015 at 11:49
  • No, both devices will get different Token. You should keep track of this at your server. When sending the information of token, you should also send facbookId, and you server should notice that the same user has 2 devices and hence two tokens.
    – Shamas S
    Mar 27, 2015 at 11:55
  • But in real time we are getting notification on two devices.
    – Gsr Ios
    Mar 27, 2015 at 12:18
  • Just to get it straight, you get same push notification for 2 devices? And when you send push notification on it, you receive it on two devices?
    – Shamas S
    Mar 27, 2015 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.