简体   繁体   English

如何使用Apple推送通知更新Passbook

[英]How to use Apple Push Notifications to update a Passbook

I have created Passbooks and they are loaded onto my customer's iOS devices. 我创建了Passbooks,它们被加载到我客户的iOS设备上。 I need to update these Passbooks. 我需要更新这些Passbooks。 According to the Passbook docs you need to use the Apple Push Notification Service (APNS) to trigger a pull from the iOS device in order to update the Passbook. 根据Passbook文档,您需要使用Apple推送通知服务(APNS)来触发iOS设备的拉取以更新Passbook。 This APNS push consists of a "push token" and a "pass type id." 此APNS推送包含“推送令牌”和“传递类型ID”。 However, the APNS body is to be left empty. 但是,APNS机构应留空。

The APNS docs talk about a "device token" needed to send a push notification but make no mention of a "push token." APNS文档讨论了发送推送通知所需的“设备令牌”,但未提及“推送令牌”。

Is an APNS "device token" the same as a Passbook "push token"? APNS“设备令牌”是否与Passbook“推送令牌”相同? How do I send the Passbook "pass type id" in my APNS push? 如何在APNS推送中发送Passbook“pass type id”?

  • The push token is given to your server when the device registers. 当设备注册时,推送令牌将提供给您的服务器。

It is found in the body of the POST request in a JSON dictionary. 它位于JSON字典中POST请求的主体中。 For example: 例如:

{ "pushToken":"PushTokenFromDevice" } {“pushToken”:“PushTokenFromDevice”}

  • The pass type id is embedded with the certificate used to generate the push notification to Apple's Push Notification Service 传递类型ID嵌入了用于生成Apple推送通知服务推送通知的证书

If you need a PHP implementation, I recommend: APNS PHP 如果您需要PHP实现,我建议: APNS PHP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM