From 48c456a015b810ae74c9f692ebd696f83def67b8 Mon Sep 17 00:00:00 2001 From: Alexander Klaiber Date: Thu, 26 Jun 2014 10:41:29 +0200 Subject: [PATCH] Update README.md --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ff5f242..083c902 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,37 @@ Or install it yourself as: ## Usage -TODO: Write usage instructions here +``` ruby +collapse_key = '_GCM_COLLAPS_KEY_' +data = { foo: 'bar' } + +Rgcm::Message.new('_API_KEY_').post('_GCM_REGESTRATION_ID_', collapse_key, data) # => Rgcm::Response + +Rgcm::Message.new('_API_KEY_').post(['_GCM_REGESTRATION_ID_1_', '_GCM_REGESTRATION_ID_2_'], collapse_key, data) # => Rgcm::Response +``` + +With rails YML config file: + +``` yml +development: + api_key: '_API_KEY_' + +test: + api_key: '_API_KEY_' + +production: + api_key: '_API_KEY_' +``` + +``` ruby +collapse_key = '_GCM_COLLAPS_KEY_' +data = { foo: 'bar' } + +Rgcm::Message.new.post('_GCM_REGESTRATION_ID_', collapse_key, data) # => Rgcm::Response + +Rgcm::Message.new.post(['_GCM_REGESTRATION_ID_1_', '_GCM_REGESTRATION_ID_2_'], collapse_key, data) # => Rgcm::Response +``` + ## Contributing