Hetal Vora
Hetal Vora

Reputation: 3361

How does APNs locate device to send notification to?

I was reading about APNs and was curious to know how does the APNs server locate a device based on the device token. The device token is received by the device on app launch and is then given to the provider. The provider sends this token with the payload to APNs server. How does APNs determine the IP address (assuming it does need IP and port) of the device to which it needs to send the notification?

Upvotes: 3

Views: 413

Answers (2)

RolandasR
RolandasR

Reputation: 3047

most likely device is connected all the time (or almost) and apple stores key value pairs:

device id | connection resource
device id | connection resource
device id | connection resource

after you send info containing device id apple picks up resource and forwards your request (proxy).

Upvotes: 1

Nekto
Nekto

Reputation: 17877

It seems that iOS device every N-minutes connect APNs and asks if there are new Push-notifications for him.

Or may be every N-minutes he sent its current contacts (ip, port, etc).

You shouldn't worry about it anywhere =)

Upvotes: 1

Related Questions