notifiable-gcm-spacialdb 0.2.1 → 0.3.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 +3 -3
- data/lib/notifiable/gcm/spacialdb/batch.rb +2 -9
- data/lib/notifiable/gcm/spacialdb/version.rb +1 -1
- data/notifiable-gcm-spacialdb.gemspec +1 -1
- data/spec/batch_spec.rb +1 -1
- data/spec/support/db/migrate/20131228225140_create_notifiable_notifications.rb +5 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbadae0496bbab84f8a76618625960a25be7dbb3
|
4
|
+
data.tar.gz: c2f306749eef535c197833ca4cdad5af77594626
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f402938709e58d0ccf7f42de43670be72cb301cbfbf08e85fc40005c9df4bd36df0e1eedd2f045141778cec61d9081f2361c183ced3579992078abc58624506d
|
7
|
+
data.tar.gz: db538b2b842a4138cae235610ac567bb7a3d7cc9735539a54db46cbfdbe8fcd8e7ca8e565a636ac563400c83ae324bcc509e97b2ef7e3e12882392a589a22faf
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
notifiable-gcm-spacialdb (0.
|
4
|
+
notifiable-gcm-spacialdb (0.3.0)
|
5
5
|
gcm (~> 0.0.6)
|
6
|
-
notifiable-rails (>= 0.
|
6
|
+
notifiable-rails (>= 0.5.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
minitest (4.7.5)
|
59
59
|
multi_json (1.8.4)
|
60
60
|
multi_xml (0.5.5)
|
61
|
-
notifiable-rails (0.
|
61
|
+
notifiable-rails (0.5.0)
|
62
62
|
rails (~> 4.0.0)
|
63
63
|
polyglot (0.3.3)
|
64
64
|
rack (1.5.2)
|
@@ -40,15 +40,8 @@ module Notifiable
|
|
40
40
|
else
|
41
41
|
gcm = ::GCM.new(self.api_key)
|
42
42
|
|
43
|
-
data = {}
|
44
|
-
|
45
|
-
# message
|
46
|
-
message = notification.provider_value(device_tokens.first.provider, :message)
|
47
|
-
data[:message] = message if message
|
48
|
-
|
49
|
-
# custom attributes
|
50
|
-
custom_attributes = notification.provider_value(device_tokens.first.provider, :data)
|
51
|
-
data.merge! custom_attributes if custom_attributes
|
43
|
+
data = {:message => notification.message}
|
44
|
+
data.merge! notification.params if notification.params
|
52
45
|
|
53
46
|
# send
|
54
47
|
response = gcm.send_notification(device_tokens.collect{|dt| dt.token}, {:data => data})
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "notifiable-rails", ">=0.
|
21
|
+
spec.add_dependency "notifiable-rails", ">=0.5.0"
|
22
22
|
spec.add_dependency "gcm", "~> 0.0.6"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
data/spec/batch_spec.rb
CHANGED
@@ -17,7 +17,7 @@ describe Notifiable::Gcm::Spacialdb::Batch do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
it "sends custom attributes" do
|
20
|
-
n.update_attribute(:
|
20
|
+
n.update_attribute(:params, {:custom_id => 123456})
|
21
21
|
|
22
22
|
stub_request(:post, "https://android.googleapis.com/gcm/send")
|
23
23
|
.with(:body => {:registration_ids => ["ABC123"], :data => {:message => n.message, :custom_id => 123456}})
|
@@ -2,10 +2,13 @@ class CreateNotifiableNotifications < ActiveRecord::Migration
|
|
2
2
|
|
3
3
|
def change
|
4
4
|
create_table :notifiable_notifications do |t|
|
5
|
+
t.text :title
|
5
6
|
t.text :message
|
6
|
-
t.text :
|
7
|
+
t.text :params
|
8
|
+
t.integer :badge
|
9
|
+
t.text :sound
|
10
|
+
t.datetime :expiry
|
7
11
|
t.timestamps
|
8
12
|
end
|
9
13
|
end
|
10
|
-
|
11
14
|
end
|
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.3.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: 2014-02-
|
12
|
+
date: 2014-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: notifiable-rails
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.5.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.5.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: gcm
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|