简体   繁体   English

ios苹果推送通知服务器端设计

[英]ios apple push-notification server side design

Our app users can login their accounts and if a user is logged in, then he can receive push notifications when someone added him as a friend. 我们的应用程序用户可以登录其帐户,如果用户已登录,那么当有人将其添加为朋友时,他可以接收推送通知。 Based on my understanding, our server needs to record the userID and its notification token, so that any events happened to the userID, the server can find its token and send to apple APN. 根据我的理解,我们的服务器需要记录userID及其通知令牌,以便该userID发生任何事件,服务器都可以找到其令牌并将其发送给apple APN。 If this token is changed, we also need to update the record in server. 如果更改此令牌,我们还需要更新服务器中的记录。 I am not quite sure if my understanding is correct or not. 我不确定我的理解是否正确。 anyone can help? 有人可以帮忙吗? Thank you. 谢谢。

Yes, you have to store on your server a unique ID for each user and its notification token. 是的,您必须在服务器上为每个用户及其通知令牌存储唯一的ID。 You should update this token stored on your server with a connection in AppDelegate method "didFinishLaunchingWithOptions". 您应该使用AppDelegate方法“ didFinishLaunchingWithOptions”中的连接更新存储在服务器上的令牌。 Everytime something happens, as a new friend request, your server have to send a new push notification using the stored token. 每当发生新的朋友请求时,您的服务器都必须使用存储的令牌发送新的推送通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM