how to handle multiple devices when using Push Notification?

瘦欲@ 提交于 2019-12-21 20:57:06

问题


I am developing an application in which I want to use push notification service. I have a server, now I want to know that

  • How do I handle multiple devices?

  • Is there a unique device id/name for every iphone?

  • Suppose I want to delete request for a specific device token, so how do I handle multiple users?

  • Is there a way I can generate unique name for every device through application?


回答1:


You should really read the APNS documentation, this is all explained in depth there.

The short answer is that when you launch an app on the phone it requests a push notification key from the OS. You then take that key and send it back to your server. Your server uses that key when it sends a push via Apple's servers to indicate the devices to send the push out to.

The service just gives you a token. If you want accounts or device names you need to come up with them and store them with the credentials on your server.

You handle multiple users by same way you handle single users, you send message with the appropriate key to the service.

As for deleting a request, you can't. It is like a text message, there may be some latency before hits the device, but the moment you commit the push it could be delivered instantly.



来源:https://stackoverflow.com/questions/1642182/how-to-handle-multiple-devices-when-using-push-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!