How to make a push notification for a pass

I made a pass web service already. Next, I need to make a push notification when my pass is updated. From Updating a pass of passkit programming guide, it is not in detail. Can you explain this in detail ?


The requirements and protocol for push notifications is documented in the Push Notification Programming Guide.

There are a few special considerations for Passbook:

  1. All Pass push requests must be sent to the production APNS server (gateway.push.apple.com on port 2195)
  2. You must use your Pass Type ID certificate and key to authenticate with the APNS server (do not use App APNS certificates)
  3. There is no need to handle device registrations, you simply use the pushToken that your web service received when the device registered the pass
  4. The payload should be an empty - E.g. {"aps":""}
  5. alert, badge, sound and custom property keys are all ignored - the push's only purpose is to notify Passbook that your web service has a fresh pass. The notification text will be determined by the changeMessage key in pass.json and the differences between the old and the new .pkpass bundles
  6. ThechangeMessage string should contain %@ if you wish for the content of the value key to be displayed. Change messages may have static text in addition to the %@ variable, such as this: "changeMessage":"New updates: %@". If no %@ is provided, a generic message with the kind of pass is displayed: "Store card changed".
  7. As of iOS9, if you modify more than one field at a time, only one generic message will be displayed on the lock screen.
  8. You still need to regularly query the feedback service and purge expired/invalid pushTokens from your database

Note that push updates can be implemented independently of your web service. Apple provide some sample objective-c code in Listing 5-1 here.