notifiable-gcm-spacialdb 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +19 -17
- data/lib/notifiable/gcm/spacialdb/batch.rb +3 -3
- data/lib/notifiable/gcm/spacialdb/version.rb +1 -1
- data/notifiable-gcm-spacialdb.gemspec +1 -1
- data/spec/batch_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fee435aa04037ff6e150a5d16636951bbfe80eb5
|
4
|
+
data.tar.gz: 0c998785748490f5d6e6b5b4ae1e307e86b4b12b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bb112c3bb7ec6eccddde5a24c389c6842c5197fa703e975933bdd9e326c3369c8f438379d498f3282ebe3e714bc18fe9404f00ce52c73400580b114b18136d3
|
7
|
+
data.tar.gz: a4f93815a9908e32312cb84ecc1c4dd015c08a1f2203be37e72f86023f2e591c6a5111e638641cb11a83f4bee40ec9e85bc073172c92ffb50ce510cb5f975ba9
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
notifiable-gcm-spacialdb (0.
|
5
|
-
|
4
|
+
notifiable-gcm-spacialdb (0.13.0)
|
5
|
+
fcm (~> 0.0.6)
|
6
6
|
notifiable-core (>= 0.2.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (5.2.
|
12
|
-
activesupport (= 5.2.
|
13
|
-
activerecord (5.2.
|
14
|
-
activemodel (= 5.2.
|
15
|
-
activesupport (= 5.2.
|
11
|
+
activemodel (5.2.3)
|
12
|
+
activesupport (= 5.2.3)
|
13
|
+
activerecord (5.2.3)
|
14
|
+
activemodel (= 5.2.3)
|
15
|
+
activesupport (= 5.2.3)
|
16
16
|
arel (>= 9.0)
|
17
|
-
activerecord-import (0.
|
17
|
+
activerecord-import (1.0.1)
|
18
18
|
activerecord (>= 3.2)
|
19
|
-
activesupport (5.2.
|
19
|
+
activesupport (5.2.3)
|
20
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
21
|
i18n (>= 0.7, < 2)
|
22
22
|
minitest (~> 5.1)
|
@@ -25,24 +25,26 @@ GEM
|
|
25
25
|
public_suffix (>= 2.0.2, < 4.0)
|
26
26
|
arel (9.0.0)
|
27
27
|
byebug (10.0.1)
|
28
|
-
concurrent-ruby (1.
|
28
|
+
concurrent-ruby (1.1.5)
|
29
29
|
crack (0.4.3)
|
30
30
|
safe_yaml (~> 1.0.0)
|
31
31
|
database_cleaner (1.2.0)
|
32
32
|
diff-lcs (1.3)
|
33
33
|
docile (1.1.5)
|
34
|
-
|
35
|
-
httparty
|
36
|
-
|
37
|
-
|
34
|
+
fcm (0.0.6)
|
35
|
+
httparty (~> 0.10, >= 0.10.0)
|
36
|
+
httparty (0.16.4)
|
37
|
+
mime-types (~> 3.0)
|
38
38
|
multi_xml (>= 0.5.2)
|
39
|
-
i18n (1.
|
39
|
+
i18n (1.6.0)
|
40
40
|
concurrent-ruby (~> 1.0)
|
41
|
-
|
41
|
+
mime-types (3.2.2)
|
42
|
+
mime-types-data (~> 3.2015)
|
43
|
+
mime-types-data (3.2019.0331)
|
42
44
|
minitest (5.11.3)
|
43
45
|
multi_json (1.13.1)
|
44
46
|
multi_xml (0.6.0)
|
45
|
-
notifiable-core (0.
|
47
|
+
notifiable-core (0.3.6)
|
46
48
|
activerecord
|
47
49
|
activerecord-import
|
48
50
|
pg (1.0.0)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'notifiable'
|
2
|
-
require '
|
2
|
+
require 'fcm'
|
3
3
|
|
4
4
|
module Notifiable
|
5
5
|
module Gcm
|
@@ -33,13 +33,13 @@ module Notifiable
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def send_batch(notification)
|
36
|
-
|
36
|
+
fcm = ::FCM.new(@api_key)
|
37
37
|
|
38
38
|
|
39
39
|
data = {message: notification.message}
|
40
40
|
data[:title] = notification.title if notification.title
|
41
41
|
data = data.merge(notification.send_params)
|
42
|
-
response =
|
42
|
+
response = fcm.send(batch.collect{|dt| dt.token}, {:data => data})
|
43
43
|
|
44
44
|
if response[:status_code] == 200
|
45
45
|
process_success_response(response)
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "notifiable-core", ">= 0.2.0"
|
22
|
-
spec.add_dependency "
|
22
|
+
spec.add_dependency "fcm", '~> 0.0.6'
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.1.1"
|
data/spec/batch_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Notifiable::Gcm::Spacialdb::Batch do
|
|
6
6
|
let(:a) { Notifiable::App.create gcm_api_key: 'abc123', configuration: app_configuration }
|
7
7
|
let(:n1) { Notifiable::Notification.create(app: a, message: 'Test message', parameters: {flag: true} ) }
|
8
8
|
let(:d) { Notifiable::DeviceToken.create(:token => "ABC123", :provider => :gcm, :app => a, :locale => 'en') }
|
9
|
-
let!(:stubbed_request) { stub_request(:post, "https://
|
9
|
+
let!(:stubbed_request) { stub_request(:post, "https://fcm.googleapis.com/fcm/send").with(body: request_body).to_return(body: response_body) }
|
10
10
|
let(:request_body) { }
|
11
11
|
let(:response_body) { }
|
12
12
|
|
@@ -47,7 +47,7 @@ describe Notifiable::Gcm::Spacialdb::Batch do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
context 'bad key' do
|
50
|
-
let!(:stubbed_request) { stub_request(:post, "https://
|
50
|
+
let!(:stubbed_request) { stub_request(:post, "https://fcm.googleapis.com/fcm/send").to_return(body: '<html>Message</html>', status: 401) }
|
51
51
|
it { expect(Notifiable::NotificationStatus.count).to eq 0 }
|
52
52
|
end
|
53
53
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifiable-gcm-spacialdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kamil Kocemba
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: notifiable-core
|
@@ -26,19 +26,19 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.2.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: fcm
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 0.
|
34
|
+
version: 0.0.6
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 0.
|
41
|
+
version: 0.0.6
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: bundler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|