Iphone 无法使用Rails连接到APNS(Apple推送通知服务器),apn_发送者gem

Iphone 无法使用Rails连接到APNS(Apple推送通知服务器),apn_发送者gem,iphone,ruby-on-rails,push-notification,apple-push-notifications,Iphone,Ruby On Rails,Push Notification,Apple Push Notifications,我使用的是Rails 3.2.2和apn_sender 1.0.5 gem。我已经生成了适当的apn_开发.pem和apn_生产.pem。我已经在rails应用程序中添加了它们。通过阅读一些文章,我还修改了apn_production.pem文件权限。我仍然无法从Rails应用程序连接到苹果的APNS服务器 feedback_data = APN::Feedback.new(:environment => :production), still returns #<APN::Feed

我使用的是Rails 3.2.2apn_sender 1.0.5 gem。我已经生成了适当的apn_开发.pem和apn_生产.pem。我已经在rails应用程序中添加了它们。通过阅读一些文章,我还修改了apn_production.pem文件权限。我仍然无法从Rails应用程序连接到苹果的APNS服务器

feedback_data = APN::Feedback.new(:environment => :production), still returns
#<APN::Feedback: Connection not currently established to feedback.push.apple.com on 2196> 
feedback\u data=APN::feedback.new(:environment=>:production)仍然返回
# 
我是否遗漏了什么,或者是否有人提供了关于如何从Rails应用程序发送(APNS)Apple推送通知的详细教程。

任何帮助都将不胜感激。

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

谢谢

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

事实证明,我只需要调用.data方法来启动连接

feedback_data = APN::Feedback.new().data
试试这个宝石: