0

现在我在设备生成 GET 请求的步骤中webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag

服务器如何发送通行证序列以及最后更新/标签;所以我需要将时间戳转换为字符串,因为 lastUpdated 是字符串?这是来自控制台的错误: Apr 5 13:45:24 CamMobs-iPod4 passd[21] <Warning>: Get serial #s task (for device b6511c0dd47d04da449ce427b27fea74, pass type pass.cam-mob.passbookpasstest, last updated (null); with web service url http://192.168.1.202:8888/passesWebserver/) encountered error: Server response was malformed (Missing response data)

4

1 回答 1

1

查询您的数据库并识别匹配deviceLibraryIdentifier并且自标记passTypeIdentifier以来已更改的连续出版物(如果有)。passesUpdatedSince将这些放在一个数组中。

然后将该数组发送回设备,如果没有需要更新的序列,则发送 204 响应。

$serialsArray = array("abc123", "dec456"); // this array should be populated by your database.

if (!empty($serials)) {
    echo json_encode(array('lastUpdated' => (string)time(), 
                           'serialNumbers' => $serialsArray));    
} else {
   // No serials need updating so send a 204 response
}      
于 2013-04-05T07:33:19.163 回答