firebase_cloud_messenger 0.3.1 → 0.4.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 +6 -0
- data/README.md +5 -5
- data/lib/firebase_cloud_messenger/apns/aps_dictionary.rb +1 -1
- data/lib/firebase_cloud_messenger/firebase_object.rb +1 -0
- data/lib/firebase_cloud_messenger/schema.rb +1 -0
- data/lib/firebase_cloud_messenger/version.rb +1 -1
- 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: f2731e80fb8627396036238f8744658dbdc7ee44
|
|
4
|
+
data.tar.gz: 1a2ce30d4a7bd3860452254ce976a0ec7d381414
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 002f306c18d749ae32177eef766672c6bb78283287fd6e89f03c42d274a78a64ac8feceabd7fffb6e1461e282a98905a940bd5ee0b8c84659337df061ea8a20e
|
|
7
|
+
data.tar.gz: 4cad82f1e561f52f83796341d5097ee932cb7b9d14bc60739d276fa425047e0a9b7b657e972a6bb3219c6a7efbea486cae36bd7584a97a8ba1fc8ae9ecb14b8b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## Version 0.4.0 - April 30, 2018
|
|
2
|
+
* Adds support for rich notifications in iOS by allowing the mutable-content aps dict key
|
|
3
|
+
* Fixes bug that mutated the hash argument `::new` in subclasses of `FirebaseObject`
|
|
4
|
+
* Readme fixes
|
|
5
|
+
* Big thanks to @freestyl3r for all the patches in this release!
|
|
6
|
+
|
|
1
7
|
## Version 0.3.1 - April 23, 2018
|
|
2
8
|
* Fixes APNS message structure
|
|
3
9
|
* Improves format of error messaging for easier debugging
|
data/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Send messages with built-in data objects, which can be built through a hash argu
|
|
|
66
66
|
initializer or via writer methods:
|
|
67
67
|
```ruby
|
|
68
68
|
android_notification = FirebaseCloudMessenger::Android::Notification.new(title: "title")
|
|
69
|
-
android_config = FirebaseCloudMessenger::Android::
|
|
69
|
+
android_config = FirebaseCloudMessenger::Android::Config.new(notification: android_notification)
|
|
70
70
|
message = FirebaseCloudMessenger::Message.new(android: android_config, token "a_device_token")
|
|
71
71
|
|
|
72
72
|
FirebaseCloudMessenger.send(message: message) # => { "name" => "name_from_fcm" }
|
|
@@ -76,7 +76,7 @@ FirebaseCloudMessenger.send(message: message) # => { "name" => "name_from_fcm" }
|
|
|
76
76
|
android_notification = FirebaseCloudMessenger::Android::Notification.new
|
|
77
77
|
android_notification.title = "title"
|
|
78
78
|
|
|
79
|
-
android_config = FirebaseCloudMessenger::Android::
|
|
79
|
+
android_config = FirebaseCloudMessenger::Android::Config.new
|
|
80
80
|
android_config.notification = android_notification
|
|
81
81
|
|
|
82
82
|
message = FirebaseCloudMessenger::Message.new
|
|
@@ -130,14 +130,14 @@ Many errors can be caught before sending by validating a message before sending
|
|
|
130
130
|
|
|
131
131
|
Validate your message either by via the Firebase Cloud Messenger API:
|
|
132
132
|
```ruby
|
|
133
|
-
message = FirebaseCloudMessenger.new(android: { bad: "data" })
|
|
133
|
+
message = FirebaseCloudMessenger::Message.new(android: { bad: "data" })
|
|
134
134
|
message.valid?(against_api: true) # => false
|
|
135
135
|
message.errors # => [<error_msg>]
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
or client-side, via json-schema:
|
|
139
139
|
```ruby
|
|
140
|
-
message = FirebaseCloudMessenger.new(android: { bad: "data" }, token: "a_device_token")
|
|
140
|
+
message = FirebaseCloudMessenger::Message.new(android: { bad: "data" }, token: "a_device_token")
|
|
141
141
|
message.valid? # => false
|
|
142
142
|
message.errors # => ["The property '#/android' contains additional properties [\"bad\"] outside of the schema when none are allowed in schema..."]
|
|
143
143
|
```
|
|
@@ -162,4 +162,4 @@ FirebaseCloudMessenger.validate_message(message) # => false
|
|
|
162
162
|
|
|
163
163
|
## Development
|
|
164
164
|
|
|
165
|
-
After checking out the repo, run `bundle` to install dependencies. Then, run `rake test` to run the tests.
|
|
165
|
+
After checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rake test` to run the tests.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module FirebaseCloudMessenger
|
|
2
2
|
module Apns
|
|
3
3
|
class ApsDictionary < ApnsObject
|
|
4
|
-
FIELDS = %i(alert badge sound content_available category thread_id).freeze
|
|
4
|
+
FIELDS = %i(alert badge sound content_available mutable_content category thread_id).freeze
|
|
5
5
|
|
|
6
6
|
attr_accessor(*FIELDS)
|
|
7
7
|
|
|
@@ -100,6 +100,7 @@ module FirebaseCloudMessenger
|
|
|
100
100
|
"badge" => { "type" => "number" },
|
|
101
101
|
"sound" => { "type" => "string" },
|
|
102
102
|
"content-available" => { "type" => "number" },
|
|
103
|
+
"mutable-content" => { "type" => "number" },
|
|
103
104
|
"category" => { "type" => "string" },
|
|
104
105
|
"thread-id" => { "type" => "string" }
|
|
105
106
|
},
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: firebase_cloud_messenger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vince DeVendra
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-04-
|
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: googleauth
|