我正在构建一个存折网络服务和后端。我使用PHP-Passbook来生成 pass 文件。然后可以将创建的通行证添加到 Passbook。但是,它不会调用我的网络服务。我检查了我的代码,发现这是因为当我使用下面的代码创建一个PKPass
对象时,除了webserviceUrl
可以在对象中导入的任何东西,pass.webserviceUrl
总是nil
.
PKPass *pass = [[PKPass alloc] initWithData:responseObject error:&error];
这是我的 pass.json 文件
{
"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"
}
我还在开发者菜单中启用了“允许 HTTP 服务”。它也不起作用。
有什么解决办法吗?