urbanairship 9.0.0 → 9.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5417adc316435f2d47f4962983571399b1bf4dea0015cd126ea12077260e50eb
4
- data.tar.gz: ccbaafa7f7f6bb5820c3a9e1834c23b5a8972debc6b964a204a73cb7630dc2b8
3
+ metadata.gz: 0ae923395b8a39ca5c21187a0f20a1a722e493758dd39a6896345a6982469d3a
4
+ data.tar.gz: 71f45b035e2db2726b77a543e15c1538c95d88def506586413f61486f48e9b0a
5
5
  SHA512:
6
- metadata.gz: 36063a93db8505fa64180ef1980068112d3e14b6b0330e97fa772bd7081c25ab0500aaa7db442ba086a7b12ae8e2c588bbdce7f34144998287a242e401c49c6c
7
- data.tar.gz: d0cccf9b2713aa344d268c8a997a549525166f88e98e78d63b2a16a12e4123ce999e9be430c0c63a167cf5ff09505cc846755fc02ec822504b898146389aa799
6
+ metadata.gz: 88ad9d5d947d5c545d14626cc5c02704f019077842f0349d1975c498419b812ec89f07dbd28bd91d8c36394132b42a06ac6998264b67d71bfb051416ce8185a4
7
+ data.tar.gz: dfefec7dbe7349ecba36d935fab3ba1a0a88290ce527fc1b27ce47bd036b5f5526f238d7be7e5170160fe349f2dc313387e8f787f6bfebfa8a4e7cfb72c004e3
@@ -6,7 +6,6 @@ on:
6
6
 
7
7
  jobs:
8
8
  test:
9
-
10
9
  runs-on: ubuntu-latest
11
10
 
12
11
  strategy:
@@ -27,5 +26,5 @@ jobs:
27
26
  uses: cadwallion/publish-rubygems-action@master
28
27
  env:
29
28
  RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
30
- GUTHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
31
- RELEASE_COMMAND: rake release
29
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
30
+ RELEASE_COMMAND: rake release
data/CHANGELOG CHANGED
@@ -1,8 +1,25 @@
1
+ --------------------
2
+ 9.1.1
3
+ --------------------
4
+ - Adds thread_id Support
5
+
6
+ --------------------
7
+ 9.1.0
8
+ --------------------
9
+ - All requests will now automatically attempt to authenticate with bearer token auth if a
10
+ token is included in the instantiation of the client. Previously, only custom events requests
11
+ could use bearer token auth in this library. You can find more information about how to use
12
+ bearer token auth in the README.
13
+ - Also fixes an issue where a secret was required even when bearer token auth was being used
14
+ (it is no longer required).
15
+
16
+ --------------------
1
17
  9.0.0
2
18
  --------------------
3
19
  - Adds Tag List API Support
4
20
  - Removes location lookup endpoints
5
21
  - Removes location-based audience selectors
22
+
6
23
  --------------------
7
24
  8.0.1
8
25
  --------------------
data/README.rst CHANGED
@@ -175,6 +175,22 @@ Finally, you can change the targeted server on a request basis:
175
175
  # The Urbanairship configuration is overridden by the client and the
176
176
  # request will be sent to the 'go.urbanairship.com' server
177
177
 
178
+ Using Bearer Token Auth
179
+ -----------------------
180
+
181
+ .. code-block:: ruby
182
+
183
+ require 'urbanairship'
184
+
185
+ UA = Urbanairship
186
+ airship = UA::Client.new(key:'application_key', token:'token')
187
+ # Then continue as you would otherwise
188
+
189
+ **Note**: If you include a token in your instantiation, the request
190
+ will use bearer token auth. Bearer token auth is required for some
191
+ endpoints, but not supported by others. Please check `the Airship
192
+ docs site <https://docs.airship.com/>`_ to see where it is supported.
193
+
178
194
  Contributing
179
195
  ============
180
196
 
data/docs/index.rst CHANGED
@@ -1,9 +1,8 @@
1
1
  Airship Ruby Library
2
- ==========================
2
+ ====================
3
3
 
4
4
  ``urbanairship`` is a Ruby library for using the `Airship
5
- <http://airship.com/>`_ web service API for push notifications and
6
- rich app pages.
5
+ <http://airship.com/>`_ web service API for messaging.
7
6
 
8
7
 
9
8
  Installation
@@ -29,8 +28,7 @@ The library is intended to be used with the small footprint of a single
29
28
  import. To get started, import the package, and create an
30
29
  :rb:class:`Airship` object representing a single Airship project.
31
30
 
32
- Note that channels are preferred over ``device_token`` and ``apid``. See:
33
- `documentation on channels <channels>`_.
31
+ The library uses `rest-client <https://github.com/rest-client/rest-client>`_ for communication with the Airship API.
34
32
 
35
33
  .. code-block:: ruby
36
34
 
@@ -43,15 +41,20 @@ Note that channels are preferred over ``device_token`` and ``apid``. See:
43
41
  p.device_types = UA.device_types(['ios','android'])
44
42
  p.send_push
45
43
 
