Rails 3 and apple push notification service

旧时模样 提交于 2019-12-18 13:26:06

问题


Has anybody been able to send push notification to iPhone using rails 3 ? APN on rails and samesoffes plugin only works with rails 2. I am new to rails and i have not been able to make either of them work.

Here are the errors i encountered :

APN on Rails :

tried to replace

ruby script/generate apn_migrations

With

rails generate apn_migrations

got :

myApp/config/environment.rb:5:in `require': no such file to load -- apn_on_rails (LoadError)

I also did not manage to run the configuration "config.gem 'apn_on_rails'" (config.gem: command not found)

Samsoffes plugin :

I did not manage to config the gem :

config.gem "apple_push_notification", :source => "http://gemcutter.org/"

gave me :

http://gemcutter.org/: No such file or directory

Any help would be greatly appreciated !

Thanks, Vincent


回答1:


I had the same problem, I had used a rails3 branch

gem 'apn_on_rails', :git => 'https://github.com/natescherer/apn_on_rails.git', :branch => 'rails3'

This solved my problem and I wrote the details to my blog

http://yekmer.posterous.com/how-to-send-iphone-push-notifications-in-rail




回答2:


I've written an apn_on_rails replacement called Rpush specifically targeted at Rails 3. I've also added a bunch of extra features like persistent connections to the APNs (as recommended by Apple). Frequent connects/disconnects may get you banned from the APNs, which is how apn_on_rails currently works.

Rpush: https://github.com/rpush/rpush




回答3:


In rails 3, there is no config.gem... Open up your Gemfile:

gem 'apple_push_notification', :git => 'http://gemcutter.org/path_to_that_gem_on_gem_cutter.git'


来源:https://stackoverflow.com/questions/4633112/rails-3-and-apple-push-notification-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!