我按照Apple 的说明实施了更新 Apple Wallet 通行证的选项。
我能够推送更新,并且它们在不同的设备上成功接收,但是我只能在执行“pull-to-update”之后才能看到更新。使用 pull-to-update 后,pass 上的字段会更新,并且更改消息会显示在通知面板中,但不会在屏幕上弹出通知。
我知道问题不在于设备或设备设置,因为我能够从其他来源的通行证获得自动更新。
但是那里提到的解决方案对我不起作用。
这是最初生成的传递示例和我对其进行更新后的传递:
前
{
"formatVersion": 1,
"passTypeIdentifier": "pass.com.domain.discountCoupon",
"serialNumber": "422",
"teamIdentifier": "ABCDEFGHIJKLMNOP",
"organizationName": "Company",
"webServiceURL" : "https://example.com/wallet/webServiceURL.php",
"authenticationToken" : "ABCDEFGHIJKLMNOP",
"description": "Card",
"logoText": "",
"foregroundColor": "rgb(1, 1, 1)",
"backgroundColor": "rgb(255, 255, 255)",
"labelColor": "rgb(1, 1, 1)",
"locations" : [
{
"longitude" : 0,
"latitude" : 0
}
],
"storeCard": {
"headerFields" : [
...
],
"backFields": [
{
"label": "MOBILE TERMS:",
"key": "mobileterms",
"value" : "mobile terms"
},
{
"changeMessage": "%@",
"label": " ",
"value": "I will change this soon",
"key": "fieldToChange"
}
]
}
}
后
{
"formatVersion": 1,
"passTypeIdentifier": "pass.com.domain.discountCoupon",
"serialNumber": "422",
"teamIdentifier": "ABCDEFGHIJKLMNOP",
"organizationName": "Company",
"webServiceURL" : "https://example.com/wallet/webServiceURL.php",
"authenticationToken" : "ABCDEFGHIJKLMNOP",
"description": "Card",
"logoText": "",
"foregroundColor": "rgb(1, 1, 1)",
"backgroundColor": "rgb(255, 255, 255)",
"labelColor": "rgb(1, 1, 1)",
"locations" : [
{
"longitude" : 0,
"latitude" : 0
}
],
"storeCard": {
"headerFields" : [
...
],
"backFields": [
{
"label": "New Title",
"key": "fieldToChange",
"value" : "A New Message",
"changeMessage": ""
},
{
"label": "MOBILE TERMS:",
"key": "mobileterms",
"value" : "mobile terms"
}
]
}
}