Q:

iOS - Passbook Registration Url For Automatic Updates

I am having quiet a few problems implementing the automatic update functionality on a pass of passbook. But my current question is (It is not a very good one, I dont have alot of knowledge about web end work so forgive me if I ask something obvious or stupid). 
I am using this url against the key webServiceURL in the pass.json file.
https://serverURL/v1/devices/deviceLibraryIdentifier/registrations/passIdentifierAsIsPastedFromJsonFile/serialNumAsIsPastedFromJsonFile

Now, according to my understanding and things I read on the stackoverflow and apple documentation. deviceLibraryIdentifier is supposed to be added by iOS itself and will be sent to server in a POST request. So, we are to fetch 3 values from URL, 1 from header and 1 from json payload/body. I just wanted to confirm if I am doing these things correctly ? (Because server end person is saying that he is getting deviceLibraryIdentifier as is, as a string "deviceLibraryIdentifier" and he is not getting any key for authenticationToken in the header also). Am I missing something ?

A:

Your webServiceURL in pass.json should simply be https://serverURL.  The device will automatically complete the rest of the URI before each request.  You need to implement a RESTful service that will be able to parse the string, recognise which of the 5 methods of the PassKit WebService is being requested, and then respond with the correct response, as per the spec.
So in the case of a registration, the device will take your server URL, add /v1/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}/{serialNumber} to the URL to complete the URI.
Your server should then parse the URI, identify the pass via the passTypeIdentifier and serialNumber provided and create a record in your devices database that corresponds to the deviceLibrayIdentifier and the devicePushToken that will be contained in a JSON object in the body of the request.
To help developers get started, Apple provide a Ruby and SQLite sample that you could either just directly implement, or could port to PHP.

