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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a72441b0f1e0bb35eb1e4f713e9d19acbe11d0be
4
- data.tar.gz: 97a274bc4c649e8dd345e96c60fb2468db2fee1b
3
+ metadata.gz: eac0066c3fe219d7373ee716ce5fc4ff6cb39153
4
+ data.tar.gz: b348da4facb942402c7cbf3cfd00de708ceeef42
5
5
  SHA512:
6
- metadata.gz: d040da53e6df08b048e67c60cc19f2cc4bbdf8eb780d0e4ed7f187f7dac872e57b0d0aae66e1920c45475862ae6c3ab685f05683c0c7dafd3f7ec04d764090e4
7
- data.tar.gz: 85c8a696071f0ab5f22ed7a0ed62b219ab666688d2dc3d6171d4ed42a0339e06eef6342b837369e9ea684c5976e701e2ff870f094dcaba54a26e0eae70fecfae
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
 
@@ -1,3 +1,3 @@
1
1
  module FwtPushNotificationServer
2
- VERSION = "0.1.0.b4"
2
+ VERSION = "0.1.0.b5"
3
3
  end
@@ -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
@@ -4,7 +4,7 @@ module FwtPushNotificationServer
4
4
 
5
5
  class GCM < Notifier::Base
6
6
 
7
- def notify_once(message, device_tokens)
7
+ def notify_once(message, device_tokens, payload = nil)
8
8
 
9
9
  @device_tokens = device_tokens.is_a?(Array) ? device_tokens : [device_tokens]
10
10
 
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.b4
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-14 00:00:00.000000000 Z
11
+ date: 2013-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails