gpt4 book ai didi

apple-push-notifications - 苹果钱包 : Pass won't update automatically after pushing an update

转载 作者:行者123 更新时间:2023-12-02 20:43:02 26 4
gpt4 key购买 nike

我关注了Apple's instructions关于在 Apple Wallet 上实现更新通行证的选项。

我能够推送更新,并且它们在不同的设备上成功接收,但是我只能在执行“拉取更新”后才能看到更新。使用 pull-to-update 后,通行证上的字段会更新,并且更改消息会显示在通知面板中,但通知不会在屏幕上弹出。

我知道问题不在于设备或设备设置,因为我能够从其他来源的通行证获取自动更新。

我看到一些相关问题,例如:1 2 3 4

但是那里提到的解决方案对我来说不起作用。

以下是最初生成时的通行证和我对其进行更新后的通行证的示例:

之前

{
"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"
}
]
}
}

最佳答案

发现问题:

生成过程中缺少“Last-Modified” header 。这是 iOS 推送通知的要求。添加后: header('Last-Modified: '.gmdate('D, d M Y H:i:s T'));

对于我的通行证生成代码,通知出现了。为了使通知显示 changeMes​​sage 文本,我按照@PassKit的答案并在新的内容中添加了 changeMes​​sage (包括 %@)通过我在更新后推送。

关于apple-push-notifications - 苹果钱包 : Pass won't update automatically after pushing an update,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45496864/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com