pntfr 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/pntfr/version.rb +7 -2
- data/lib/pntfr/virtual_session/ios.rb +1 -5
- data/test/pntfr/virtual_session/ios_test.rb +5 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f221094bc8a33889ee989b9c5e0b3efa6bb6ff8b
|
4
|
+
data.tar.gz: c6a9e243937f0edd3156f7aa08286cf1d94df001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
#
|
3
|
-
|
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
|
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
|
-
|
58
|
-
assert_equal 'extra one',
|
59
|
-
assert_equal 'extra 2',
|
60
|
-
assert_equal({lastkey: 'last value'},
|
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.
|
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-
|
11
|
+
date: 2014-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apns
|