測試後,我已經經歷了以下(使用iPhone 5的運行iOS 6.1測試版4)
在總結有兩個問題;
- 你的web服務發送給
https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook/486
的無效響應(這應該返回序列號的數組,但只是返回1111)
- 正在通過Web服務發送的通包含無效數據。
以下是採取的步驟來診斷您的問題,我也包括設備控制檯日誌的摘錄。
- 的pkpass束成功地增加了存摺
- 的傳球成功地與您的Web服務註冊
Jan 15 14:03:03 passd[4219] <Warning>: Generating POST request with URL <https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook/486>
Jan 15 14:03:03 passd[4219] <Warning>: Request contains header field <Authorization: ApplePass vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc>
Jan 15 14:03:03 passd[4219] <Warning>: Request contains body dictionary {
pushToken = XXXXXXX94500332b789a3ddb61800586d5c9aad1cb035c9f2725761d419950b2;
}
Jan 15 14:03:06 passd[4219] <Warning>: Register task (for device 5bca731a5779527c406213e9a847de97, pass type pass.socialPoint.passbook, serial number 486; with web service url https://ap.loc.sh/passbook/?couponId=486) got response with code 200
- 該設備,然後嘗試檢索的序列號爲所有通行證同一證書(pass.socialPoint.passbook) - 這是註冊的標準部分,以防通行證數據過時並且需要刷新。
Jan 15 14:03:06 passd[4219] <Warning>: Generating GET request with URL <https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook>
Jan 15 14:03:11 passd[4219] <Warning>: Get serial #s task (for device 5bca731a5779527c406213e9a847de97, pass type pass.socialPoint.passbook, last updated (null); with web service url https://ap.loc.sh/passbook/?couponId=486) got response with code 200
Jan 15 14:03:11 passd[4219] <Warning>: Get serial #s task (for device 5bca731a5779527c406213e9a847de97, pass type pass.socialPoint.passbook, last updated (null); with web service url https://ap.loc.sh/passbook/?couponId=486) encountered error: Server response was malformed (The operation couldn’t be completed. (Cocoa error 3840.))
Jan 15 14:03:11 passd[4219] <Warning>: Generating POST request with URL <https:/ap.loc.sh/passbook/?couponId=486/v1/log> Jan 15 14:03:11 Anatta passd[4219] <Warning>: Request contains body dictionary {
logs = (
"[2013-01-15 14:03:11 +0800] Get serial #s task (for device 5bca731a5779527c406213e9a847de97, pass type pass.socialPoint.passbook, last updated (null); with web service url https://ap.loc.sh/passbook/?couponId=486) encountered error: Server response was malformed (The operation couldn\U2019t be completed. (Cocoa error 3840.))"
); }
Jan 15 14:03:11 passd[4219] <Warning>: Get serial #s task (for device 5bca731a5779527c406213e9a847de97, pass type pass.socialPoint.passbook, last updated (null); with web service url https://ap.loc.sh/passbook/?couponId=486) will retry after 10 seconds
設備接收了無效的響應,但將繼續重試。
手動刷新通,揭示了另一個錯誤:
Jan 15 14:11:05 passd[4238] <Warning>: Get pass task (pass type pass.socialPoint.passbook, serial number 486, if-modified-since (null); with web service url https://ap.loc.sh/passbook/?couponId=486) got response with code 200
Jan 15 14:11:05 passd[4238] <Warning>: Invalid data error reading pass . Could not read json from URL file://localhost/var/mobile/Library/Caches/com.apple.passd/com.apple.Shoebox/EE7EC165-DFC8-4B74-8444-37FB4C84B542.pkpass/pass.json: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 369.) UserInfo=0x361810 {NSDebugDescription=Invalid value around character 369.}
Jan 15 14:11:05 passd[4238] <Warning>: Get pass task (pass type pass.socialPoint.passbook, serial number 486, if-modified-since (null); with web service url https://ap.loc.sh/passbook/?couponId=486) encountered error: Received invalid pass data (The pass cannot be read because it isn't valid.)
Jan 15 14:11:05 passd[4238] <Warning>: Generating POST request with URL <https://ap.loc.sh/passbook/?couponId=486/v1/log>
Jan 15 14:11:05 Anatta passd[4238] <Warning>: Request contains body dictionary {
logs = (
"[2013-01-15 14:11:05 +0800] Get pass task (pass type pass.socialPoint.passbook, serial number 486, if-modified-since (null); with web service url https://ap.loc.sh/passbook/?couponId=486) encountered error: Received invalid pass data (The pass cannot be read because it isn't valid.)"
);
}
這似乎是你的web服務發送不正確,第二遍的pass.json。
在檢查pass.json,似乎是關鍵位置後的錯誤:
{
"formatVersion" : 1,
"passTypeIdentifier" : "pass.socialPoint.passbook",
"serialNumber" : "",
"teamIdentifier" : "9TS732CS23",
"authenticationToken" : "vxwxd7J8AlNNFPS8k0a0FfUFtq0ewzFdc",
"webServiceURL" : "https://ap.loc.sh/passbook/?couponId=",
"associatedStoreIdentifiers":[564576004],
"relevantDate" : "1970-01-01T08:00:00+08:00",
"locations" : , // Syntax error
"organizationName" : "portaura",
"logoText" : "",
"description" : "Here is description",
"backgroundColor" : "rgb(146, 108, 63)",
"coupon" : { etc...
什麼'mistake'你碰到? – Raptor
我的通行證不添加到存摺,但我可以加載並看到它 – pengwang
如果我點擊你的鏈接,通過加載,並可以添加到存摺。你有什麼問題? – PassKit