fcm 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 669cf627dbb2e11a30f9f928779e57b6bc286a810b81e86c7195bfbf8d4ecbb8
4
- data.tar.gz: fe47f7b32e14cde7bf0c4cf60543fc8c25a5e9864c7f99d24d52bfd18a4ea8f0
3
+ metadata.gz: 2e620131ea8e4a53c7a3927da1c48f4893fbeffbbcce88c9306a41614c3e5768
4
+ data.tar.gz: 9dae9eb3980e57fe84344afb22f68b29d874dbde580dc28ccd6cf3028cc9e16a
5
5
  SHA512:
6
- metadata.gz: 79460ba0dbb3d745694ed028dccb56d73f83f657b920faf840bf86a2d827b33f14a6b45586ddfa7f1d9ef94781e2a4fd1c36bf16e666ce4098545dc339026084
7
- data.tar.gz: 7cb6107df0467f1c6b9a10bf8b09709bee93a8c47fd5896a6e2858fa34539cbe924503d1a4271f72cec3b223c53fde15cff0bfc2171a219d188cf55896043178
6
+ metadata.gz: 63ee034d8813fce59b32673c846b1c86d4dddfc3b1136caa3e6d25fdcc0ca2dc00bfc7a8aa6ef4871bdcfd66790bbf28321c70312171ae994463aac2ce18b6e8
7
+ data.tar.gz: 45886b059e48c8497767a2747842178ae2db282a0dde6438cc67fedc54c5264de2f0707c52863dd5015bc0389e0fdc93c23ca8268238210809299fe29d834364
data/.gitignore CHANGED
@@ -48,4 +48,4 @@ specifications
48
48
  Gemfile.lock
49
49
  .rvmrc
50
50
  spec/reports
51
- *.gem
51
+ *.gem
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Firebase Cloud Messaging (FCM) for Android and iOS
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/fcm.svg)](http://badge.fury.io/rb/fcm) [![Build Status](https://secure.travis-ci.org/spacialdb/fcm.png?branch=master)](http://travis-ci.org/spacialdb/fcm)
3
+ [![Gem Version](https://badge.fury.io/rb/fcm.svg)](http://badge.fury.io/rb/fcm) [![Build Status](https://secure.travis-ci.org/spacialdb/fcm.svg?branch=master)](http://travis-ci.org/spacialdb/fcm)
4
4
 
5
5
  The FCM gem lets your ruby backend send notifications to Android and iOS devices via [
6
6
  Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/).
@@ -101,14 +101,14 @@ FCM [topic messaging](https://firebase.google.com/docs/cloud-messaging/topic-mes
101
101
 
102
102
  ```ruby
103
103
  response = fcm.send_with_notification_key("/topics/yourTopic",
104
- data: {message: "This is a FCM Topic Message!"})
104
+ notification: {body: "This is a FCM Topic Message!"})
105
105
  ```
106
106
 
107
107
  Or you can use the helper:
108
108
 
109
109
  ```ruby
110
110
  response = fcm.send_to_topic("yourTopic",
111
- data: {message: "This is a FCM Topic Message!"})
111
+ notification: {body: "This is a FCM Topic Message!"})
112
112
  ```
113
113
 
114
114
  ### Sending to Multiple Topics
@@ -137,8 +137,8 @@ The `send_to_topic_condition` method within this library allows you to specicy a
137
137
  ```ruby
138
138
  response = fcm.send_to_topic_condition(
139
139
  "'TopicA' in topics && ('TopicB' in topics || 'TopicC' in topics)",
140
- data: {
141
- message: "This is an FCM Topic Message sent to a condition!"
140
+ notification: {
141
+ body: "This is an FCM Topic Message sent to a condition!"
142
142
  }
143
143
  )
144
144
  ```
@@ -170,6 +170,9 @@ You can find a guide to implement an Android Client app to receive notifications
170
170
  The guide to set up an iOS app to get notifications is here: [Setting up a FCM Client App on iOS](https://firebase.google.com/docs/cloud-messaging/ios/client).
171
171
 
172
172
  ## ChangeLog
173
+ ### 1.0.2
174
+
175
+ - Bug fix: retrieve notification key" params: https://github.com/spacialdb/fcm/commit/b328a75c11d779a06d0ceda83527e26aa0495774
173
176
 
174
177
  ### 1.0.0
175
178
 
@@ -197,8 +200,15 @@ The guide to set up an iOS app to get notifications is here: [Setting up a FCM C
197
200
 
198
201
  - [Contributors](https://github.com/spacialdb/fcm/contributors)
199
202
 
200
- ## Donations
203
+ ## Cutting a release
201
204
 
202
- We accept tips through [Gratipay](https://gratipay.com/spacialdb/).
205
+ Update version in `fcm.gemspec` with `VERSION` and update `README.md` `## ChangeLog` section.
203
206
 
204
- [![Gratipay](https://img.shields.io/gratipay/spacialdb.svg)](https://www.gittip.com/spacialdb/)
207
+ ```bash
208
+ # set the version
209
+ # VERSION="1.0.2"
210
+ gem build fcm.gemspec
211
+ gem push fcm-${VERSION}.gem
212
+ git tag -a v${VERSION} -m "Releasing version v${VERSION}"
213
+ git push origin --tags
214
+ ```
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fcm"
6
- s.version = "1.0.1"
6
+ s.version = "1.0.2"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Kashif Rasul", "Shoaib Burq"]
9
9
  s.email = ["kashif@spacialdb.com", "shoaib@spacialdb.com"]
data/lib/fcm.rb CHANGED
@@ -89,11 +89,7 @@ class FCM
89
89
  alias remove remove_registration_ids
90
90
 
91
91
  def recover_notification_key(key_name, project_id)
92
- params = {
93
- query: {
94
- notification_key_name: key_name
95
- }
96
- }
92
+ params = {notification_key_name: key_name}
97
93
 
98
94
  extra_headers = {
99
95
  'project_id' => project_id
@@ -472,6 +472,25 @@ describe FCM do
472
472
  end # remove context
473
473
  end
474
474
 
475
+ describe "#recover_notification_key" do
476
+ it "sends a 'retrieve notification key' request" do
477
+ uri = "#{FCM::GROUP_NOTIFICATION_BASE_URI}/gcm/notification"
478
+ endpoint = stub_request(:get, uri).with(
479
+ headers: {
480
+ 'Content-Type' => 'application/json',
481
+ 'Authorization' => "key=TEST_SERVER_KEY",
482
+ 'project_id' => "TEST_PROJECT_ID"
483
+ },
484
+ query: {notification_key_name: "TEST_KEY_NAME"}
485
+ )
486
+ client = FCM.new("TEST_SERVER_KEY")
487
+
488
+ client.recover_notification_key("TEST_KEY_NAME", "TEST_PROJECT_ID")
489
+
490
+ expect(endpoint).to have_been_requested
491
+ end
492
+ end
493
+
475
494
  describe 'subscribing to a topic' do
476
495
  # TODO
477
496
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kashif Rasul
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-05-16 00:00:00.000000000 Z
12
+ date: 2020-07-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday