Project

xmpush

0.01
No commit activity in last 3 years
No release in over 3 years
XiaoMi push Ruby Server SDK
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.5
>= 0

Runtime

 Project Readme

About

XiaoMi push Ruby SDK

Install

gem install xmpush

in Gemfile:

gem 'xmpush'

Usage

@xm_service = Xmpush::Service.config do |s|
  s.sandbox = true # default false
  s.ios_secret = "ios secret key"
  s.bundle_id = "com.xxx.ios"
  s.android_secret = 'android secret key'
  s.package_name = "com.xxx.android"
  s.connection_adapter = :net_http # default
end

# just iOS
@message1 = @xm_service.build(:ios, description: 'hello')
@xm_service.push(:all, @message1)

@message2 = @xm_service.build(:ios, description: 'hello alias', extra: {pid: 111})
@xm_service.push(:alias, @message2, alias: '1043478')

@message3 = @xm_service.build(:ios, description: 'hello topic', extra: {pid: 111})
@xm_service.push(:topic, @message2, topic: 'all')

#multi_topic
@message3 = @xm_service.build(:ios, description: 'hello topic', extra: {pid: 111})
@xm_service.push(:topics, @message2, topics: ['all', "other"])

# iOS and Android
@message3 = @xm_service.build(:both, title: "I'm title", description: 'push to iOS and Android client')
@xm_service.push(:all, @message3)

TODO

  • Multi push
  • Feedback/ Stats/ Tracer/ Targeted_message