How to make a push notification for a pass

江枫思渺然 提交于 2019-11-26 07:43:54

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/15877496/how-to-make-a-push-notification-for-a-pass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!