multitenant_push 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/multitenant_push/apns.rb +4 -3
- data/lib/multitenant_push/gcm.rb +3 -2
- data/lib/multitenant_push/version.rb +1 -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: 55712d3f4d9b4fbd71a79e8dfd0699e2780b828a
|
|
4
|
+
data.tar.gz: b009c122845f8dfd4f41080b226dafbce9c1789a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6100d74c2e3400f32c5b157cfde9eb389dc0724392f58f8d3fe367eed332b5246cde4a2a6e0e6ef7a85ee199f6d3a2ca43d59e56e7d6ed686550a1fcf6afbcec
|
|
7
|
+
data.tar.gz: 980da3b9adaea7a18ceeeb2bf95828bee3cfe7fd3aeb8da25d65d5299f2308de4f4b5ba141936e73c5313cbc3290cffbbf0a606bef65819a893e20d47e570a69
|
|
@@ -3,6 +3,7 @@ APNS2 = APNS.clone
|
|
|
3
3
|
|
|
4
4
|
module MultitenantPush
|
|
5
5
|
module APNS
|
|
6
|
+
include APNS2
|
|
6
7
|
|
|
7
8
|
def self.send_notification(device_token, message)
|
|
8
9
|
self.load_credentials()
|
|
@@ -11,7 +12,7 @@ module MultitenantPush
|
|
|
11
12
|
|
|
12
13
|
def self.send_notifications(notifications)
|
|
13
14
|
self.load_credentials()
|
|
14
|
-
APNS2.
|
|
15
|
+
APNS2.send_notifications(notifications)
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def self.feedback
|
|
@@ -29,9 +30,9 @@ module MultitenantPush
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
def self.load_credentials
|
|
32
|
-
raise
|
|
33
|
+
raise NoTenant if Tenant.current_tenant.nil?
|
|
33
34
|
credentials = Credential.first
|
|
34
|
-
raise
|
|
35
|
+
raise NoTenantCredentials if credentials.nil? || credentials.apns_host.blank? || credentials.apns_pass.blank?
|
|
35
36
|
|
|
36
37
|
APNS.host = credentials.apns_host
|
|
37
38
|
APNS.pass = credentials.apns_pass
|
data/lib/multitenant_push/gcm.rb
CHANGED
|
@@ -3,6 +3,7 @@ GCM2 = GCM.clone
|
|
|
3
3
|
|
|
4
4
|
module MultitenantPush
|
|
5
5
|
module GCM
|
|
6
|
+
include GCM2
|
|
6
7
|
|
|
7
8
|
def self.send_notification( device_tokens, data)
|
|
8
9
|
self.load_credentials()
|
|
@@ -19,9 +20,9 @@ module MultitenantPush
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
def self.load_credentials
|
|
22
|
-
raise
|
|
23
|
+
raise NoTenant if Tenant.current_tenant.nil?
|
|
23
24
|
credentials = Credential.first
|
|
24
|
-
raise
|
|
25
|
+
raise NoTenantCredentials if credentials.nil? || credentials.gcm_host.blank? || credentials.gcm_key.blank?
|
|
25
26
|
|
|
26
27
|
GCM.host = credentials.gcm_host
|
|
27
28
|
GCM.pass = credentials.gcm_key
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: multitenant_push
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 2point0 Concepts
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-11-
|
|
12
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|