module NewUmeng::SendMessage

Public Instance Methods

push_broadcast(opts={}) click to toggle source

广播

# File lib/new_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_groupcast(filter, opts={}) click to toggle source

组播

# File lib/new_umeng/send_message.rb, line 60
def push_groupcast(filter, opts={})
  params = {
    type: 'groupcast',
    filter: {
      where: {
        and: {
          or: filter
        }
      }
    },
    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={}) click to toggle source

列播

# File lib/new_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={}) click to toggle source

单播

# File lib/new_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