xmpush 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0eb9c801b8cccddda27ce474d7d3701f8a727d0e
4
- data.tar.gz: 58524b2cea5b138d96bb6bf61c3c612d3cfb70f1
3
+ metadata.gz: 44f85f5a73cf1632ceeb931450724c905bc3c3dc
4
+ data.tar.gz: 9f9c0248d068a678c0d4fb0f6b01734a46cef49e
5
5
  SHA512:
6
- metadata.gz: 8944f441646d4fae28152f1fb25d1363629dd98bac24f7b860163063b4e77dbde76edb9b6e5eed50506e7c61d9f682da53c8dac3d5182d4adf89b4b4858927e7
7
- data.tar.gz: 07fec128fdf247a56eb22fca4eb979edaf750164d77cfdb1147c6760d7cfa349fdaf430953756e7c8f57371a3f1d8942fcb8734c8f13fd30ca149ca1362670b9
6
+ metadata.gz: aea95504ca6c437000b492ae4e1c8e2f33073187524a39968c4b7fa3e5e1e7bced716329b901f154e73efeea5a7471247e00c287b35cf0d6fb331f9dc0bf5240
7
+ data.tar.gz: d63a39eb712b59b7a872faac1e8a84918a081e144355a6685c375cd3424badcc3b56661b0bb0ad810b38128ce54873390519f725c59ca5f36b6aa99ccc80c0a4
data/README.md CHANGED
@@ -2,7 +2,20 @@
2
2
 
3
3
  [XiaoMi push](dev.xiaomi.com) Ruby SDK
4
4
 
5
- ## Usage:
5
+ ## Install
6
+
7
+ ```ruby
8
+ gem install xmpush
9
+ ```
10
+
11
+ in Gemfile:
12
+
13
+ ```ruby
14
+ gem 'xmpush'
15
+ ```
16
+
17
+ ## Usage
18
+
6
19
 
7
20
  ```ruby
8
21
  @xm_service = Xmpush::Service.config do |s|
@@ -19,7 +32,7 @@ message1 = {description: 'hello'}
19
32
  @message1 = @xm_service.build(:ios, message1)
20
33
  @xm_service.push(:all, @message1)
21
34
 
22
- message2 = {description: 'hello alias'}
35
+ message2 = {description: 'hello alias', extra: {pid: 111}}
23
36
  @message2 = @xm_service.build(:ios, message2)
24
37
 
25
38
  @xm_service.push(:alias, @message2, alias: '1043478')
@@ -3,10 +3,11 @@ module Xmpush
3
3
  attr_accessor :sound_url, :badge
4
4
 
5
5
  def initialize(**message)
6
- sound_url = message.delete(:sound_url) || ""
7
- badge = message.delete(:badge) || 1
6
+ extra = message.delete(:extra) if message[:extra]
8
7
  super(message)
9
- @extra = {sound_url: sound_url, badge: badge}
8
+ extra_message = {sound_url: "", badge: 1}
9
+ extra_message.merge!(extra) if extra
10
+ @extra = extra_message
10
11
  end
11
12
 
12
13
  def build
@@ -1,3 +1,3 @@
1
1
  module Xmpush
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/xmpush.rb CHANGED
@@ -4,7 +4,6 @@ require 'xmpush/message'
4
4
  require 'xmpush/ios_builder'
5
5
  require 'xmpush/android_builder'
6
6
  require 'xmpush/targeted_message'
7
- require 'xmpush/result'
8
7
  require 'xmpush/stats'
9
8
  require 'xmpush/subscription'
10
9
  require 'xmpush/tracer'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmpush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - blackanger