Project

baidu_push

0.01
No commit activity in last 3 years
No release in over 3 years
The ruby wrapper of baidu push.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

>= 0.11.0
 Project Readme

BaiduPush

The ruby wrapper of baidu push.

Installation

Add this line to your application's Gemfile:

gem 'baidu_push'

And then execute:

$ bundle

Or install it yourself as:

$ gem install baidu_push

Usage

api_key = 'your_api_key'
secret_key = 'your_secret_key'
# Create a client
client = BaiduPush::Client.new(api_key, secret_key)

# Set resource of client
client.resource = 'your_channel_id'
# Query bindlist
client.query_bindlist

# Push messages
messages = { title: 'title', description: 'desc' }
client.push_msg 3, messages, 'android-test', message_type: 1

For more examples refer to the official doc.

Required params:

def query_bindlist(params = {})
def push_msg(push_type, messages, msg_keys, params = {})
def init_app_ioscert(name, description, release_cert, dev_cert, params = {})
def update_app_ioscert(params = {})
def delete_app_ioscert(params = {})
def query_app_ioscert(params = {})
def verify_bind(user_id, params = {})
def fetch_msg(user_id, params = {})
def fetch_msgcount(user_id, params = {})
def delete_msg(user_id, msg_ids, params = {})
def set_tag(tag, params = {})
def fetch_tag(params = {})
def delete_tag(tag, params = {})
def query_user_tags(user_id, params = {})
def query_device_type(params = {})

Optional params refer to the official doc.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request