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