snm-fcm 0.1.2 → 0.1.3

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: 3f318677c9145ea5f38ef89b8f7f2aef8a250a4142ef9b9cec6dfa3b7fbd5538
4
- data.tar.gz: 8fa111b44446f8d77856aa4ed0c8b555f6316ecec5206b945462e916f342d2d0
3
+ metadata.gz: d84858414150e1f38a1feb48aaa131fc59d282b26669830adadbec5fc89493e9
4
+ data.tar.gz: 957bdb675a7540a9a38fc036186edf73e6c1ce0885e7c712c490adf35c783c2e
5
5
  SHA512:
6
- metadata.gz: ead80d7616c95a5e4ba70516ec6f46444841ef25d3b33ffc66ccc6aff62d50c489a598ca998afde63a818558f6d170164a488b8d7e247b97311145ed0405e69c
7
- data.tar.gz: 0f2c18f67d83b1305caa8648d771d9b404b4fa0116ab16fb47fcc54b13c32cc60f39e962357f72bea82b577f67f23b72513f1db32b27e4ced57cde5fd0176298
6
+ metadata.gz: a8facdd1a526d7da68a514bf912ef2cf908c9b53cc58a8bfe6fa2d00c77adf780562ff4541fc1b6ede76904a00c66a302fb583125c9b7f2809c0aab5714ebaae
7
+ data.tar.gz: a8685c4b424486b78aa754c19bf57089cbac98650f4791ddde635060e1c81228ec635f387fa52db93f8029f85991bfea718efd9cd520024ad75c103ce3262318
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Snm
4
4
  module Fcm
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/snm/fcm.rb CHANGED
@@ -18,13 +18,14 @@ module Snm
18
18
  @configuration ||= Configuration.new
19
19
  end
20
20
 
21
- def self.config(&block)
22
- @configuration = yield(configuration)
21
+ def self.setup(&block)
22
+ yield(configuration)
23
23
  end
24
24
 
25
25
  def self.deliver data={}
26
- raise 'Data is missing' if not data.present?
27
- HTTP.headers('Content-Type: application/json', "Authorization: Bearer #{get_access_token}").post("https://fcm.googleapis.com/v1/projects/#{Notification.configuration.project_id}/messages:send", json: data)
26
+ raise 'Data is missing' if data.nil?
27
+
28
+ HTTP.headers("Content-Type"=> "application/json", "Authorization"=> "Bearer #{get_access_token}").post("https://fcm.googleapis.com/v1/projects/#{Notification.configuration.project_id}/messages:send", json: data)
28
29
  end
29
30
 
30
31
  def self.get_access_token
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snm-fcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - snmmaurya