1
votes

i have a problem,i can open a passbook pass at my app,but when i "add" button,it cannot to passbook,only PassesViewController disappear.my pass can download:

https://ap.loc.sh/passbook/?couponId=50ea8c17e4b09d3fcd677612&memberId=50ef9fcfe4b082578408358f

i am sure my pass.json is correct. because when i remove the manifest and signature the two file using passbook sign of apple to produce pass all is ok,but using php pass lib it is bring the mistake.

1
what mistake you encounter? - Raptor
my pass is not add to passbook,but i can load it and see it - pengwang
If I click your link, the pass loads and can be added to passbook. What is your problem? - PassKit

1 Answers

3
votes

After testing I have experienced the following (using iPhone 5 running iOS 6.1 beta 4)

in summary there are two issues;

  • Your webservice is sending an invalid response to https://ap.loc.sh/passbook/?couponId=486/v1/devices/5bca731a5779527c406213e9a847de97/registrations/pass.socialPoint.passbook/486 (this should return an array of serial numbers, but just returns 1111)
  • The pass that is being sent via your web service contains invalid data.

The following are steps were taken to diagnose your problem, I have also included excerpts from the device console log.

  • The pkpass bundle successfully adds to Passbook
  • The pass successfully registers with your web service

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
  • The device then attempts to retrieve the serial numbers for all passes of the same certificate (pass.socialPoint.passbook) - this is a standard part of the registration in case the pass data is stale and needs to be refreshed.

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
  • the device receives an invalid response, but will continue to retry.

  • Manually refreshing the pass, reveals another error:


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.)"
        );
    }

It seems as the pass.json of the second pass that your webservice is sending is incorrect.

Upon examining pass.json, there appears to be an error after the locations key:

{
  "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...