生成存折传递Web服务URL不通过PHP工作

时间:2016-01-14 04:46:19

标签: php passbook passkit

我通过PHP创建了一个传递,并在iOS和我的iPhone上尝试过,一切正常。

现在我对“更新我的通行证”有疑问,问题是我没有将任何有效载荷送回我的服务器。

我有SSL证书。在我的服务器上运行。这是Pass生成的我的JSON文件。

{"description":"Your Booking @ XXXXXX","formatVersion":1,
 "organizationName":"xxx Pte Ltd",
 "passTypeIdentifier":"pass.com.xxx",
 "serialNumber":"R_TheTtSFAmc7U",
 "teamIdentifier":"3WZWSR88QK",
"locations":[{"longitude":-122.3748889,"latitude":37.6189722},

{"longitude":-122.03118,"latitude":37.33182}],
 "eventTicket":{"headerFields":[{"key":"booking","label":"Booking","value":"xxxxx"}],       
"primaryFields":[{"key":"date","label":"Booking date","value":"JAN 15"}],
  "secondaryFields":[{"key":"hour","label":"Booking    time","value":"19:00"}],

"auxiliaryFields":[{"key":"address","label":"Address","value":"90 Club Street"}],

"backFields":[{"key":"bookingname","label":"Booking","value":"XXXX"},   
 {"key":"member-code","label":"Spin Code","value":"xxxx"}]},
  "barcode":{"format":"PKBarcodeFormatQR",
  "message":"{\"membCode\":\"xxx\"}","messageEncoding":"iso88591"},"foregroundColor":" rgb(255, 255, 255)",
   "backgroundColor":"rgb(60, 65, 76)"
   "webServiceURL":"https://dev.xxx.com/passbook/passwallet.php","authenticationToken":"dnMua2FsYUB3ZWVsb3kuY29tOndlZWxveTAx"}

passwallet.php

 $request = explode("/", substr(@$_SERVER['REQUEST_URI'], 1));

   var_dump($request);
 $data1 = $passUpdate->snconnect($request);
    $inputJSON = file_get_contents('php://input');

$push_token = json_decode($inputJSON, TRUE);

$push_token = $push_token->pushToken;
//device token store in db
$data2 = $passUpdate->snconnect($push_token);

任何帮助将不胜感激, 谢谢,

1 个答案:

答案 0 :(得分:1)

当webServiceURL指向一个RESTful服务的根目录时,它指向一个文件。

您在设备上没有得到任何回复,因为正确的斜杠跟随' passwallet.php'使您的服务器将passwallet.php视为文件夹,然后尝试查找完整请求路径的索引文件。这不存在,因此设备会从您的服务器收到404。

将passwallet.php重命名为index.php,并将服务器配置为重写对index.php的所有请求(类似于在Wordpress中设置漂亮URL的方式)。