Module: NewUmeng::JsonBody

Included in:
SendMessage
Defined in:
lib/new_umeng/json_body.rb

Instance Method Summary collapse

Instance Method Details

#android_params(opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/new_umeng/json_body.rb', line 3

def android_params(opts={})
  {
    payload: {
      display_type: opts[:key_value][:display_type],
      body: {
        custom: opts[:key_value]
      }
    }
  }
end

#ios_params(opts = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/new_umeng/json_body.rb', line 14

def ios_params(opts={})
  {
    payload: {
      aps: {
        alert: opts[:key_value]["desc"],
        sound: 'aiff'
      }
    }.merge(opts[:key_value])
  }
end