rails开发利器:如何给苹果PushServer发送消息rails for apple_push_notification
2011-11-25 16:55
429 查看
Purpose: 为苹果的app - push message . 使用苹果的 push 服务器
rails 的插件:apple_push_notification
URL: https://github.com/samsoffes/apple_push_notification
install plugin apple_push_notification
download certificate file
下载方法,参考: http://www.cnblogs.com/zhw511006/archive/2010/09/01/1815089.html
Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
Right click and choose
Choose the p12 format from the drop down and name it
转换文件:
将apn_development.pem文件发到config/certs/文件夹中
#config/enviroment.rb
ruby script/console
rails 的插件:apple_push_notification
URL: https://github.com/samsoffes/apple_push_notification
install plugin apple_push_notification
script/plugin install git://github.com/samsoffes/apple_push_notification.git一般都以插件安装
download certificate file
下载方法,参考: http://www.cnblogs.com/zhw511006/archive/2010/09/01/1815089.html
Click the disclosure arrow next to your certificate in Keychain Access and select the certificate and the key.
Right click and choose
Export 2 items....
Choose the p12 format from the drop down and name it
cert.p12.
转换文件:
openssl pkcs12 -in cert.p12 -out apn_development.pem -nodes -clcerts && rm -f cert.p12是需要输入密码的
将apn_development.pem文件发到config/certs/文件夹中
mkdir config/certs mv apn_development.pem config/certs
#config/enviroment.rb
ApplePushNotification.apn_enviroment = Rails.env.to_sym
ruby script/console
>> token = "XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX" >> d = Object.new >> d.extend ApplePushNotification >> d.device_token = token >> d.send_notification :alert => "So flexible" >> nil
相关文章推荐
- rails开发利器:rails2.3.8 如何配置发送邮件
- rails开发利器:简单的push服务器 faye
- rails开发利器:时刻监控我们的程序错误rails exception_notification
- rails开发利器-如何为表增加索引add_index for tables
- rails开发利器:视频播放插件plugin(如何开发一个简单的插件)
- (转)How to build an Apple Push Notification provider server (tutorial)
- 【IPhone开发】NSNotificationCenter观察者模式给主线程发送通知
- 配置 SQL Server Email 发送以及 Job 的 Notification通知功能
- Android -- Notification,如何向通知栏发送通知,点击通知开启相应的Activity
- 如何用Nodejs开发自动发送email的程序
- ios开发中如何调用苹果自带地图导航
- iOS开发中如遇到频繁的Http请求,如何取消之前已经发送的Http请求?
- iOS开发之如何应对苹果app的ipv6时代?
- PhoneGap应用开发对策:如何通过苹果审核?
- 如何获得 Microsoft Push Notification Service(MPNS)的最佳体验
- 如何开发一接口 要求是外界会通过POST方法向HTTP发送一个xml文件
- rails开发利器之插件开发-route
- 苹果推送通知服务教程 Apple Push Notification Services Tutorial
- 《程序员》杂志试读:Web开发人员的利器:Ruby on Rails
- 二次开发-如何在PHPEMS-发送短信验证码(以easy-sms为例)