我有一个问题,我可以在我的应用程序中打开存折,但是当我"添加"按钮,它不能存折,只有PassesViewController消失。我可以下载传真:
https://ap.loc.sh/passbook/?couponId=50ea8c17e4b09d3fcd677612&memberId=50ef9fcfe4b082578408358f
我确定我的pass.json是正确的。因为当我删除清单和签名这两个文件使用apple的passbook标签生成pass都可以,但是使用php传递lib会带来错误。
答案 0 :(得分:3)
经过测试,我遇到了以下情况(使用运行iOS 6.1 beta 4的iPhone 5)
总结有两个问题;
https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook/486
发送无效回复(这应返回一系列序列号,但只返回1111)以下是诊断问题的步骤,我还提供了设备控制台日志的摘录。
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
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...