https://github.com/antoinelyset/bmo
Push notifications to iOS and Android devices, it handles TCP & HTTP Proxies.
https://github.com/antoinelyset/bmo
android apns gcm ios proxy push ruby stunnel
Last synced: 6 months ago
JSON representation
Push notifications to iOS and Android devices, it handles TCP & HTTP Proxies.
- Host: GitHub
- URL: https://github.com/antoinelyset/bmo
- Owner: antoinelyset
- License: mit
- Created: 2013-12-09T17:16:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-07-18T14:30:12.000Z (about 9 years ago)
- Last Synced: 2024-04-24T19:11:57.070Z (over 1 year ago)
- Topics: android, apns, gcm, ios, proxy, push, ruby, stunnel
- Language: Ruby
- Homepage:
- Size: 164 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BMO (Beemo)
BMO is a gem to Push Notifications to iOS (via APNS) and Android (via GCM). It handles TCP & HTTP Proxies.
| Project | BMO |
|------------------------ | ----------------------------------------------------------------------------------------------------------------------------- |
| Gem Name | bmo |
| License | [MIT](https://github.com/antoinelyset/bmo/blob/master/LICENSE) |
| Version | [](http://badge.fury.io/rb/bmo) |
| Dependency Status | [](https://gemnasium.com/antoinelyset/bmo) |
| Continuous Integration | [](https://travis-ci.org/antoinelyset/bmo) |
| Quality Metric | [](https://codeclimate.com/github/antoinelyset/bmo) |
| Test Coverage | [](https://coveralls.io/r/antoinelyset/bmo) |
| Homepage | [BMO](https://github.com/antoinelyset/bmo) |
| Documentation | [Rdoc](http://rdoc.info/github/antoinelyset/bmo/frames) |## Why another gem ?
I needed to use stunnel (TCP Proxy for encrypting with SSL/TLS) and a HTTP Proxy. The existing gems couldn't.
## Installation
```
gem install bmo
```In Gemfile :
```
gem 'bmo'
```## APNS
### Usage
```ruby
token = "123456789" # The device token given to you by Apple
data = {aps: {alert: "Hello from BMO!"}}
BMO.send_ios_notification(token, data)
```The aps Hash content's is described here :
[https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html)
### Configuration
Default Params :
```ruby
BMO.configuration do |config|
config.apns.gateway_host = 'gateway.push.apple.com'
config.apns.gateway_port = 2195
config.apns.feedback_host = 'feedback.push.apple.com'
config.apns.feedback_port = 2196
config.apns.cert_path = nil
config.apns.cert_pass = nil
end
```If you set a cert_path option it will use a SSL encapsulation otherwise it will use Pure TCP.
This option is particularly useful if you use a stunnel.## GCM
### Usage
```ruby
token = "123456789" # The device token given to you by Apple
data = {message: "Hello from BMO!"}
BMO.send_android_notification(token, data)
```The data content's is described here :
[http://developer.android.com/google/gcm/server.html](http://developer.android.com/google/gcm/server.html)
### Configuration
Default Params :
```ruby
BMO.configuration do |config|
config.gcm.gateway_url = 'https://android.googleapis.com/gcm/send'
config.gcm.api_key = nil
end
```You should set the api_key. It uses Faraday internally, so just set your regular http_proxy environment variable if need to configure a proxy.
## License
BMO is released under the [MIT
License](http://www.opensource.org/licenses/MIT)