46
- The library uses `unirest`_ for communication with the UA API.
44
+ We in the process of migrating code examples away from these docs and into the
45
+ regular `Airship API reference <https://docs.airship.com/api/ua/>`_
46
+ (select "Ruby Library"), so please check there for more examples.
47
+
48
+ Please also see `the README <https://github.com/urbanairship/ruby-library/blob/main/README.rst>`_
49
+ for detailed instructions on how to use bearer token auth and alternative servers.
47
50
 
48
51
 
49
52
  Development
50
53
  -----------
51
54
 
52
- The library source code is `available on GitHub <github>`_.
55
+ The library source code is `available on GitHub <https://github.com/urbanairship/ruby-library>`_.
53
56
 
54
- Tests can be run with rspec_:
57
+ Tests can be run with `rspec <https://rspec.info/>`_.
55
58
 
56
59
  Contents:
57
60
 
@@ -84,9 +87,3 @@ Indices and tables
84
87
  * :ref:`genindex`
85
88
  * :ref:`modindex`
86
89
  * :ref:`search`
87
-
88
-
89
- .. _channels: http://docs.airship.com/topic-guides/channels.html
90
- .. _unirest: http://unirest.io/ruby.html
91
- .. _github: https://github.com/urbanairship/ruby-library
92
- .. _rspec: https://nose.readthedocs.org/en/latest/
data/docs/push.rst CHANGED
@@ -218,6 +218,7 @@ platform-specific alerts, and we set a number of other platform-specific options
218
218
  extra: { 'key' => 'value', 'key2' => 'value2' },
219
219
  expiry: '2019-01-01 12:45:00',
220
220
  category: 'category_name',
221
+ thread_id: 'thread_test',
221
222
  interactive: UA.interactive(
222
223
  type: 'ua_share',
223
224
  button_actions: {
@@ -15,10 +15,9 @@ module Urbanairship
15
15
  # @param [Object] secret Application Secret
16
16
  # @param [String] server Airship server to use ("go.airship.eu" or "go.urbanairship.com").
17
17
  # Used only when the request is sent with a "path", not an "url".
18
- # @param [String] token Application Auth Token (for custom events endpoint)
18
+ # @param [String] token Application Auth Token
19
19
  # @return [Object] Client
20
- def initialize(key: required('key'), secret: required('secret'),
21
- server: Urbanairship.configuration.server, token: nil)
20
+ def initialize(key: required('key'), secret: nil, server: Urbanairship.configuration.server, token: nil)
22
21
  @key = key
23
22
  @secret = secret
24
23
  @server = server
@@ -57,6 +56,10 @@ module Urbanairship
57
56
  headers['Content-Type'] = content_type unless content_type.nil?
58
57
  headers['Content-Encoding'] = encoding unless encoding.nil?
59
58
 
59
+ if @token != nil
60
+ auth_type = :bearer
61
+ end
62
+
60
63
  if auth_type == :bearer
61
64
  raise ArgumentError.new('token must be provided as argument if auth_type=bearer') if @token.nil?
62
65
  headers['X-UA-Appkey'] = @key
@@ -82,6 +85,7 @@ module Urbanairship
82
85
  }
83
86
 
84
87
  if auth_type == :basic
88
+ raise ArgumentError.new('secret must be provided as argument if auth_type=basic') if @secret.nil?
85
89
  params[:user] = @key
86
90
  params[:password] = @secret
87
91
  end
@@ -34,7 +34,7 @@ module Urbanairship
34
34
  def ios(alert: nil, badge: nil, sound: nil, content_available: nil,
35
35
  extra: nil, expiry: nil, priority: nil, category: nil,
36
36
  interactive: nil, mutable_content: nil, media_attachment: nil,
37
- title: nil, subtitle: nil, collapse_id: nil)
37
+ title: nil, subtitle: nil, collapse_id: nil, thread_id: nil)
38
38
  compact_helper({
39
39
  alert: alert,
40
40
  badge: badge,
@@ -49,7 +49,8 @@ module Urbanairship
49
49
  media_attachment: media_attachment,
50
50
  title: title,
51
51
  subtitle: subtitle,
52
- collapse_id: collapse_id
52
+ collapse_id: collapse_id,
53
+ thread_id: thread_id
53
54
  })
54
55
  end
55
56
 
@@ -1,3 +1,3 @@
1
1
  module Urbanairship
2
- VERSION = '9.0.0'
2
+ VERSION = '9.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanairship
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 9.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airship
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-04 00:00:00.000000000 Z
11
+ date: 2023-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -215,7 +215,7 @@ licenses:
215
215
  - Apache-2.0
216
216
  metadata:
217
217
  allowed_push_host: https://rubygems.org
218
- post_install_message:
218
+ post_install_message:
219
219
  rdoc_options: []
220
220
  require_paths:
221
221
  - lib
@@ -230,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  - !ruby/object:Gem::Version
231
231
  version: '0'
232
232
  requirements: []
233
- rubygems_version: 3.0.3.1
234
- signing_key:
233
+ rubygems_version: 3.4.10
234
+ signing_key:
235
235
  specification_version: 4
236
236
  summary: Ruby Gem for using the Airship API
237
237
  test_files: []