rpush 3.2.4 → 3.3.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 +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/generators/rpush_migration_generator.rb +1 -0
- data/lib/generators/templates/rpush_3_3_0_updates.rb +9 -0
- data/lib/rpush/client/active_model/apns/notification.rb +1 -0
- data/lib/rpush/client/redis/notification.rb +1 -0
- data/lib/rpush/configuration.rb +0 -1
- data/lib/rpush/version.rb +2 -2
- data/spec/support/active_record_setup.rb +3 -1
- data/spec/unit/client/active_record/apns/notification_spec.rb +13 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb26cf5109afd2857d244091042f687898225e0ce0a44ea789bc3ae08aab585c
|
4
|
+
data.tar.gz: 6fb69b76b4ca8310c5a89292d86500df86cf36ff9222050b50e712fda3e84ac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67efc5af2f83e3d782d66bd9ff7674135a3d778bc9fe1669ab3fc11e19d68161839ad13b8265c8e8cac52ce8f68444d2617413d80eb16db95d329f5dfd9a1af1
|
7
|
+
data.tar.gz: b5d21c00c7cc72d56dff95bd33d2d7742024d84b4f5faa0b0a4187256ea578f6ae8ad423e4d2e29b1af8b32e9fbecec29e0422c7524d0a1ad83959a23ace9197
|
data/CHANGELOG.md
CHANGED
@@ -12,6 +12,18 @@
|
|
12
12
|
|
13
13
|
- None
|
14
14
|
|
15
|
+
## 3.3.0 (2018-11-14)
|
16
|
+
|
17
|
+
When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations.
|
18
|
+
|
19
|
+
### Added
|
20
|
+
|
21
|
+
- Added support for Apple Push Notification service `thread-id` field [#460](https://github.com/rpush/rpush/pull/460) (by [@gerard-morera](https://github.com/gerard-morera)).
|
22
|
+
|
23
|
+
### Changes
|
24
|
+
|
25
|
+
- Remove unused class `ConfigurationWithoutDefaults` [#461](https://github.com/rpush/rpush/pull/461) (by [@adis-io](https://github.com/adis-io)).
|
26
|
+
|
15
27
|
## 3.2.4 (2018-10-25)
|
16
28
|
|
17
29
|
When upgrading, don't forget to run `bundle exec rpush init` to get all the latest migrations.
|
@@ -48,6 +48,7 @@ class RpushMigrationGenerator < Rails::Generators::Base
|
|
48
48
|
add_rpush_migration('rpush_3_1_1_updates')
|
49
49
|
add_rpush_migration('rpush_3_2_0_add_apns_p8')
|
50
50
|
add_rpush_migration('rpush_3_2_4_updates')
|
51
|
+
add_rpush_migration('rpush_3_3_0_updates')
|
51
52
|
end
|
52
53
|
|
53
54
|
protected
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class Rpush330Updates < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :rpush_notifications, :thread_id, :string, null: true
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.down
|
7
|
+
remove_column :rpush_notifications, :thread_id
|
8
|
+
end
|
9
|
+
end
|
@@ -56,6 +56,7 @@ module Rpush
|
|
56
56
|
json['aps']['sound'] = sound if sound
|
57
57
|
json['aps']['category'] = category if category
|
58
58
|
json['aps']['url-args'] = url_args if url_args
|
59
|
+
json['aps']['thread-id'] = thread_id if thread_id
|
59
60
|
|
60
61
|
if data && data[MUTABLE_CONTENT_KEY]
|
61
62
|
json['aps']['mutable-content'] = 1
|
data/lib/rpush/configuration.rb
CHANGED
@@ -21,7 +21,6 @@ module Rpush
|
|
21
21
|
CONFIG_ATTRS = CURRENT_ATTRS + DEPRECATED_ATTRS
|
22
22
|
|
23
23
|
class ConfigurationError < StandardError; end
|
24
|
-
class ConfigurationWithoutDefaults < Struct.new(*CONFIG_ATTRS); end # rubocop:disable Style/StructInheritance
|
25
24
|
|
26
25
|
class ApnsFeedbackReceiverConfiguration < Struct.new(:frequency, :enabled) # rubocop:disable Style/StructInheritance
|
27
26
|
def initialize
|
data/lib/rpush/version.rb
CHANGED
@@ -37,6 +37,7 @@ require 'generators/templates/rpush_3_1_0_add_pushy'
|
|
37
37
|
require 'generators/templates/rpush_3_1_1_updates'
|
38
38
|
require 'generators/templates/rpush_3_2_0_add_apns_p8'
|
39
39
|
require 'generators/templates/rpush_3_2_4_updates'
|
40
|
+
require 'generators/templates/rpush_3_3_0_updates'
|
40
41
|
|
41
42
|
migrations = [
|
42
43
|
AddRpush,
|
@@ -49,7 +50,8 @@ migrations = [
|
|
49
50
|
Rpush310AddPushy,
|
50
51
|
Rpush311Updates,
|
51
52
|
Rpush320AddApnsP8,
|
52
|
-
Rpush324Updates
|
53
|
+
Rpush324Updates,
|
54
|
+
Rpush330Updates
|
53
55
|
]
|
54
56
|
|
55
57
|
unless ENV['TRAVIS']
|
@@ -309,3 +309,16 @@ describe Rpush::Client::ActiveRecord::Apns::Notification, "multi_json usage" do
|
|
309
309
|
end
|
310
310
|
end
|
311
311
|
end if active_record?
|
312
|
+
|
313
|
+
describe Rpush::Client::ActiveRecord::Apns::Notification, 'thread-id' do
|
314
|
+
let(:notification) { Rpush::Client::ActiveRecord::Apns::Notification.new }
|
315
|
+
|
316
|
+
it 'includes thread-id in the payload' do
|
317
|
+
notification.thread_id = 'THREAD-ID'
|
318
|
+
expect(notification.as_json['aps']['thread-id']).to eq 'THREAD-ID'
|
319
|
+
end
|
320
|
+
|
321
|
+
it 'does not include thread-id in the payload if not set' do
|
322
|
+
expect(notification.as_json['aps']).to_not have_key('thread-id')
|
323
|
+
end
|
324
|
+
end if active_record?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Leitch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -388,6 +388,7 @@ files:
|
|
388
388
|
- lib/generators/templates/rpush_3_1_1_updates.rb
|
389
389
|
- lib/generators/templates/rpush_3_2_0_add_apns_p8.rb
|
390
390
|
- lib/generators/templates/rpush_3_2_4_updates.rb
|
391
|
+
- lib/generators/templates/rpush_3_3_0_updates.rb
|
391
392
|
- lib/rpush.rb
|
392
393
|
- lib/rpush/apns_feedback.rb
|
393
394
|
- lib/rpush/cli.rb
|