frm_mercury 0.1.3 → 0.1.8

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: d4671c387d55b1c6bb1f1ac3caf698b94118ed321d1114712d94829db1b0fc20
4
- data.tar.gz: 0bdca1141eeade80ef8e8d62447382c1366c8b108c3b7cb18d5ede8f070e5532
3
+ metadata.gz: 7e478a53395767037a96515124e996ea605cf443364a5b32c6ca91a45303a4a6
4
+ data.tar.gz: dda01e75667d96b47da12be6d62d9374ed7899882bb457d79aafad9574384877
5
5
  SHA512:
6
- metadata.gz: e4d5fcb2ae12289a395fbeeaa25fb1243525f4df70f821435dee5797ac820e792c41d7acc227d8ff7b21b0e7a135f9b53a31e8f159bf30e72e5c9cfc71ae3a09
7
- data.tar.gz: f1da372b130d70566249437c3e7208388abf25f207be872208b052ae7d1fb94da54e6a8a5fffc16a288f87c9c7fae05f19f4bcd054409017df15c6a38dd6e283
6
+ metadata.gz: fb091e15a0fb1d53c245d2a43925fc24ffbcbe5e600b6f0c5f286f6edd15fc61fdac9a7e9bc5541b3d90d63565673ac44c7c0ee2d078f1b9d4142aba73854ad9
7
+ data.tar.gz: 20ad2d8a23304c206386b1db627725189380f51f3e0dd35aa104eaaff24bad8cb578a64e932c133c9a50bf448af8d6e52a18b51cf8a8f864473b90e6b5858101
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ frm_mercury (0.1.3)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.4.2)
10
+
11
+ PLATFORMS
12
+ ruby
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 2.0)
16
+ frm_mercury!
17
+ rake (~> 10.0)
18
+
19
+ BUNDLED WITH
20
+ 2.0.1
data/README.md CHANGED
@@ -22,7 +22,19 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ First create an frm_mercury.rb in yours config/initializers
26
+
27
+ ```ruby
28
+ require 'frm_mercury'
29
+ FrmMercury.configure do |config|
30
+ config.api_key = "Your Api Key From Firebase console"
31
+ end
32
+ ```
33
+
34
+ Then to send a message...
35
+ ```ruby
36
+ FrmMercury::Sender.send("Device FCM token as String or many tokens as Array", "Some title", "Some body message", "sound.mp3 (Leave empty for default)", "Hash in case you want to send extra info (optional)")
37
+ ```
26
38
 
27
39
  ## Development
28
40
 
@@ -8,14 +8,22 @@ module FrmMercury
8
8
  require 'net/https'
9
9
  require 'json'
10
10
 
11
+ key = to.kind_of?(Array) ? "registration_ids" : "to"
12
+
11
13
  params = {
12
- "to": to,
14
+ "#{key}": to,
13
15
  "notification": {
14
16
  "title": title.nil? ? "Testing notification" : title,
15
17
  "body": body.nil? ? "This is a test push notification, liking it?" : body,
16
18
  "mutable_content": true,
17
19
  "sound": sound.nil? ? "enabled" : sound
18
20
  },
21
+ "android": {
22
+ "ttl": "86400s",
23
+ "notification": {
24
+ "click_action": "MAIN_ACTIVITY"
25
+ }
26
+ },
19
27
  "data": data
20
28
  }.to_json
21
29
 
@@ -26,6 +34,7 @@ module FrmMercury
26
34
  req.body = params
27
35
  res = https.request(req)
28
36
  puts "Response #{res.code} #{res.message}: #{res.body}"
37
+ return "Response #{res.code} #{res.message}: #{res.body}"
29
38
  end
30
39
  end
31
40
  end
@@ -1,3 +1,3 @@
1
1
  module FrmMercury
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frm_mercury
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - DEVPENGUIN
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2020-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -48,6 +48,7 @@ files:
48
48
  - ".gitignore"
49
49
  - CODE_OF_CONDUCT.md
50
50
  - Gemfile
51
+ - Gemfile.lock
51
52
  - LICENSE.txt
52
53
  - README.md
53
54
  - Rakefile