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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 034d8de0f4696f840692ef88e5646af49cd424603ef0417be06312a58a61a640
4
- data.tar.gz: 3bcadf28d715b047c1f1b0f6b60326b58d365eded8ddaf1e1d78c5b5f81c39a8
3
+ metadata.gz: fb26cf5109afd2857d244091042f687898225e0ce0a44ea789bc3ae08aab585c
4
+ data.tar.gz: 6fb69b76b4ca8310c5a89292d86500df86cf36ff9222050b50e712fda3e84ac0
5
5
  SHA512:
6
- metadata.gz: 937b1b6b68cc949bf6b28f10ca4c3ca78ec0811a87f4ff3bd926a6318d26042bea787ab067cb4c04801b35c7183180dafc474e1df22d64636035f8c0d7e8d047
7
- data.tar.gz: 971f4544764419a4a08b8cdea97d58126d759deb145cc76567c4465bbf4db1154ef6bc46da04c729cc5bd3cedf709c71b93ee6269311179f32c4034780ab2f5a
6
+ metadata.gz: 67efc5af2f83e3d782d66bd9ff7674135a3d778bc9fe1669ab3fc11e19d68161839ad13b8265c8e8cac52ce8f68444d2617413d80eb16db95d329f5dfd9a1af1
7
+ data.tar.gz: b5d21c00c7cc72d56dff95bd33d2d7742024d84b4f5faa0b0a4187256ea578f6ae8ad423e4d2e29b1af8b32e9fbecec29e0422c7524d0a1ad83959a23ace9197
@@ -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
@@ -45,6 +45,7 @@ module Rpush
45
45
  attribute :content_available, :boolean, default: false
46
46
  attribute :mutable_content, :boolean, default: false
47
47
  attribute :notification, :hash
48
+ attribute :thread_id, :string
48
49
 
49
50
  def app
50
51
  return nil unless app_id
@@ -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
@@ -1,8 +1,8 @@
1
1
  module Rpush
2
2
  module VERSION
3
3
  MAJOR = 3
4
- MINOR = 2
5
- TINY = 4
4
+ MINOR = 3
5
+ TINY = 0
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
@@ -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.2.4
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-10-25 00:00:00.000000000 Z
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