urbanairship 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG +6 -0
- data/README.rst +2 -0
- data/lib/urbanairship/client.rb +1 -1
- data/lib/urbanairship/configuration.rb +2 -1
- data/lib/urbanairship/push/payload.rb +103 -9
- data/lib/urbanairship/version.rb +1 -1
- metadata +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 13da53469054b43b5611d4d3a1a32a05ee1adcc0dbead577b29defafd27d84b7
|
4
|
+
data.tar.gz: 74b10314d1e4a466ca06e942359d02f98d86b8423cd6fbda1dc57267d6d34670
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 923a889b3334c877cca88a5e491649270a0113b570cefbfeb3d9561205bc17567cda2c1f92cf6e4be25eff464633ab7d607b46beba4de85615e741f6ad50cce4
|
7
|
+
data.tar.gz: 1c812031883eb303a6a090c422252b3550eee1d592b34d2f787979c6047f6012082865dec3d7035d3223197dda0fc1c0167a2f28b8bc88362f41423c2bb9b504
|
data/CHANGELOG
CHANGED
data/README.rst
CHANGED
@@ -53,6 +53,7 @@ In your app initialization, you can do something like the following:
|
|
53
53
|
>>> Urbanairship.configure do |config|
|
54
54
|
>>> config.log_path = '/path/to/your/logfile'
|
55
55
|
>>> config.log_level = Logger::WARN
|
56
|
+
>>> config.timeout = 60
|
56
57
|
>>> end
|
57
58
|
|
58
59
|
|
@@ -61,6 +62,7 @@ Available Configurations
|
|
61
62
|
|
62
63
|
- **log_path**: Allows to define the folder where the log file will be created (the default is nil).
|
63
64
|
- **log_level**: Allows to define the log level and only messages at that level or higher will be printed (the default is INFO).
|
65
|
+
- **timeout**: Allows to define the request timeout in seconds (the default is 5).
|
64
66
|
|
65
67
|
|
66
68
|
Usage
|
data/lib/urbanairship/client.rb
CHANGED
@@ -22,24 +22,31 @@ module Urbanairship
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# iOS specific portion of Push Notification Object
|
25
|
-
def ios(alert: nil, badge: nil, sound: nil,
|
26
|
-
|
25
|
+
def ios(alert: nil, badge: nil, sound: nil, content_available: nil,
|
26
|
+
extra: nil, expiry: nil, priority: nil, category: nil,
|
27
|
+
interactive: nil, mutable_content: nil, media_attachment: nil,
|
28
|
+
title: nil, subtitle: nil, collapse_id: nil)
|
27
29
|
compact_helper({
|
28
30
|
alert: alert,
|
29
31
|
badge: badge,
|
30
32
|
sound: sound,
|
33
|
+
'content-available' => content_available,
|
31
34
|
extra: extra,
|
32
35
|
expiry: expiry,
|
36
|
+
priority: priority,
|
33
37
|
category: category,
|
34
38
|
interactive: interactive,
|
35
|
-
'content
|
36
|
-
|
39
|
+
'mutable-content' => mutable_content,
|
40
|
+
media_attachment: media_attachment,
|
41
|
+
title: title,
|
42
|
+
subtitle: subtitle,
|
43
|
+
collapse_id: collapse_id
|
37
44
|
})
|
38
45
|
end
|
39
46
|
|
40
47
|
# Amazon specific portion of Push Notification Object
|
41
48
|
def amazon(alert: nil, consolidation_key: nil, expires_after: nil,
|
42
|
-
extra: nil, title: nil, summary: nil, interactive: nil)
|
49
|
+
extra: nil, title: nil, summary: nil, interactive: nil, style: nil, sound: nil)
|
43
50
|
compact_helper({
|
44
51
|
alert: alert,
|
45
52
|
consolidation_key: consolidation_key,
|
@@ -47,19 +54,41 @@ module Urbanairship
|
|
47
54
|
extra: extra,
|
48
55
|
title: title,
|
49
56
|
summary: summary,
|
50
|
-
interactive: interactive
|
57
|
+
interactive: interactive,
|
58
|
+
style: style,
|
59
|
+
sound: sound
|
51
60
|
})
|
52
61
|
end
|
53
62
|
|
54
63
|
# Android specific portion of Push Notification Object
|
55
|
-
def android(alert: nil,
|
56
|
-
|
64
|
+
def android(title: nil, alert: nil, summary: nil, extra: nil,
|
65
|
+
style: nil, icon: nil, icon_color: nil, notification_tag: nil,
|
66
|
+
notification_channel: nil, category: nil, visibility: nil,
|
67
|
+
public_notification: nil, sound: nil, priority: nil, collapse_key: nil,
|
68
|
+
time_to_live: nil, delivery_priority: nil, delay_while_idle: nil,
|
69
|
+
local_only: nil, wearable: nil, background_image: nil, extra_pages: nil,
|
70
|
+
interactive: nil)
|
57
71
|
compact_helper({
|
72
|
+
title: title,
|
58
73
|
alert: alert,
|
74
|
+
summary: summary,
|
75
|
+
extra: extra,
|
76
|
+
style: style,
|
77
|
+
icon: icon,
|
78
|
+
icon_color: icon_color,
|
79
|
+
notification_tag: notification_tag,
|
80
|
+
notification_channel: notification_channel,
|
81
|
+
category: category,
|
82
|
+
visibility: visibility,
|
83
|
+
public_notification: public_notification,
|
84
|
+
sound: sound,
|
85
|
+
priority: priority,
|
59
86
|
collapse_key: collapse_key,
|
60
87
|
time_to_live: time_to_live,
|
61
|
-
|
88
|
+
delivery_priority: delivery_priority,
|
62
89
|
delay_while_idle: delay_while_idle,
|
90
|
+
local_only: local_only,
|
91
|
+
wearable: wearable,
|
63
92
|
interactive: interactive
|
64
93
|
})
|
65
94
|
end
|
@@ -136,6 +165,71 @@ module Urbanairship
|
|
136
165
|
app_defined: app_defined
|
137
166
|
})
|
138
167
|
end
|
168
|
+
|
169
|
+
# iOS Media Attachment builder
|
170
|
+
def media_attachment(url: required('url'), content: nil, options: nil)
|
171
|
+
fail ArgumentError, 'url must not be nil' if url.nil?
|
172
|
+
compact_helper({
|
173
|
+
url: url,
|
174
|
+
content: content,
|
175
|
+
options: options
|
176
|
+
})
|
177
|
+
end
|
178
|
+
|
179
|
+
# iOS Content builder. Each argument describes the portions of the
|
180
|
+
# notification that should be modified if the media_attachment succeeds.
|
181
|
+
def content(title: nil, subtitle: nil, body: nil)
|
182
|
+
compact_helper({
|
183
|
+
title: title,
|
184
|
+
subtitle: subtitle,
|
185
|
+
body: body
|
186
|
+
})
|
187
|
+
end
|
188
|
+
|
189
|
+
# iOS crop builder.
|
190
|
+
def crop(x: nil, y: nil, width: nil, height: nil)
|
191
|
+
compact_helper({
|
192
|
+
x: x,
|
193
|
+
y: y,
|
194
|
+
width: width,
|
195
|
+
height: height
|
196
|
+
})
|
197
|
+
end
|
198
|
+
|
199
|
+
# Android/Amazon style builder.
|
200
|
+
def style(type: required('type'), content: required('content'),
|
201
|
+
title: nil, summary: nil)
|
202
|
+
fail ArgumentError, 'type must not be nil' if type.nil?
|
203
|
+
|
204
|
+
mapping = {
|
205
|
+
big_picture: 'big_picture', big_text: 'big_text', inbox: 'lines'
|
206
|
+
}
|
207
|
+
|
208
|
+
compact_helper({
|
209
|
+
type: type,
|
210
|
+
mapping[type.to_sym] => content,
|
211
|
+
title: title,
|
212
|
+
summary: summary
|
213
|
+
})
|
214
|
+
end
|
215
|
+
|
216
|
+
# Android L public notification payload builder.
|
217
|
+
def public_notification(title: nil, alert: nil, summary: nil)
|
218
|
+
compact_helper({
|
219
|
+
title: title,
|
220
|
+
alert: alert,
|
221
|
+
summary: summary
|
222
|
+
})
|
223
|
+
end
|
224
|
+
|
225
|
+
# Android wearable payload builder.
|
226
|
+
def wearable(background_image: nil, extra_pages: nil, interactive: nil)
|
227
|
+
compact_helper({
|
228
|
+
background_image: background_image,
|
229
|
+
extra_pages: extra_pages,
|
230
|
+
interactive: interactive,
|
231
|
+
})
|
232
|
+
end
|
139
233
|
end
|
140
234
|
end
|
141
235
|
end
|
data/lib/urbanairship/version.rb
CHANGED
metadata
CHANGED
@@ -1,117 +1,117 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanairship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Urban Airship
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.4'
|
20
|
-
- - <
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '4.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '1.4'
|
30
|
-
- - <
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '4.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '1'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ~>
|
44
|
+
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: guard-rspec
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- -
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: pry
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - ~>
|
65
|
+
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
|
-
- - ~>
|
72
|
+
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rake
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - ~>
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '10.0'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
|
-
- - ~>
|
86
|
+
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '10.0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rspec
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- - ~>
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '3'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- - ~>
|
100
|
+
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '3'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: terminal-notifier-guard
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- - ~>
|
107
|
+
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '1'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
-
- - ~>
|
114
|
+
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '1'
|
117
117
|
description: A Ruby Library for using the Urban Airship web service API for push notifications
|
@@ -122,13 +122,13 @@ executables: []
|
|
122
122
|
extensions: []
|
123
123
|
extra_rdoc_files: []
|
124
124
|
files:
|
125
|
-
- .github/CONTRIBUTING.md
|
126
|
-
- .github/ISSUE_TEMPLATE.md
|
127
|
-
- .github/PULL_REQUEST_TEMPLATE.md
|
128
|
-
- .github/SUPPORT.md
|
129
|
-
- .gitignore
|
130
|
-
- .rspec
|
131
|
-
- .travis.yml
|
125
|
+
- ".github/CONTRIBUTING.md"
|
126
|
+
- ".github/ISSUE_TEMPLATE.md"
|
127
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
128
|
+
- ".github/SUPPORT.md"
|
129
|
+
- ".gitignore"
|
130
|
+
- ".rspec"
|
131
|
+
- ".travis.yml"
|
132
132
|
- CHANGELOG
|
133
133
|
- Gemfile
|
134
134
|
- Guardfile
|
@@ -184,17 +184,17 @@ require_paths:
|
|
184
184
|
- lib
|
185
185
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- -
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: 2.0.0
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
|
-
- -
|
192
|
+
- - ">="
|
193
193
|
- !ruby/object:Gem::Version
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.
|
197
|
+
rubygems_version: 2.7.6
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Ruby Gem for using the Urban Airship API
|