我正在建立一個存摺web服務,它將允許生成和管理優惠券,並通過Passbook應用程序。我正在使用Ruby on Rails構建此Web服務。Iphone沒有顯示存摺通知
我在更新通行證後嘗試發送通知時遇到問題。我可以看到通知是在我的iphone的Xcode控制檯中收到的。這裏是輸出:
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Received push for topic pass.ch.passbook.poc: {
aps = {
alert = "Hello toto";
badge = 42;
"content-available" = 1;
sound = "siren.aiff";
};
}
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Generating GET request with URL <http://myhome:3000/v1/devices/3517d0a9f92d3f7859897af515de8b11/registrations/pass.ch.passbook.poc?passesUpdatedSince=1386942680>
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Get serial #s task (for device 3517d0a9f92d3f7859897af515de8b11, pass type pass.ch.passbook.poc, last updated 1386942680; with web service url http://myhome:3000) got response with code 200
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Get serial numbers task completed with update tag 1386943049, serial numbers (
45
)
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Generating GET request with URL <http://myhome/v1/passes/pass.ch.passbook.poc/45>
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Request contains header field <Authorization: ApplePass secretsecretsecret>
Dec 13 14:57:33 iPhone-de-J passd[543] <Warning>: Request contains header field <If-Modified-Since: Fri, 13 Dec 2013 13:51:20 GMT>
Dec 13 14:57:35 iPhone-de-J passd[543] <Warning>: Get pass task (pass type pass.ch.passbook.poc, serial number 45, if-modified-since Fri, 13 Dec 2013 13:51:20 GMT; with web service url http://myhome:3000) got response with code 200
Dec 13 14:57:35 iPhone-de-J passd[543] <Warning>: Verifying structure andsignature for pass pass.ch.passbook.poc/45
Dec 13 14:57:35 iPhone-de-J passd[543] <Warning>: Signature validation: succeeded
Dec 13 14:57:35 iPhone-de-J passd[543] <Warning>: Verifying structure and signature for pass pass.ch.passbook.poc/45
Dec 13 14:57:35 iPhone-de-J passd[543] <Warning>: Signature validation: succeeded
所有似乎都有正確的行爲。但是,我的iPhone上沒有顯示任何內容。請注意,我正在使用grocer gem向APNS發送通知,並且由於控制檯的第一行,它似乎可以工作。
我知道推送通知應該是空的,即{},但我認爲這不會產生任何影響。你在通行證裏面改變了什麼? – tomasmcguinness
@tomasmcguinness我改變了描述字段。 – Quentin91360
changeMessage不在APNS有效載荷中,它需要在你的pass.json中設置[見這裏](https://developer.apple.com/library/ios/documentation/UserExperience/Reference/PassKit_Bundle/Chapters/) FieldDictionary.html#// apple_ref/doc/uid/TP40012026-CH4-SW1),並且字段字典的值必須更改 - 更改通行描述永遠不會觸發更改消息。 – PassKit