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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d6f7c97e0686c9df19b325d26045a5f03778150
4
- data.tar.gz: f376083ac33fe4e4e9939e78ab6a5ca1a266c155
3
+ metadata.gz: 9a960038aa136a867b8e7bcd6d4b2db748a351ba
4
+ data.tar.gz: 0f03c20cc3f899f5efe5f2ccaefb4c61632b5286
5
5
  SHA512:
6
- metadata.gz: c79af147476ad3e19d1593c54736c907894c1faf3006abb3ed8a3920bf0bb2d5e914f03204d0a9c4abedbbee36a1519c266bafc2cb051487987011e9aca57e44
7
- data.tar.gz: 2117913e0dc1b6d914d6122d3448c979a828b67da6e5fd6764a48f9ed3a3d24c3577ba5e338522a3645d8af2dcefb0f5bad7858d411bbeaf355bf99d2e2e0965
6
+ metadata.gz: 4883d1a59c4e849eb227429c737a2e751e8deda7b4f8b3ddebebc85e49aed4adf0b2842ffe4b290ee6e4b902c01e7b29a08812a8c3a3dbfea873db3171de28c9
7
+ data.tar.gz: 5d2c09ab9c34d65a941a31a08a30c978177dd3ff9ae874886759f2694d1f6b02a59382eb7bf0b2487713b53fa3ca351e15ef7ea309db68d134f07f56677db0a7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- notifiable-gcm-spacialdb (0.10.0)
4
+ notifiable-gcm-spacialdb (0.10.1)
5
5
  gcm (~> 0.1.1)
6
6
  notifiable-rails (>= 0.26.3)
7
7
 
@@ -35,7 +35,10 @@ module Notifiable
35
35
  def send_batch(notification)
36
36
  gcm = ::GCM.new(@api_key)
37
37
 
38
- data = {:message => notification.message}.merge(notification.send_params)
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
@@ -1,7 +1,7 @@
1
1
  module Notifiable
2
2
  module Gcm
3
3
  module Spacialdb
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.1"
5
5
  end
6
6
  end
7
7
  end
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(:request_body) { "{\"registration_ids\":[\"ABC123\"],\"data\":{\"message\":\"Test message\",\"flag\":true,\"n_id\":1}}" }
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.0
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-21 00:00:00.000000000 Z
12
+ date: 2018-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: notifiable-rails