I want to build a system to integrate with Passbook, the first step is to register a device to
receive Push Notification for a pass, and I know it will use web service like “webServiceURL /version /devices/deviceLibraryIdentifier /registrations/passTypeIdentifier /serialNumber”.
“The device library identifier is a Passbook-specific shared secret between the user’s device and your web server. It is not related to the device identifier (UDID). The device identifies itself with a different ID to different servers and it may change its ID at any time. Its purpose is to allow efficient communication between the device and your server, not to let your server keep a list of of what passes are currently installed on a device. The device library identifier uniquely identifies a device and indicates that the entity making the request is authorized to make such a request.”
My question is
- How to generate the deviceLibraryIdentifier on the device? What’s the best format?
- When do the registration, is it when pass is added to Passbook on 3rd party app,then, for that passes added via url/email, when to register?
The
deviceLibraryIdentifieris issued by the Passbook app. You don’t need to generate it yourself. When a user adds a pass to Passbook, the app will send a request to your definedwebServiceURL. Example:You need to save the passed
deviceLibraryIdentifier,serialNumberandpushToken(in POST body) in order to issue a APNS push to Passbook and update a given pass.I really recommend the Passbook introduction videos from WWDC 2012 to get a better understanding of the Passbook ecosystem.