テスト後、私は次のことを経験しました(iOS6.1ベータ4を実行しているiPhone5を使用)
要約すると、2つの問題があります。
- Webサービスがに無効な応答を送信しています
https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook/486
(これはシリアル番号の配列を返すはずですが、1111を返すだけです)
- Webサービスを介して送信されているパスに無効なデータが含まれています。
以下は、問題を診断するために実行された手順です。デバイスコンソールログからの抜粋も含まれています。
- pkpassバンドルはPassbookに正常に追加されます
- パスは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サービスが送信している2番目のパスのpass.jsonが正しくないようです。
pass.jsonを調べると、locationsキーの後にエラーがあるようです。
{
"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...