pntfr 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81121c5693dc0883a2cc0ac54c11b5e463d5c38f
4
- data.tar.gz: 78fe7b37a43277c09b070fe57ea31476f9f355fc
3
+ metadata.gz: f221094bc8a33889ee989b9c5e0b3efa6bb6ff8b
4
+ data.tar.gz: c6a9e243937f0edd3156f7aa08286cf1d94df001
5
5
  SHA512:
6
- metadata.gz: 3edc5e879d1f19dddad721ebe06c5256d666a997d9e20e6efc0e08f84cf526d28cb62a8352bfbfaf358a9b69e97248680406e0b93d98f65d448e3c1b5f0419bf
7
- data.tar.gz: f00892e3d4d9f97447bf947c43162320c992a43ebb56da5874e48c0ccfffef6fb4c5e20896a24205504965de37a75d11334437d03964e2294e448a99a4a75605
6
+ metadata.gz: 9967a87ce75e3d54a592fcd3b5ffc6fd1e6abbc673793b8c71a0ead675e692629f2d121dcdfad90e3a92fd4992d8383646cdaa37afa0af38dc9b3185f76328c8
7
+ data.tar.gz: d65996ca9d17152d5f41cb6cf6be1a96be4a2afce06ccb27e49b9f12fbdcde55a02bc8c1472d37798a844e6617811f56142759218ee8da7b6f544b41a0bec30b
data/README.md CHANGED
@@ -83,8 +83,7 @@ vsession.msg(
83
83
  )
84
84
  vsession.notify
85
85
 
86
- # Custom content will be found into :custom key for Android.
87
- # For iOS each custom key is transformed into an 'acme-' prefixed key.
86
+ # Custom content will be found into :custom key for each platform.
88
87
  ```
89
88
  # Testing
90
89
  For testing one can check the messages to be sent to each given driver the same way
data/lib/pntfr/version.rb CHANGED
@@ -1,4 +1,9 @@
1
1
  module Pntfr
2
- # [FIX] Custom content is a "others" key in the content argument to APNS.
3
- VERSION = '0.1.5'
2
+ # For IOS do not prefix custom fields with 'acme-' in the notification,
3
+ # instead group them all into a :custom key, like in Android.
4
+ #
5
+ # As this change doesn't break the gems API but changes device's management of
6
+ # received notifications, lets change only the minor version. This will also
7
+ # reflect the adding of the custom keys feature.
8
+ VERSION = '0.2.0'
4
9
  end
@@ -51,11 +51,7 @@ module Pntfr
51
51
  @alert= @sound= @badge= nil
52
52
  end
53
53
  def add_custom_content custom
54
- @custom= {other: {}}
55
- custom.each_pair { |k, v|
56
- key= "acme-#{k}".to_sym
57
- @custom[:other][key]= v
58
- }
54
+ @custom= {other: {custom: custom}}
59
55
  end
60
56
  end
61
57
  end
@@ -42,7 +42,7 @@ module Pntfr
42
42
  assert_equal 5, notif[:badge]
43
43
  end
44
44
 
45
- def test_sending_custom_content_for_ios_should_be_added_as_acme_keys
45
+ def test_sending_custom_content_for_ios_should_be_added_as_custom_keys
46
46
  session= DeviceSession.new(Pntfr::Platforms::IOS, @push_id)
47
47
 
48
48
  vsession= Pntfr::Notifier.to(session)
@@ -54,10 +54,10 @@ module Pntfr
54
54
  refute_nil ios_notifs, "A notification should have been delivered for #{@push_id}"
55
55
  ios_notif= ios_notifs.last
56
56
  assert_equal 'Test Title', ios_notif[:alert]
57
- other= ios_notif[:other]
58
- assert_equal 'extra one', other[:'acme-extra1']
59
- assert_equal 'extra 2', other[:'acme-extra_2']
60
- assert_equal({lastkey: 'last value'}, other[:'acme-last-extra'])
57
+ custom= ios_notif[:other][:custom]
58
+ assert_equal 'extra one', custom[:'extra1']
59
+ assert_equal 'extra 2', custom[:'extra_2']
60
+ assert_equal({lastkey: 'last value'}, custom[:'last-extra'])
61
61
  end
62
62
  end
63
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pntfr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - oliver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-24 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apns