How to make a push notification for a pass

I already made a pass webservice. Then I need to make a push notification when my badge is updated. From the update of the passkit programming guide, it is not detailed. Could you explain this in detail?

+1


source to share


1 answer


The requirements and protocol for push notifications are described in the Push Notification Programming Guide .

There are several special considerations for Passbook:



  • All missed push requests must be sent to the production APNS server (gateway.push.apple.com on port 2195).
  • To authenticate to the APNS server, you must use your Transfer Type ID and not use APNS App certificates.
  • No need to handle device registration, you just use pushToken

    which one your web service received when the device registered the pass
  • The payload must be empty - eg. {"aps":""}

  • alert

    , badge

    , sound

    And properties of the user keys are ignored. Push's sole purpose is to notify Passbook that your web service has a new pass. The notification text will be determined by the key changeMessage

    in pass.json and the differences between old and new .pkpass packages
  • The string changeMessage

    must contain %@

    if you want to display the contents of the key value

    . Otherwise a generic message will be displayed
  • Starting in iOS9, if you change multiple fields at the same time, only one generic message will be displayed on the lock screen.
  • You still need to regularly query the feedback service and flush and / or invalidate pushTokens from your database.

Please note that push updates can be implemented independently of your web service. Apple provides some example objective-c code in Listing 5-1 here .

+14


source







All Articles