Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Apple Push Notifications to update a Passbook

I have created Passbooks and they are loaded onto my customer's iOS devices. I need to update these Passbooks. According to the Passbook docs you need to use the Apple Push Notification Service (APNS) to trigger a pull from the iOS device in order to update the Passbook. This APNS push consists of a "push token" and a "pass type id." However, the APNS body is to be left empty.

The APNS docs talk about a "device token" needed to send a push notification but make no mention of a "push token."

Is an APNS "device token" the same as a Passbook "push token"? How do I send the Passbook "pass type id" in my APNS push?

like image 940
keithcelt Avatar asked Nov 28 '12 22:11

keithcelt


1 Answers

  • The push token is given to your server when the device registers.

It is found in the body of the POST request in a JSON dictionary. For example:

{ "pushToken":"PushTokenFromDevice" }

  • The pass type id is embedded with the certificate used to generate the push notification to Apple's Push Notification Service

If you need a PHP implementation, I recommend: APNS PHP

like image 50
Efren Avatar answered Sep 28 '22 04:09

Efren