Module: Umeng::SendMessage

Includes:
JsonBody, Services
Included in:
Client
Defined in:
lib/umeng/send_message.rb,
lib/umeng/send_message_bak.rb

Defined Under Namespace

Modules: APIKey

Instance Method Summary collapse

Methods included from JsonBody

#android_params, #ios_params

Methods included from Services

#cancel, #push, #status

Methods included from Util

#generate_sign, #result

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]
  }
  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]
  }
  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]
  }
  case @plantform
  when 'Android'
    params.merge! android_params(opts)
    push(params)
  when 'iOS'
    params.merge! ios_params(opts)
    push(params)
  end
end