rpush 9.0.0 → 9.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
  SHA256:
3
- metadata.gz: e4ab9013682357312b9f5050d6c466c62866f78c68cc0fcb72ad89ccdc4409e0
4
- data.tar.gz: ab086d28a744140499a6434c5fcec99b6c77c4cd929163a02ac4d9d77f94bb99
3
+ metadata.gz: 6aa3ab521c672b61e3230b036cfd89a6e06b9dc121fcdc85a41f7a055ce2a920
4
+ data.tar.gz: 9d42f3ef5e450aba1f453c75099b76be603f7592bcbe2af36f69b69c002bda43
5
5
  SHA512:
6
- metadata.gz: 862a057ab8cce2f73eff784838302ac0128214e0f744ed108b91afb33dce0867f7e7f06e131a29b46f6f49be7cca4e809f317ed37c50d1512eaa480a8ad7532d
7
- data.tar.gz: 2f2d5cd377c79a1ec1ada2677f5c409d58d27d40a90b899b7fd43b98f122148623a0a78ca17c862b18b38245fe2df9a2f1cc7c68f25dc8cbe3dfa48a1f779c1f
6
+ metadata.gz: 4446b6923428bf5e8c4ce534ddf768be70adb0efe02e539ec783e0807f74acd4220059f36003d2a6100b7feea653f4bf442ec51b76d5f89372c8bf9fa512e7df
7
+ data.tar.gz: 44bc79e6df91d48a1ff421c06aac8d5c27e5797d588fd8b426bc37b3b8878f79176499f6f78eca597c9b26eff81ca9a377efe00211381f35b08a6ae95b852d19
data/CHANGELOG.md CHANGED
@@ -2,9 +2,23 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/rpush/rpush/tree/HEAD)
4
4
 
