简体   繁体   中英

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. 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. You should update this token stored on your server with a connection in AppDelegate method "didFinishLaunchingWithOptions". Everytime something happens, as a new friend request, your server have to send a new push notification using the stored token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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