firebase_cloud_messenger 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74910a0ee8fc543d5edda086ffaf69d1f2489cf0
4
- data.tar.gz: 4a2a12028f268df3bfb363a113753ba74787c2f0
3
+ metadata.gz: f2731e80fb8627396036238f8744658dbdc7ee44
4
+ data.tar.gz: 1a2ce30d4a7bd3860452254ce976a0ec7d381414
5
5
  SHA512:
6
- metadata.gz: a3df9e78b176f6f3bbfdeca29949c65cdadc633dd899c49d40ac0ebb82de5d306fa27d2649fea424281c7faf66a02351bd6dfdeb652cc2c68de9f361b9662a96
7
- data.tar.gz: 137405c04183e8b60b6eceecd4ca3f1e4d9b74e537b7ac38804b5892ba595c553b05063667d44e4dfd1e00fcbcdd8a3959ed3a4e2c9adb45829cfd58bb429178
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::AndroidConfig.new(notification: android_notification)
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::AndroidConfig.new
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
 
@@ -1,6 +1,7 @@
1
1
  module FirebaseCloudMessenger
2
2
  class FirebaseObject
3
3
  def initialize(data, fields)
4
+ data = data.dup
4
5
  @fields = fields
5
6
 
6
7
  fields.each do |field|
@@ -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
  },
@@ -1,3 +1,3 @@
1
1
  module FirebaseCloudMessenger
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
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.3.1
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-23 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: googleauth