Skip to content
/ gcm Public
forked from metaquark/gcm

A gem that helps developers send data from servers to their Android applications on Android devices via Google Cloud Messaging for Android (GCM).

License

Notifications You must be signed in to change notification settings

sequielo/gcm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Cloud Messaging for Android (GCM)

Build Status

GCM sends notifications to Android devices via GCM.

##Installation

$ gem install gcm

##Requirements

An Android device running 2.0 or newer and an API key as per GCM getting started guide.

##Usage

Sending notifications:

require 'gcm'

gcm = GCM.new(api_key)
registration_ids= ["12", "13"] # an array of one or more client registration IDs
options = {data: {score: "123"}, collapse_key: "updated_score"}
response = gcm.send_notification(registration_ids, options)

Currently response is just a hash containing the response body, headers and status.

If the above code is stored in a file like trigger_gcm.rb, thats how you can call it.

$ ruby -rubygems trigger_gcm.rb

##Copyright

  • Copyright (c) 2012 Kashif Rasul and Shoaib Burq. See LICENSE.txt for details.

##Thanks

This gem is based on a fork of the older Google push service:

About

A gem that helps developers send data from servers to their Android applications on Android devices via Google Cloud Messaging for Android (GCM).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%