user1751770
user1751770

Reputation: 21

How is a push token created for passbook?

My Question: How is a push token created for Passbook? Is APN registration required? If so, is the APN registration step to create the push token automatically executed (e.g. without requiring developer intervention) before the first REST call to register the pass with the provider when a user installs a Pass into Passbook? Apple's Passbook documentation doesn't specify how the push token arrives on the device for Passbook. It just mentions that it's something the device renders.

Background: I've been looking at the documentation from Apple regarding updating Passes in Passbook and nowhere does it specifically state how to generate the push token for push notifications to Passbook. According to the web service reference section, the push token is passed alongside the device library identifier, the authentication token, the pass type id and the serial number in the technical spec for registration and de-registration RESTful services.

My understanding with respect to push token persistance for custom iOS apps, is that the app itself needs to register with APN servers to create a push token for that app on the device, in preparation for push notifications, before the app can send down the push token to the provider (e.g my web server). This ensures that the APNs receive a push token from the provider the the APN itself generates on the device.

Upvotes: 1

Views: 1962

Answers (1)

Luca Rocchi
Luca Rocchi

Reputation: 6484

APN is not required , Passbook itself take care of Push Notification The push token is sent as payload in a json object when the registration web service get called

Passbook makes a call to the registration webservice as soon as a pass is added (and also in other cases)

It worth to say that you must use a .pem certificate on server side that comes from the certificate.p12 used to generate passes

this is how to get the push token in php

$data = json_decode(file_get_contents("php://input"));
$pushtoken=$data->pushToken;

Upvotes: 2

Related Questions