【问题标题】:could not connect to APNS(Apple Push Notifications Server) using Rails, apn_sender gem无法使用 Rails、apn_sender gem 连接到 APNS(Apple Push Notifications Server)
【发布时间】:2013-01-10 12:51:34
【问题描述】:

我正在使用 Rails 3.2.2apn_sender 1.0.5 gem。我已经生成了正确的 apn_development.pemapn_production.pem。我已将它们添加到我的 rails 应用程序中。通过查看一些文章,我也修改了 apn_production.pem 文件权限。我仍然无法从我的 Rails 应用程序连接到 Apple 的 APNS 服务器。

feedback_data = APN::Feedback.new(:environment => :production), still returns
#<APN::Feedback: Connection not currently established to feedback.push.apple.com on 2196> 

我是否遗漏了什么或任何机构有关于如何从 Rails 应用程序发送 (APNS) Apple 推送通知的详细教程。
任何帮助将不胜感激。

【问题讨论】:

标签: iphone ruby-on-rails push-notification apple-push-notifications


【解决方案1】:

我找到了解决方案。生成正确的证书后,我遇到了“为其他环境开发应用程序”的问题。通过用适当的构建替换移动应用程序,问题得到了解决。

谢谢!

【讨论】:

    【解决方案2】:

    APN::Feedback.new() 返回 # 这有点误导。我认为我必须在其他地方建立联系。

    原来,我只需要调用 .data 方法来启动连接

    feedback_data = APN::Feedback.new().data
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-03
      相关资源
      最近更新 更多