fwt_push_notification_server 0.1.0.b4 → 0.1.0.b5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/devise/models/notifiable.rb +2 -2
- data/lib/fwt_push_notification_server/version.rb +1 -1
- data/lib/fwt_push_notification_server.rb +2 -2
- data/lib/notifier/apns.rb +2 -2
- data/lib/notifier/base.rb +3 -2
- data/lib/notifier/gcm.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: eac0066c3fe219d7373ee716ce5fc4ff6cb39153
|
4
|
+
data.tar.gz: b348da4facb942402c7cbf3cfd00de708ceeef42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ff1d9948db23b1cf99817b1f4ebab61b5e271a47eb13b5eb8d1aea86d6963aeb7d71f9d13d43d548752a5bc6af85aef9241718fa84f6bba6687d5724b54b599
|
7
|
+
data.tar.gz: 649577e7cb4748ab333dce69fa4900226c5b982c0773766dfd7fe759d6918ed8cc6bd78a3ac4fde831a4cd0059a2362332133616dabb6890d756c0a9665fd6de
|
@@ -5,10 +5,10 @@ module Devise
|
|
5
5
|
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
-
def notify_once(message)
|
8
|
+
def notify_once(message, payload = nil)
|
9
9
|
device_tokens.each do |device|
|
10
10
|
next unless device.is_valid
|
11
|
-
device.notifier.notify_once(message, device) unless device.notifier.nil?
|
11
|
+
device.notifier.notify_once(message, device, payload) unless device.notifier.nil?
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -45,9 +45,9 @@ module FwtPushNotificationServer
|
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
48
|
-
def self.begin_transaction(message)
|
48
|
+
def self.begin_transaction(message, payload = nil)
|
49
49
|
notifiers.each_value do |notifier|
|
50
|
-
notifier.begin_transaction(message)
|
50
|
+
notifier.begin_transaction(message, payload)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
data/lib/notifier/apns.rb
CHANGED
@@ -4,7 +4,7 @@ module FwtPushNotificationServer
|
|
4
4
|
|
5
5
|
class APNS < Notifier::Base
|
6
6
|
|
7
|
-
def notify_once(message, device_tokens)
|
7
|
+
def notify_once(message, device_tokens, payload = nil)
|
8
8
|
|
9
9
|
alert = message.byteslice(0, 232)
|
10
10
|
alert += '...' if alert.bytesize > 232
|
@@ -16,7 +16,7 @@ module FwtPushNotificationServer
|
|
16
16
|
device_tokens.each do |device|
|
17
17
|
if device.is_valid
|
18
18
|
token = device.token
|
19
|
-
n = Grocer::Notification.new(device_token: token, alert: alert)
|
19
|
+
n = Grocer::Notification.new(device_token: token, alert: alert, custom: payload)
|
20
20
|
pusher.push n
|
21
21
|
end
|
22
22
|
end
|
data/lib/notifier/base.rb
CHANGED
@@ -4,9 +4,10 @@ module FwtPushNotificationServer
|
|
4
4
|
|
5
5
|
class Base
|
6
6
|
|
7
|
-
def begin_transaction(message)
|
7
|
+
def begin_transaction(message, payload = nil)
|
8
8
|
@device_tokens = []
|
9
9
|
@message = message
|
10
|
+
@payload = payload
|
10
11
|
end
|
11
12
|
|
12
13
|
def add_device_token(device_token)
|
@@ -17,7 +18,7 @@ module FwtPushNotificationServer
|
|
17
18
|
notify_once(@message, @device_tokens.uniq)
|
18
19
|
end
|
19
20
|
|
20
|
-
def notify_once(message, device_tokens)
|
21
|
+
def notify_once(message, device_tokens, payload = nil)
|
21
22
|
|
22
23
|
end
|
23
24
|
|
data/lib/notifier/gcm.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fwt_push_notification_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.b5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kamil Kocemba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|