notifiable-gcm-spacialdb 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/notifiable/gcm/spacialdb/batch.rb +4 -1
- data/lib/notifiable/gcm/spacialdb/version.rb +1 -1
- data/spec/batch_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a960038aa136a867b8e7bcd6d4b2db748a351ba
|
4
|
+
data.tar.gz: 0f03c20cc3f899f5efe5f2ccaefb4c61632b5286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4883d1a59c4e849eb227429c737a2e751e8deda7b4f8b3ddebebc85e49aed4adf0b2842ffe4b290ee6e4b902c01e7b29a08812a8c3a3dbfea873db3171de28c9
|
7
|
+
data.tar.gz: 5d2c09ab9c34d65a941a31a08a30c978177dd3ff9ae874886759f2694d1f6b02a59382eb7bf0b2487713b53fa3ca351e15ef7ea309db68d134f07f56677db0a7
|
data/Gemfile.lock
CHANGED
@@ -35,7 +35,10 @@ module Notifiable
|
|
35
35
|
def send_batch(notification)
|
36
36
|
gcm = ::GCM.new(@api_key)
|
37
37
|
|
38
|
-
|
38
|
+
|
39
|
+
data = {message: notification.message}
|
40
|
+
data[:title] = notification.title if notification.title
|
41
|
+
data = data.merge(notification.send_params)
|
39
42
|
response = gcm.send_notification(batch.collect{|dt| dt.token}, {:data => data})
|
40
43
|
|
41
44
|
if response[:status_code] == 200
|
data/spec/batch_spec.rb
CHANGED
@@ -14,7 +14,8 @@ describe Notifiable::Gcm::Spacialdb::Batch do
|
|
14
14
|
before(:each) { n1.batch {|n| n.add_device_token(d)} }
|
15
15
|
|
16
16
|
context 'single' do
|
17
|
-
let(:
|
17
|
+
let(:n1) { Notifiable::Notification.create(app: a, title: 'Test title', message: 'Test message', parameters: {flag: true} ) }
|
18
|
+
let(:request_body) { "{\"registration_ids\":[\"ABC123\"],\"data\":{\"message\":\"Test message\",\"title\":\"Test title\",\"flag\":true,\"n_id\":1}}" }
|
18
19
|
let(:response_body) { '{ "multicast_id": 108, "success": 1, "failure": 0, "canonical_ids": 0, "results": [{ "message_id": "1:08" }]}' }
|
19
20
|
it { expect(Notifiable::NotificationStatus.count).to eq 1 }
|
20
21
|
it { expect(Notifiable::NotificationStatus.first.status).to eq 0 }
|
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.10.
|
4
|
+
version: 0.10.1
|
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: 2018-03-
|
12
|
+
date: 2018-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: notifiable-rails
|