5
+ [Full Changelog](https://github.com/rpush/rpush/compare/v9.2.0...HEAD)
6
+
7
+ ## [v9.2.0](https://github.com/rpush/rpush/tree/v9.2.0) (2024-11-28)
8
+
9
+ * Support for Rails 7.2 [\#706](https://github.com/rpush/rpush/pull/706) ([benlangfeld](https://github.com/benlangfeld))
10
+
11
+ [Full Changelog](https://github.com/rpush/rpush/compare/v9.1.0...v9.2.0)
12
+
13
+ ## [v9.1.0](https://github.com/rpush/rpush/tree/v9.1.0) (2024-09-24)
14
+
5
15
  **Merged pull requests:**
6
16
 
7
- [Full Changelog](https://github.com/rpush/rpush/compare/v9.0.0...HEAD)
17
+ * Add support for FSM iOS badges [\#704](https://github.com/rpush/rpush/pull/704) ([WoutDev](https://github.com/WoutDev))
18
+ * Support for Rails 7.1 [\#675](https://github.com/rpush/rpush/pull/675) ([benlangfeld](https://github.com/benlangfeld))
19
+ * Enable running tests on sqlite3 [\#705](https://github.com/rpush/rpush/pull/705) ([benlangfeld](https://github.com/benlangfeld))
20
+
21
+ [Full Changelog](https://github.com/rpush/rpush/compare/v9.0.0...v9.1.0)
8
22
 
9
23
  ## [v9.0.0](https://github.com/rpush/rpush/tree/v9.0.0) (2024-09-09)
10
24
 
data/README.md CHANGED
@@ -128,7 +128,7 @@ The app `environment` for any Apns* option is "development" for XCode installs,
128
128
  #### Firebase Cloud Messaging
129
129
 
130
130
  You will need two params to make use of FCM via Rpush.
131
- - `firebase_project_id` - The `Project ID` in your Firebase Project Settings
131
+ - `firebase_project_id` - The `Project number` in your Firebase Project Settings
132
132
  - `json_key` - The JSON key file for a service account with the `Firebase Admin SDK Administrator Service Agent` role.
133
133
 
134
134
  Create service account in the google cloud account attached to your firebase account:
@@ -151,6 +151,7 @@ fcm_app.save!
151
151
  n = Rpush::Fcm::Notification.new
152
152
  n.app = Rpush::Fcm::App.where(name: "fcm_app").first
153
153
  n.device_token = device_token # Note that device_token is used here instead of registration_ids
154
+ n.notification = { title: "push title", body: "hi mom!" } # either title or body needs to be set, or nothing goes through
154
155
  n.data = {}.transform_values(&:to_s) # All values going in here have to be strings, if you have anything else - nothing goes through
155
156
  n.save!
156
157
  ```
@@ -85,11 +85,6 @@ Rpush.reflect do |on|
85
85
  # on.fcm_failed_to_recipient do |notification, error|
86
86
  # end
87
87
 
88
- # Called when the FCM returns a failure that indicates an invalid device token.
89
- # You will need to delete the device token from your records.
90
- # on.fcm_invalid_device_token do |app, error, device_token|
91
- # end
92
-
93
88
  # Called for each recipient which successfully receives a notification. This
94
89
  # can occur more than once for the same notification when there are multiple
95
90
  # recipients.
@@ -77,6 +77,7 @@ module Rpush
77
77
  aps['mutable-content'] = 1 if mutable_content
78
78
  aps['content-available'] = 1 if content_available
79
79
  aps['sound'] = 'default' if sound == 'default'
80
+ aps['badge'] = badge if badge
80
81
 
81
82
  json['payload']['aps'] = aps
82
83
 
@@ -7,6 +7,8 @@ module Rpush
7
7
 
8
8
  self.table_name = 'rpush_notifications'
9
9
 
10
+ self.default_column_serializer = YAML if respond_to?(:default_column_serializer)
11
+
10
12
  serialize :registration_ids
11
13
  serialize :url_args
12
14
 
data/lib/rpush/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Rpush
2
2
  module VERSION
3
3
  MAJOR = 9
4
- MINOR = 0
4
+ MINOR = 2
5
5
  TINY = 0
6
6
  PRE = nil
7
7
 
data/spec/spec_helper.rb CHANGED
@@ -17,13 +17,6 @@ require 'debug'
17
17
  require 'timecop'
18
18
  require 'activerecord-jdbc-adapter' if defined? JRUBY_VERSION
19
19
 
20
- require 'rpush'
21
- require 'rpush/daemon'
22
- require 'rpush/client/redis'
23
- require 'rpush/client/active_record'
24
- require 'rpush/daemon/store/active_record'
25
- require 'rpush/daemon/store/redis'
26
-
27
20
  def active_record?
28
21
  client == :active_record
29
22
  end
@@ -32,6 +25,21 @@ def redis?
32
25
  client == :redis
33
26
  end
34
27
 
28
+ if active_record?
29
+ require 'active_record'
30
+ if ActiveRecord::Base.respond_to?(:default_column_serializer)
31
+ # New default in Rails 7.1: https://github.com/rails/rails/pull/47422
32
+ ActiveRecord::Base.default_column_serializer = nil
33
+ end
34
+ end
35
+
36
+ require 'rpush'
37
+ require 'rpush/daemon'
38
+ require 'rpush/client/redis'
39
+ require 'rpush/client/active_record'
40
+ require 'rpush/daemon/store/active_record'
41
+ require 'rpush/daemon/store/redis'
42
+
35
43
  require 'support/active_record_setup' if active_record?
36
44
 
37
45
  RPUSH_ROOT = '/tmp/rails_root'
@@ -26,7 +26,7 @@ shared_examples 'Rpush::Client::Fcm::Notification' do
26
26
  expect(notification.as_json['message']['notification']).to eq({"title"=>"title", "body"=>"body"})
27
27
  end
28
28
 
29
- it "moves notification keys to the correcdt location" do
29
+ it "moves notification keys to the correct location" do
30
30
  notification.app = app
31
31
  notification.device_token = "valid"
32
32
  notification.notification = { "title" => "valid", "body" => "valid", "color" => "valid for android" }
@@ -82,6 +82,11 @@ shared_examples 'Rpush::Client::Fcm::Notification' do
82
82
  expect(notification.as_json['message']).to have_key 'notification'
83
83
  end
84
84
 
85
+ it 'includes the badge if defined' do
86
+ notification.badge = 3
87
+ expect(notification.as_json['message']['apns']['payload']['aps']['badge']).to eq(3)
88
+ end
89
+
85
90
  it 'excludes the notification payload if undefined' do
86
91
  expect(notification.as_json['message']).not_to have_key 'notification'
87
92
  end
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: 9.0.0
4
+ version: 9.2.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: 2024-09-09 00:00:00.000000000 Z
11
+ date: 2024-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -79,9 +79,15 @@ dependencies:
79
79
  - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '6.0'
82
- - - "<"
82
+ - - "!="
83
+ - !ruby/object:Gem::Version
84
+ version: 7.1.4
85
+ - - "!="
86
+ - !ruby/object:Gem::Version
87
+ version: 7.2.0
88
+ - - "!="
83
89
  - !ruby/object:Gem::Version
84
- version: 7.1.0
90
+ version: 7.2.1
85
91
  type: :runtime
86
92
  prerelease: false
87
93
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,9 +95,15 @@ dependencies:
89
95
  - - ">="
90
96
  - !ruby/object:Gem::Version
91
97
  version: '6.0'
92
- - - "<"
98
+ - - "!="
99
+ - !ruby/object:Gem::Version
100
+ version: 7.1.4
101
+ - - "!="
102
+ - !ruby/object:Gem::Version
103
+ version: 7.2.0
104
+ - - "!="
93
105
  - !ruby/object:Gem::Version
94
- version: 7.1.0
106
+ version: 7.2.1
95
107
  - !ruby/object:Gem::Dependency
96
108
  name: thor
97
109
  requirement: !ruby/object:Gem::Requirement
@@ -438,16 +450,16 @@ dependencies:
438
450
  name: sqlite3
439
451
  requirement: !ruby/object:Gem::Requirement
440
452
  requirements:
441
- - - ">="
453
+ - - "~>"
442
454
  - !ruby/object:Gem::Version
443
- version: '0'
455
+ version: '1.4'
444
456
  type: :development
445
457
  prerelease: false
446
458
  version_requirements: !ruby/object:Gem::Requirement
447
459
  requirements:
448
- - - ">="
460
+ - - "~>"
449
461
  - !ruby/object:Gem::Version
450
- version: '0'
462
+ version: '1.4'
451
463
  description: The push notification service for Ruby.
452
464
  email:
453
465
  - port001@gmail.com
@@ -778,7 +790,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
778
790
  - !ruby/object:Gem::Version
779
791
  version: '0'
780
792
  requirements: []
781
- rubygems_version: 3.3.3
793
+ rubygems_version: 3.4.19
782
794
  signing_key:
783
795
  specification_version: 4
784
796
  summary: The push notification service for Ruby.