簡體   English   中英

APNS Apple 推送通知服務未收到來自 Apple 的成功消息

[英]APNS Apple push notification service not receiving success message from apple

我們正在嘗試向 api.push.apple.com 發送推送通知。 我們在服務器端的 Rails 上使用 Ruby 發送 APNS。 我們已經在使用 TLS 1.2 和 HTTP2。 我們已經嘗試了 443 和 2197 端口。

{:host=>"api.push.apple.com", :port=>"443", :certificate=>"包屬性\n friendlyName: Apple Push Services: com.company.bundle\n localKeyID: BA 6F 55 DA D5 7A B4 D3 DC 84 B3 CE DC 8d 0A A5 2D 08 9A F4 \nsubject=UID = com.summit.2019, CN = Apple Push Services: com.summit.2019, OU = HHGY6CWBZB, O = MovingMedia AB, C = SE\n\nissuer=C = US, O = Apple Inc., OU = Apple Worldwide Developer Relations, CN = Apple Worldwide Developer Relations 認證機構\n\n-----BEGIN CERTIFICATE-----\ [ PEM 證書] ---END PRIVATE KEY-----\n", :certificate_passphrase=>""}

有效負載:{"aps"=>{"alert"=>"test for apn", "badge"=>14}}

十六進制響應: "\x00\x00\x18\x04\x00\x00" "\x00\x00\x00\x00\x01\x00"

當我們解壓它們時,我們分別得到以下響應: [0, 0, 1048 ] [0, 0, 65536]

我們在最后進行了一些調試,發現使用 curl 命令從終端發送通知時有效,但通過我們的服務器發送時通知無效。 我們認為這與 Apple 對推送通知的服務器更改有關。 請幫忙

我記得當我第一次嘗試通過 RoR 實現 Apple 推送通知時遇到過類似的問題。 而不是試圖手動讓它正確 - 我切換到休斯頓寶石並且從未回頭。 試試這個:

https://github.com/nomad/houston

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM