keithcelt
keithcelt

Reputation: 415

What conditions cause this passbook error?

And how do I fix it?

Passbook error [2013-03-22 11:10:28 -0700] 
Web service error for pass.com.example.purchase (https://www.example.com/): 
Server requested update to serial number '12345', but the pass was unchanged.

The above error is coming in several times per day for passes that have not been changed. Some of the passes are months old.

Upvotes: 1

Views: 1254

Answers (1)

PassKit
PassKit

Reputation: 12591

This error occurs when a call from a device to:

webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag,

returns one or more serial numbers, and your web service returns a 302 response (or a 200 response but delivers an identical .pkpass bundle) to the subsequent call to:

webServiceURL/version/passes/passTypeIdentifier/serialNumber

In the case of a 200 response, you will receive a second error message warning you that your web service ignored the last modified header and returned the full unchanged pass data.

Normally, a device would request updated serials following a push request. In such cases, your pass has normally has changed and the alert does not trigger.

However, Passbook also calls for updates serials immediately after a reboot and so you may be seeing a wave of these messages due to the recent 6.1.3 iOS update, as the freshly installed Passbook library calls your service to see if there are any updates available to older passes it has inherited.

Also worth noting that, Passbook calls for updated serials by passTypeIdentifier. If you are issuing a push request for a one pass, but the device contains other passes with the same passTypeIdentifier, your web service may be inadvertently responding with serial numbers for these old passes.

To fix it, you should look at your logic for handling the "Getting Serial Numbers" call to ensure that no serials are returned that would give a 302 response to a "Getting the Latest Version of a Pass" call.

The spirit of this error is to maximise caching efficiency on the device, and protect people's data plans from unnecessary pass downloads (since .pkpass bundles often weigh in at over 500kb).

Upvotes: 4

Related Questions