README.md in rumour-ruby-0.0.7 vs README.md in rumour-ruby-0.0.8

- old
+ new

@@ -1,8 +1,8 @@ -# Rumour +# rumour-ruby -Rumour is a Ruby wrapper to communicate with Rumour REST API. +**rumour-ruby** is a Ruby wrapper to communicate with Rumour REST API. ## Installation Add this line to your application's Gemfile: @@ -32,38 +32,67 @@ ``` Then, send a text message: ```ruby from = '+15005550006' -recipient = '+15005550005' +recipients = '+15005550005' -rumour.send_text_message(from, recipient, 'Hello from Rumour!') +rumour.send_text_message(from, recipient, Hello from Rumour!') #=> {'id' => '1', 'from' => '+15005550006', 'recipient' => '+15005550005', ... } ``` Or an Android Push Notification: ```ruby -recipient = 'Device-Token-Here' +recipients = ['android::Registration-Id-Here'] -rumour.send_push_notification('android', recipient, data: { ... }) +rumour.send_push_notification( + recipients, + title: 'Push Notification Title', # optional + text: 'Push Notification Text', # optional + additional_data: { ... } # optional + android: { data: { some_key: 'some_value'}}, # optional +) +#=> [{'id' => '2', 'platform' => 'android', 'recipient' => 'Registration-Id-Here', ...}] ``` Or even an iOS Push Notification: ```ruby -recipient = 'Device-Token-Here' +recipients = ['ios::Device-Token-Here'] -rumour.send_push_notification('ios', recipient, alert: { ... }) +rumour.send_push_notification( + recipients, + title: 'Push Notification Title', # optional + text: 'Push Notification Text', # optional + additional_data: { ... }, # optional + ios: { alert: { badge: 2 } } # optional +) +#=> [{'id' => '2', 'platform' => 'ios', 'recipient' => 'Device-Token-Here', ...}] ``` +You can also send Push Notifications for multiple devices and platforms: +```ruby +recipients = ['android::Registration-Id-Here', 'ios::Device-Token-Here'] + +rumour.send_push_notification( + recipients, + title: 'Push Notification Title', # optional + text: 'Push Notification Text', # optional + additional_data: { ... }, # optional + android: { data: { some_key: 'some_value'}}, # optional + ios: { alert: { badge: 2 } } # optional +) +#=> [{'id' => '3', 'platform' => 'android', 'recipient' => 'Registration-Id-Here', ...}, {'id' => '4', 'platform' => 'ios', 'recipient' => 'Device-Token-Here', ...}] +``` + ### Interceptors Intercept text messages and/or push notifications when you don't want to send stuff to real numbers. Every text message and/or push notification will be intercepted and sent to the recipients you might configure as interceptors: ```ruby # config/initializers/rumour.rb Rumour.configure do |config| config.intercept_text_message_recipient = 'your_mobile_phone_number' - config.intercept_push_notification_recipient = 'your_device_token' + config.intercept_push_notification_recipients = ['android::your_registration_id'] end ``` ## Contributing