OneSignal Ruby bindings 
This gem provides a simple SDK to access the OneSignal API.
Installation
gem install one_signal
Development
Run the tests
bundle exec rake
Basic usage
See basic examples in example.rb. To run it:
- rename .env.example into
.env
- set your
USER_AUTH_KEY
andAPI_KEY
in the.env
file - run
ruby example.rb
Documentation
Specify your User Auth key to deal with Apps :
OneSignal::OneSignal.user_auth_key = YOUR_USER_AUTH_KEY
Specify your API key to deal with Players and Notifications:
OneSignal::OneSignal.api_key = YOUR_API_KEY
Then call the following methods on the App
, Player
and Notification
classes.
The params
argument in those methods is a ruby hash and the accepted/required keys for this hash are documented in the OneSignal API documentation
The return value of each method is a Net::HTTPResponse
.
Apps
- OneSignal::App.all(params:)
- OneSignal::App.get(id:)
- OneSignal::App.create(params:)
- OneSignal::App.update(id:, params:)
Players
- OneSignal::Player.all(params:)
- OneSignal::Player.csv_export(params:)
- OneSignal::Player.get(id:)
- OneSignal::Player.create(params:)
- OneSignal::Player.create_session(id:, params:)
- OneSignal::Player.create_purchase(id:, params:)
- OneSignal::Player.create_focus(id:, params:)
- OneSignal::Player.update(id:, params:)
Notifications
- OneSignal::Notification.all(params:)
- OneSignal::Notification.get(id:, params:)
- OneSignal::Notification.create(params:)
- OneSignal::Notification.update(id:, params:)
- OneSignal::Notification.delete(id:, params:)
Changes
See CHANGELOG.txt
Contributors
They are listed here, thanks to them!
License
Please see LICENSE for licensing details.