简体   繁体   中英

could not connect to APNS(Apple Push Notifications Server) using Rails, apn_sender gem

I am using Rails 3.2.2 and apn_sender 1.0.5 gem . I have generated proper apn_development.pem and apn_production.pem . I have added them in my rails application. By looking at some article, i have modified the apn_production.pem files permissions also. still i am not able to connect to Apple's APNS Server from my Rails Application.

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

Am i missing something or does any body have a detailed tutorial of how to send (APNS) Apple push notifications from a Rails Application.
Any help would be greatly appreciated.

I have found solution. After generating proper certificates, i was having issue with "development build of the application for other environments". By replacing the mobile application with appropriate build, problem was solved.

Thanks!

the APN::Feedback.new() returns # which is a bit misleading. I thought there was a connection elsewhere that I had to make.

Turns out, I just had to call the .data method to start the connection

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM