Baidu Push SDK
Add this line to your application's Gemfile:
gem 'baidu_push_client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install baidu_push_client
Read spec for usage and fixtures for request/response examples
options = {
server_host: 'channel.api.duapp.com',
common_path: '/rest/2.0/channel',
ak: '9k14jrtoe3HjUnOBcapGIlN8',
sk: 'F3iDv4MMm2ZZsXVDvlMVxdueiBikjU3p'
}
messages = {
aps: {
alert:"Message From Baidu Push",
sound:"",
badge:0
},
}
client = BaiduPushClient::Client.new(options)
client.push_all messages: messages.to_json
- Fork it ( https://github.com/[my-github-username]/baidu_push_client/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request