Exponent Server SDK Ruby
Use to send push notifications to Exponent Experiences from a Ruby server.
Installation
Add this line to your application's Gemfile:
gem 'exponent-server-sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install exponent-server-sdk
Usage
Client
The push client is the preferred way. This hits the latest version of the api.
Optional arguments: gzip: true
client = Exponent::Push::Client.new
messages = [{
to: "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
sound: "default",
body: "Hello world!"
}, {
to: "ExponentPushToken[yyyyyyyyyyyyyyyyyyyyyy]",
badge: 1,
body: "You've got mail"
}]
handler = client.send_messages(messages)
client.verify_deliveries(handler.receipt_ids)
See the getting started example. If you clone this repo, you can also use it to test locally by entering your ExponentPushToken. Otherwise it serves as a good copy pasta example to get you going.
The complete format of the messages can be found here.
Contributing
If you have problems with the code in this repository, please file issues & bug reports. We encourage you
to submit a pull request with a solution or a failing test to reproduce your issue. Thanks!