我目前正在开发适用于Android的pkpass库。有一点我无法弄清楚。 Apple's PassKit Web Service Reference指定如何注册设备以进行自动更新。这似乎只适用于iOS设备。
但是,有一些适用于Android的应用能够以某种方式注册自动更新。例如Wallet Passes | Passbook和Pass2U Wallet for Passbook。
我使用PassSource's API创建了一个演示pkpass文件。当我在他们的网站上更新文件时,这些应用程序会以某种方式得到通知,然后向用户显示通知。
这是我试图创建的行为,但我无法弄清楚我的生活是用什么URL来调用哪些参数。
我尝试了所有可能的值组合:
POST request to: webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier/serialNumber
Parameters
webServiceURL
The URL to your web service, as specified in the pass.
version
The protocol version—currently, v1.
deviceLibraryIdentifier
A unique identifier that is used to identify and authenticate this device in future requests.
passTypeIdentifier
The pass’s type, as specified in the pass.
serialNumber
The pass’s serial number, as specified in the pass.
Header
The Authorization header is supplied; its value is the word ApplePass, followed by a space, followed by the pass’s authorization token as specified in the pass.
Payload
The POST payload is a JSON dictionary containing a single key and value:
pushToken
The push token that the server can use to send push notifications to this device.
在Apple文档中指定。
我还研究了Walletpasses Documentation和Pass2U Documentation
非常感谢帮助!
谢谢!