0

Example with Facebook application in iOS, use Apple Push Notification Service (APNS). I think when Facebook server see an new feed or new friend request, it will send a message to APNS. After that, APNS will push notification to client, who is logging in that facebook account. My question is :

  1. Why APNS know which device logging in that facebook account ?
  2. How APNS can send message to that client exactly (why APNS know client's IP address) ?

As I know, Push Notification also a technology use in Windows Phone ( Microsoft Push Notification Service), and Android (Cloud to Device Message).

Thanks.

1 Answer 1

1

Well APNS (Apple Push notification Service) works on a per device per app unique ID. You push you message to this unique ID and it get deliver on the users device.

Your app must request this ID and pass it to the server wich will send out the notifications. The ID is that create by the APNS API, thus Apple knows that the ID belongs to that device and app. I guess that the windows and android will work in the same way.

Sign up to request clarification or add additional context in comments.

4 Comments

Did you mean Facebook app was registered with APNS an ID of itself on that device.
Before I read your answer, I think it send a message to device with app package, example com.facebook.iosapp. And how APNS know IP address correspond with each device ID. I think every connect to Internet or IP change, my device will send IP address to APNS.
No IP address is used, it al based on a special ID (the APNS Token). The device will contact the APNS server and keep a socket open to receive new notifications for all apps.
So, did you mean iOS have to connect to APNS in interval time (example every 5s) to check whether it has new connection or not ? It may be take more battery. Please, can you give me a document about connection mechanism between iOS device and APNS, to I can learn more !

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.