钱包通行证更新 - 通行证无效,无法读取
Wallet Pass Update - The pass cannot be read because it isn’t valid
我已经实现了存折和更新。我正在使用 eo/passbook-bundle
并在 JSON 下面创建,当打包存折时没有错误,但是在更新过程中,服务器调用 webServiceURL/version/passes/passTypeIdentifier/serialNumber
api 和设备下载完全一样JSON(但没有打包,就这个json),失败
我读过关于 Received invalid pass data while updating Apple Wallet Pass that it may have something to do with correct headers, but there's no description whatsoever in the docs on any specific headers to return in the response (see https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html)
的评论
我正在使用 symfony return 带有编码 json 的响应,如下所示:
$json = PassFactory::serialize($storecard);
return new Response($json, 200, ['Content-Type' => 'application/json']);
我也试过没有 Content-Type header。
在日志中我可以看到:Get pass task (pass type pass.com.spinpos.latest.customercard, serial number 5, if-modified-since (null); with web service url https://my.domain.com/api/loy/wallet/) encountered error: Received invalid pass data (The pass cannot be read because it isn’t valid.)
JSON 响应是这样的:
{
"storeCard":{
"headerFields":[
{
"key":"prepaid",
"value":"0,00",
"label":"PREPAID"
}
],
"secondaryFields":[
{
"key":"username",
"value":"Some Name",
"label":"GEBRUIKERSNAAM"
},
{
"key":"lastvisit",
"value":"niet bekend",
"label":"LAATSTE BEZOEK"
}
],
"auxiliaryFields":[
{
"key":"qrcode",
"value":"2690310109104",
"label":"QR CODE"
},
{
"key":"points",
"value":20,
"label":"LOYALTY PUNTEN"
}
],
"backFields":[
{
"key":"website",
"value":"http://www.somesite.com",
"label":"WEBSITE"
},
{
"key":"phone_number",
"value":"05311223344",
"label":"TELEFOONNUMMER"
},
{
"key":"terms_of_service",
"value":"Dit zijn test algemene voorwaarden!",
"label":"ALGEMENE VOORWAARDEN"
}
]
},
"serialNumber":"5",
"description":"Your Customer card",
"formatVersion":1,
"locations":[
{
"latitude":51.62,
"longitude":5.55,
"relevantText":"Some Loc 2"
},
{
"latitude":51.7737967,
"longitude":5.5513203,
"relevantText":"Some loc 1"
},
{
"latitude":52.2648569,
"longitude":6.8018085,
"relevantText":"Testdfdr"
}
],
"barcode":{
"format":"PKBarcodeFormatQR",
"message":"2690310109104",
"messageEncoding":"iso-8859-1"
},
"barcodes":[
{
"format":"PKBarcodeFormatQR",
"message":"2690310109104",
"messageEncoding":"iso-8859-1"
}
],
"backgroundColor":"rgb(255,108,108)",
"foregroundColor":"rgb(46,14,170)",
"labelColor":"rgb(110,255,75)",
"authenticationToken":"048cfd30e4baf1c3250f0c8c7500f998aee2da49",
"webServiceURL":"https://my.domain.com/api/loy/wallet/"
}
有人知道 JSON 或 header 有什么问题吗?
您需要发送带有 header application/vnd.apple.pkpass
的全新签名 .pkpass 包
我已经实现了存折和更新。我正在使用 eo/passbook-bundle
并在 JSON 下面创建,当打包存折时没有错误,但是在更新过程中,服务器调用 webServiceURL/version/passes/passTypeIdentifier/serialNumber
api 和设备下载完全一样JSON(但没有打包,就这个json),失败
我读过关于 Received invalid pass data while updating Apple Wallet Pass that it may have something to do with correct headers, but there's no description whatsoever in the docs on any specific headers to return in the response (see https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html)
的评论我正在使用 symfony return 带有编码 json 的响应,如下所示:
$json = PassFactory::serialize($storecard);
return new Response($json, 200, ['Content-Type' => 'application/json']);
我也试过没有 Content-Type header。
在日志中我可以看到:Get pass task (pass type pass.com.spinpos.latest.customercard, serial number 5, if-modified-since (null); with web service url https://my.domain.com/api/loy/wallet/) encountered error: Received invalid pass data (The pass cannot be read because it isn’t valid.)
JSON 响应是这样的:
{
"storeCard":{
"headerFields":[
{
"key":"prepaid",
"value":"0,00",
"label":"PREPAID"
}
],
"secondaryFields":[
{
"key":"username",
"value":"Some Name",
"label":"GEBRUIKERSNAAM"
},
{
"key":"lastvisit",
"value":"niet bekend",
"label":"LAATSTE BEZOEK"
}
],
"auxiliaryFields":[
{
"key":"qrcode",
"value":"2690310109104",
"label":"QR CODE"
},
{
"key":"points",
"value":20,
"label":"LOYALTY PUNTEN"
}
],
"backFields":[
{
"key":"website",
"value":"http://www.somesite.com",
"label":"WEBSITE"
},
{
"key":"phone_number",
"value":"05311223344",
"label":"TELEFOONNUMMER"
},
{
"key":"terms_of_service",
"value":"Dit zijn test algemene voorwaarden!",
"label":"ALGEMENE VOORWAARDEN"
}
]
},
"serialNumber":"5",
"description":"Your Customer card",
"formatVersion":1,
"locations":[
{
"latitude":51.62,
"longitude":5.55,
"relevantText":"Some Loc 2"
},
{
"latitude":51.7737967,
"longitude":5.5513203,
"relevantText":"Some loc 1"
},
{
"latitude":52.2648569,
"longitude":6.8018085,
"relevantText":"Testdfdr"
}
],
"barcode":{
"format":"PKBarcodeFormatQR",
"message":"2690310109104",
"messageEncoding":"iso-8859-1"
},
"barcodes":[
{
"format":"PKBarcodeFormatQR",
"message":"2690310109104",
"messageEncoding":"iso-8859-1"
}
],
"backgroundColor":"rgb(255,108,108)",
"foregroundColor":"rgb(46,14,170)",
"labelColor":"rgb(110,255,75)",
"authenticationToken":"048cfd30e4baf1c3250f0c8c7500f998aee2da49",
"webServiceURL":"https://my.domain.com/api/loy/wallet/"
}
有人知道 JSON 或 header 有什么问题吗?
您需要发送带有 header application/vnd.apple.pkpass