我正在尝试按照本文档中的“获取最新版本的通行证”部分将新的通行证 json 数据发送到我的设备以更新我在 Apple Wallet 中的通行证。
新的 json 数据与我用于成功创建 pass 的 json 数据完全相同,除了 backgroundColor 从 #3e7cc8 更改为 #000000(用于测试)但我一直收到“Invalid json data”错误。
下面是创建成功的json数据
{
"description":"description",
"formatVersion":1,
"organizationName":"organizationName",
"passTypeIdentifier":"passTypeIdentifier",
"serialNumber":"serialNumber",
"teamIdentifier":"teamIdentifier",
"foregroundColor":"#ffffff",
"backgroundColor":"#3e7cc8",
"labelColor":"#ffffff",
"barcode":{
"message":"d568866a45dfc010ac680a9d06e5a48feb9216a2",
"messageEncoding":"utf-8",
"format":"PKBarcodeFormatQR"
},
"logoText":"logoText",
"storeCard":{
"headerFields":[
],
"primaryFields":[
],
"secondaryFields":[
{
"key":"name",
"label":"",
"value":"Nick"
},
{
"key":"points",
"label":"",
"value":"0 Points"
}
],
"auxiliaryFields":[
],
"backFields":[
{
"key":"email",
"label":"Email",
"value":"hoangtrung.uit@gmail.com"
},
{
"key":"phone",
"label":"Phone",
"value":"+841689984964"
}
],
"locations":[
]
},
"authenticationToken":"authenticationToken",
"webServiceURL":"https://mydomain/passbook"
}
以及无效的更新 json 数据
{
"description":"description",
"formatVersion":1,
"organizationName":"organizationName",
"passTypeIdentifier":"passTypeIdentifier",
"serialNumber":"serialNumber",
"teamIdentifier":"teamIdentifier",
"foregroundColor":"#ffffff",
"backgroundColor":"#000000",
"labelColor":"#ffffff",
"barcode":{
"message":"d568866a45dfc010ac680a9d06e5a48feb9216a2",
"messageEncoding":"utf-8",
"format":"PKBarcodeFormatQR"
},
"logoText":"logoText",
"storeCard":{
"headerFields":[
],
"primaryFields":[
],
"secondaryFields":[
{
"key":"name",
"label":"",
"value":"Nick"
},
{
"key":"points",
"label":"",
"value":"0 Points"
}
],
"auxiliaryFields":[
],
"backFields":[
{
"key":"email",
"label":"Email",
"value":"hoangtrung.uit@gmail.com"
},
{
"key":"phone",
"label":"Phone",
"value":"+841689984964"
}
],
"locations":[
]
},
"authenticationToken":"authenticationToken",
"webServiceURL":"https://mydomain/passbook"
}
我更新 json 数据有什么问题?请帮忙。