PK 通行证未在钱包应用程序中更新以进行刷新
PK Pass not updated in Wallet app on pull to refresh
我已成功通过邮件将通行证添加到钱包。我在电子钱包应用程序中看到了通行证,但是当我在通行证背面拉动刷新时,我无法看到更新的通行证。这是日志:
passd[119] <Warning>: Verifying structure and signature for pass pass.com.test.pass/1
passd[119] <Warning>: Signature validation: succeeded
passd[119] <Warning>: Generating POST request with URL <my_https_url/api/PassRegistration/v1/devices/70e435342e38df4e4346e779c6dff6e3/registrations/pass.com.test.pass/%25E2%2580%258E1>
passd[119] <Warning>: Request contains header field <Authorization: ApplePass my_token>
passd[119] <Warning>: Request contains body dictionary {
pushToken = 93b5d5cxxxxxxxxxxxxxxxxxxxxxxxxxxx_similar;
}
passd[119] <Warning>: Register task (for device 70e435342e38df4e4346e779c6dff6e3, pass type pass.com.test.pass, serial number 1; with web service url my_https_url/api/PassRegistration/) got response with code 201
passd[119] <Warning>: Generating GET request with URL <my_https_url/api/PassRegistration/v1/devices/70e435342e38df4e4346e779c6dff6e3/registrations/pass.com.test.pass>
passd[119] <Warning>: Get serial #s task (for device 70e435342e38df4e4346e779c6dff6e3, pass type pass.com.test.pass, last updated (null); with web service url my_https_url/api/PassRegistration/) got response with code 200
passd[119] <Warning>: Get serial numbers task completed with update tag 1459943482, serial numbers (
1
)
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_urlapi/PassRegistration/) got response with code 200
passd[119] <Warning>: Verifying structure and signature for pass pass.com.test.pass/1
passd[119] <Warning>: Signature validation: succeeded
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_url/api/PassRegistration/) encountered error: Requested serial number 1, received serial number 1
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_url/api/PassRegistration/) will retry after 60 seconds
我的部分通行证如下所示:
"storeCard": {
"headerFields": [
{
"key": "lessons",
"label": "Points",
"value": "200"
}
],
在更新 Web 服务调用时,我以二进制格式传递了相同的传递,但点值为 500。预期输出显示点为 500 而不是 200。我看到 "Couldn't update pass" 刷新完成后的消息。我正在使用 IOS 9.2.1 在 iPhone4s 中进行测试。
方法 BinaryFormatter()
没有用所以我根据 https://github.com/horizon-institute/AffectiveComputingCloud/blob/master/AffectiveComputingCloud/RestAPIWebRole/Formatter/BinaryMediaTypeFormatter.cs
的参考改为 BinaryMediaTypeFormatter()
我尝试使用以下 header 参数:
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.apple.pkpass");
response.Content.Headers.LastModified = DateTime.UtcNow;
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = "pass.pkpass";
response.Content.Headers.ContentDisposition.Name = "pass.pkpass";
似乎有多个问题,例如错误的内容类型。将内容类型更改为 application/vnd.apple.pkpass
并传递具有更新日期的更新通行证解决了这个问题。
我已成功通过邮件将通行证添加到钱包。我在电子钱包应用程序中看到了通行证,但是当我在通行证背面拉动刷新时,我无法看到更新的通行证。这是日志:
passd[119] <Warning>: Verifying structure and signature for pass pass.com.test.pass/1
passd[119] <Warning>: Signature validation: succeeded
passd[119] <Warning>: Generating POST request with URL <my_https_url/api/PassRegistration/v1/devices/70e435342e38df4e4346e779c6dff6e3/registrations/pass.com.test.pass/%25E2%2580%258E1>
passd[119] <Warning>: Request contains header field <Authorization: ApplePass my_token>
passd[119] <Warning>: Request contains body dictionary {
pushToken = 93b5d5cxxxxxxxxxxxxxxxxxxxxxxxxxxx_similar;
}
passd[119] <Warning>: Register task (for device 70e435342e38df4e4346e779c6dff6e3, pass type pass.com.test.pass, serial number 1; with web service url my_https_url/api/PassRegistration/) got response with code 201
passd[119] <Warning>: Generating GET request with URL <my_https_url/api/PassRegistration/v1/devices/70e435342e38df4e4346e779c6dff6e3/registrations/pass.com.test.pass>
passd[119] <Warning>: Get serial #s task (for device 70e435342e38df4e4346e779c6dff6e3, pass type pass.com.test.pass, last updated (null); with web service url my_https_url/api/PassRegistration/) got response with code 200
passd[119] <Warning>: Get serial numbers task completed with update tag 1459943482, serial numbers (
1
)
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_urlapi/PassRegistration/) got response with code 200
passd[119] <Warning>: Verifying structure and signature for pass pass.com.test.pass/1
passd[119] <Warning>: Signature validation: succeeded
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_url/api/PassRegistration/) encountered error: Requested serial number 1, received serial number 1
passd[119] <Warning>: Get pass task (pass type pass.com.test.pass, serial number 1, if-modified-since (null); with web service url my_https_url/api/PassRegistration/) will retry after 60 seconds
我的部分通行证如下所示:
"storeCard": {
"headerFields": [
{
"key": "lessons",
"label": "Points",
"value": "200"
}
],
在更新 Web 服务调用时,我以二进制格式传递了相同的传递,但点值为 500。预期输出显示点为 500 而不是 200。我看到 "Couldn't update pass" 刷新完成后的消息。我正在使用 IOS 9.2.1 在 iPhone4s 中进行测试。
方法 BinaryFormatter()
没有用所以我根据 https://github.com/horizon-institute/AffectiveComputingCloud/blob/master/AffectiveComputingCloud/RestAPIWebRole/Formatter/BinaryMediaTypeFormatter.cs
BinaryMediaTypeFormatter()
我尝试使用以下 header 参数:
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.apple.pkpass");
response.Content.Headers.LastModified = DateTime.UtcNow;
response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
response.Content.Headers.ContentDisposition.FileName = "pass.pkpass";
response.Content.Headers.ContentDisposition.Name = "pass.pkpass";
似乎有多个问题,例如错误的内容类型。将内容类型更改为 application/vnd.apple.pkpass
并传递具有更新日期的更新通行证解决了这个问题。