Question

I am building a passbook web service and backend. I use PHP-Passbook to generate the pass file. The created pass can then be added to Passbook. However, it won't call my web service. I checked my code and found that it's because when I use the following code to create a PKPass object, anything except webserviceUrl can be imported in object, pass.webserviceUrl is always nil.

PKPass *pass = [[PKPass alloc] initWithData:responseObject error:&error];

here is my pass.json file

{
"serialNumber": "90f9f133-cbd7-47b3-9b04-8a443f488495",
"description": "Event",
"formatVersion": 1,
"eventTicket": {
    "primaryFields": [
        {
            "key": "event",
            "label": "Event",
            "value": "Test Event"
        }
    ],
    "secondaryFields": [
        {
            "key": "location",
            "label": "Location",
            "value": "Moscone West"
        }
    ],
    "auxiliaryFields": [
        {
            "key": "datetime",
            "label": "Date & Time",
            "value": "Tuesday 30th of July 2013 11:30:26 AM'"
        }
    ]
},
"relevantDate": "2013-07-24T14:25-08:00",
"barcode": {
    "format": "PKBarcodeFormatQR",
    "message": "hello world",
    "messageEncoding": "iso-8859-1"
},
"backgroundColor": "rgb(253,229,47)",
"logoText": "FDJ Event",
"authenticationToken": "72aa48d08db9a379f147e38fb23a3901",
"webServiceUrl": "http://www.test.com/passbook/index.php",
"passTypeIdentifier": "pass.test.passbooktest",
"teamIdentifier": "XXXXXXX",
"organizationName": "TEST"
}

I also enabled 'Allow HTTP Services' in Developer menu. It doesn't work either.

Any solutions?

Était-ce utile?

La solution

The key that you are looking for is webServiceURL (URL is capitalised).

PKPass Class Reference

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top