在通过刷新刷新时,在Wallet应用程序中未更新PK Pass

时间:2016-04-06 12:44:34

标签: ios objective-c passbook passkit

我已成功将通过邮件传递给钱包。我在钱包应用程序中看到了Pass,但是当我在通行证的背面刷新时,我无法看到更新的通行证。这是日志:

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.我看到“无法更新传递”消息一旦刷新完成。我正在使用IOS 9.2.1测试iPhone4s。

我提到:https://github.com/yuchaoonline/ytoo.service/blob/master/dotnet-passbook-master/Passbook.Sample.Web/Controllers/PassRegistrationController.cs

方法BinaryFormatter()无效,所以我根据https://github.com/horizon-institute/AffectiveComputingCloud/blob/master/AffectiveComputingCloud/RestAPIWebRole/Formatter/BinaryMediaTypeFormatter.cs

的引用更改为BinaryMediaTypeFormatter()

我尝试使用以下标头参数:

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";

1 个答案:

答案 0 :(得分:1)

似乎存在多个问题,例如错误的内容类型。将内容类型更改为application/vnd.apple.pkpass并通过更新后的更新日期修复了该问题。