Git Product home page Git Product logo

bmo's Introduction

BMO




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
Version Gem Version
Dependency Status Dependency Status
Continuous Integration Build Status
Quality Metric Code Climate
Test Coverage Coverage Status
Homepage BMO
Documentation Rdoc

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

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

Configuration

Default Params :

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

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

Configuration

Default Params :

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

bmo's People

Contributors

antoinelyset avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.