jpush_api_ruby_client 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/example/client_example.rb +28 -10
- data/lib/jpush_api_ruby_client/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4d127c1bf6758f961bef53c99892a6590e21344
|
4
|
+
data.tar.gz: add7ab30c8d7f56ff885c1e7a79c3a763d611d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c3f9d4c01f459826fda392d1b1e4b8ee88e0eb1da1d1bb01b20789950a64aad33b0e373c0681a73e7d72fdeb0166209486ebda7abbaee18a1b2700145845771
|
7
|
+
data.tar.gz: 7542d141005b6109979ad4ca0ae2b6d4d5c7c37daea11158883568590e977c8d197c4fd4571aeed9e13b3a63cfc377c505c9d306b2a52db808fab33e2c95756a
|
data/README.md
CHANGED
@@ -30,11 +30,11 @@ local install
|
|
30
30
|
|
31
31
|
##Example
|
32
32
|
|
33
|
-
Detailes refer to [Example](/example/client_example.rb)
|
33
|
+
Detailes refer to [Example](https://github.com/aaron-codes/jpush_api_ruby_client/blob/master/example/client_example.rb)
|
34
34
|
|
35
35
|
## Usage
|
36
36
|
|
37
|
-
Detailes refer to [Doc](/
|
37
|
+
Detailes refer to [Doc](http://rubydoc.info/gems/jpush_api_ruby_client/index)
|
38
38
|
|
39
39
|
## Contributing
|
40
40
|
|
data/example/client_example.rb
CHANGED
@@ -2,8 +2,8 @@ require 'jpush_api_ruby_client'
|
|
2
2
|
|
3
3
|
class ClientExample
|
4
4
|
|
5
|
-
app_key = '
|
6
|
-
master_secret = '
|
5
|
+
app_key = '466f7032ac604e02fb7bda89' #必填,例如466f7032ac604e02fb7bda89
|
6
|
+
master_secret = '57c45646c772983fede7c455' #必填,每个应用都对应一个masterSecret
|
7
7
|
|
8
8
|
# 保存离线的时长。秒为单位。最多支持10天(864000秒)。
|
9
9
|
# 0 表示该消息不保存离线。即:用户在线马上发出,当前不在线用户将不会收到此消息。
|
@@ -37,29 +37,47 @@ class ClientExample
|
|
37
37
|
msg_title = 'JPushApiRubyClient实例'
|
38
38
|
|
39
39
|
msg_content = '根据 appkey 发送广播通知'
|
40
|
-
puts send_result = jpush_client.send_notification_with_appkey(send_no, msg_title, msg_content
|
40
|
+
puts send_result = jpush_client.send_notification_with_appkey(send_no, msg_title, msg_content)
|
41
|
+
|
42
|
+
=begin
|
43
|
+
带上可选参数调用 opts参数可包含 builder_id 、extras 、override_msg_id
|
44
|
+
puts send_result = jpush_client.send_notification_with_appkey(send_no,
|
45
|
+
msg_title,
|
46
|
+
msg_content,
|
47
|
+
'builder_id' => 0,
|
48
|
+
'extras' => {'key1'=> 'value1','key2'=>'value2'},
|
49
|
+
'override_msg_id' => '这里输入你上一条消息的msg_id')
|
50
|
+
=end
|
41
51
|
|
42
52
|
msg_content = '根据 tag 发送通知'
|
43
|
-
puts send_result = jpush_client.send_notification_with_tag(send_no, '
|
53
|
+
puts send_result = jpush_client.send_notification_with_tag(send_no, '这里输入你的tag', msg_title, msg_content)
|
44
54
|
|
45
55
|
msg_content = '根据 alias 发送通知'
|
46
|
-
puts send_result = jpush_client.send_notification_with_alias(send_no, '
|
56
|
+
puts send_result = jpush_client.send_notification_with_alias(send_no, '这里输入你的alias', msg_title, msg_content)
|
47
57
|
|
48
58
|
msg_content = '根据 imei 发送通知'
|
49
|
-
puts send_result = jpush_client.send_notification_with_imei(send_no, '
|
59
|
+
puts send_result = jpush_client.send_notification_with_imei(send_no, '这里输入你的imei', msg_title, msg_content)
|
50
60
|
|
51
61
|
|
52
62
|
msg_content = '根据 appkey 发送自定义消息'
|
53
|
-
puts send_result = jpush_client.send_message_with_appkey(send_no, msg_title, msg_content
|
63
|
+
puts send_result = jpush_client.send_message_with_appkey(send_no, msg_title, msg_content)
|
64
|
+
=begin
|
65
|
+
带上可选参数调用 opts参数可包含 extras 、override_msg_id
|
66
|
+
puts send_result = jpush_client.send_message_with_appkey(send_no,
|
67
|
+
msg_title,
|
68
|
+
msg_content,
|
69
|
+
'extras' => {'key1'=> 'value1','key2'=>'value2'},
|
70
|
+
'override_msg_id' => '这里输入你上一条消息的msg_id')
|
71
|
+
=end
|
54
72
|
|
55
73
|
msg_content = '根据 tag 发送自定义消息'
|
56
|
-
puts send_result = jpush_client.send_message_with_alias(send_no, '
|
74
|
+
puts send_result = jpush_client.send_message_with_alias(send_no, '这里输入你的tag', msg_title, msg_content)
|
57
75
|
|
58
76
|
msg_content = '根据 alias 发送自定义消息'
|
59
|
-
puts send_result = jpush_client.send_message_with_tag(send_no, '
|
77
|
+
puts send_result = jpush_client.send_message_with_tag(send_no, '这里输入你的alias', msg_title, msg_content)
|
60
78
|
|
61
79
|
msg_content = '根据 imei 发送自定义消息'
|
62
|
-
puts send_result = jpush_client.send_message_with_imei(send_no, '
|
80
|
+
puts send_result = jpush_client.send_message_with_imei(send_no, '这里输入你的imei', msg_title, msg_content)
|
63
81
|
|
64
82
|
|
65
83
|
end
|