push_kit-apns 1.0.0.pre.beta4 → 1.0.0.pre.beta5

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: b461e7cadd443ff8cf2f76ddc9958d17ed2e64aaf41b2b68251c61aea25b7c47
4
- data.tar.gz: 01df1f70ff18ff756114f359c08deef299aa830cf64a27a9519238d445d20a3a
3
+ metadata.gz: 79ebd1192da6f7767fab712f49c4014d69c43329ca764162933e36cec6845abb
4
+ data.tar.gz: 8df77e6fcff39ff6f40c1118ab3fc66532433413579e81da4e605c5590ad2b5c
5
5
  SHA512:
6
- metadata.gz: 4496b655bfce5b70764e2cf4b17e825d1f93e00f0d193fa9181d55dc2676b78dcf596c26c1a08238637a0ea2bcc2af3de2a5255ea2199b9d4a84bb81f74444f9
7
- data.tar.gz: 4aa1cb8f688fd42603d41a935fa0bfc1733880db13077a8ba16f7150303e324c4b596f9e72e7fba1209b51820f8012aa634225f256fb8480b77f5b6842184f66
6
+ metadata.gz: eb154548f0c63ed21e79e99804287ada0ede333062aaebbe80eb5beacb3926ca66585f8a796a0e88ec11919465ab7ba6195b10a6a19366bd58a095a87a738c4d
7
+ data.tar.gz: 12832f719488ecd01e0581e04a26ffc97e95aa9a2185c03460b4f75eec3f152733b4e416828fa223b9beb9e747d06767b5affeaa4b72c8e9e428495183362e29
@@ -4,6 +4,6 @@ module PushKit
4
4
  module APNS
5
5
  # @return [String] The gem's semantic version number.
6
6
  #
7
- VERSION = '1.0.0-beta4'
7
+ VERSION = '1.0.0-beta5'
8
8
  end
9
9
  end
@@ -223,11 +223,11 @@ module PushKit
223
223
  aps['alert'] = alert
224
224
  end
225
225
 
226
- aps['badge'] = badge if badge.is_a?(Integer)
227
- aps['sound'] = sound.to_s if sound.is_a?(String) || sound.is_a?(Symbol)
228
- aps['category'] = category if category.is_a?(String)
229
- aps['content-available'] = 1 if content_available
230
- aps['mutable-content'] = 1 if mutable_content
226
+ aps['badge'] = badge if badge.is_a?(Integer)
227
+ aps['sound'] = sound.to_s if sound.is_a?(String) || sound.is_a?(Symbol)
228
+ aps['category'] = category.to_s if category.is_a?(String) || category.is_a?(Symbol)
229
+ aps['content-available'] = 1 if content_available
230
+ aps['mutable-content'] = 1 if mutable_content
231
231
 
232
232
  aps
233
233
  end
@@ -247,8 +247,8 @@ module PushKit
247
247
  end
248
248
  end
249
249
 
250
- alert['action-loc-key'] = action_key if action_key.is_a?(String)
251
- alert['launch-image'] = launch_image if launch_image.is_a?(String)
250
+ alert['action-loc-key'] = action_key.to_s if action_key.is_a?(String) || action_key.is_a?(Symbol)
251
+ alert['launch-image'] = launch_image if launch_image.is_a?(String)
252
252
 
253
253
  alert
254
254
  end
@@ -183,6 +183,11 @@ RSpec.describe PushKit::APNS::Notification, :unit do
183
183
  expect(payload_aps).to include('category' => 'GENERAL')
184
184
  end
185
185
 
186
+ it 'converts #category into a String given a Symbol' do
187
+ subject.category = :generic
188
+ expect(payload_aps).to include('category' => 'generic')
189
+ end
190
+
186
191
  it 'includes #content_available when truthy' do
187
192
  subject.content_available = true
188
193
  expect(payload_aps).to include('content-available' => 1)
@@ -229,6 +234,11 @@ RSpec.describe PushKit::APNS::Notification, :unit do
229
234
  expect(payload_alert).to include('action-loc-key' => 'ACTION_TITLE')
230
235
  end
231
236
 
237
+ it 'converts #action_key into a String given a Symbol' do
238
+ subject.action_key = :ACTION_TITLE
239
+ expect(payload_alert).to include('action-loc-key' => 'ACTION_TITLE')
240
+ end
241
+
232
242
  it 'includes #launch_image' do
233
243
  subject.launch_image = 'launch.png'
234
244
  expect(payload_alert).to include('launch-image' => 'launch.png')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: push_kit-apns
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta4
4
+ version: 1.0.0.pre.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nialto Services