Module: Umeng::SendMessage
Instance Method Summary collapse
-
#push_broadcast(content, opt = {}) ⇒ Object
广播.
-
#push_listcast(device_tokens, content, opt = {}) ⇒ Object
列播.
-
#push_unicast(device_tokens, content, opt = {}) ⇒ Object
单播.
Methods included from JsonBody
Methods included from Services
Methods included from Util
Instance Method Details
#push_broadcast(content, opt = {}) ⇒ Object
广播
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/umeng/send_message.rb', line 10 def push_broadcast(content, opt={}) params = { type: 'broadcast', description: opt['description'] || '广播', production_mode: opt['production_mode'] || 'false' } case @plantform when 'Android' params.merge! android_params(content, opt) push(params) when 'iOS' params.merge! ios_params(content, opt) push(params) end end |
#push_listcast(device_tokens, content, opt = {}) ⇒ Object
列播
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/umeng/send_message.rb', line 45 def push_listcast(device_tokens, content, opt={}) params = { device_tokens: device_tokens, type: 'listcast', description: opt['description'] || '列播', production_mode: opt['production_mode'] || 'false', } case @plantform when 'Android' params.merge! android_params(content, opt) push(params) when 'iOS' params.merge! ios_params(content, opt) push(params) end end |
#push_unicast(device_tokens, content, opt = {}) ⇒ Object
单播
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/umeng/send_message.rb', line 27 def push_unicast(device_tokens, content, opt={}) params = { device_tokens: device_tokens, type: 'unicast', description: opt['description'] || '单播', production_mode: opt['production_mode'] || 'false', } case @plantform when 'Android' params.merge! android_params(content, opt) push(params) when 'iOS' params.merge! ios_params(content, opt) push(params) end end |