【问题标题】:APNS Apple push notification service not receiving success message from appleAPNS Apple 推送通知服务未收到来自 Apple 的成功消息
【发布时间】:2021-06-09 11:46:37
【问题描述】:

我们正在尝试向 api.push.apple.com 发送推送通知。我们在服务器端使用 Ruby on Rails 发送 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 推送服务: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 对推送通知的服务器更改有关。请帮忙

【问题讨论】:

    标签: ios push-notification apple-push-notifications


    【解决方案1】:

    我记得当我第一次尝试通过 RoR 实现 Apple 推送通知时遇到了类似的问题。而不是试图手动让它正确 - 我切换到休斯顿宝石并且从未回头。试试这个:

    https://github.com/nomad/houston

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-01-21
      • 1970-01-01
      • 2012-12-03
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多