kw_apn 0.5 → 0.5.1
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.
- data/VERSION +1 -1
- data/lib/core.rb +4 -4
- data/lib/sender.rb +1 -1
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5
|
1
|
+
0.5.1
|
data/lib/core.rb
CHANGED
@@ -43,16 +43,16 @@ module KwAPN
|
|
43
43
|
|
44
44
|
class Notification
|
45
45
|
|
46
|
-
attr_accessor :identifier, :token
|
47
|
-
def initialize(token, payload, timestamp = 0)
|
48
|
-
@token, @payload, @timestamp = token, payload, timestamp
|
46
|
+
attr_accessor :identifier, :token, :token_original
|
47
|
+
def initialize(token_original, token, payload, timestamp = 0)
|
48
|
+
@token_original, @token, @payload, @timestamp = token_original, token, payload, timestamp
|
49
49
|
end
|
50
50
|
|
51
51
|
# Creates new notification with given token and payload
|
52
52
|
# @param [String, Fixnum] token APNs token of device to notify
|
53
53
|
# @param [Hash, String] payload attached payload
|
54
54
|
def Notification.create(token, payload, timestamp=0)
|
55
|
-
Notification.new(token.kind_of?(String) ? token.delete(' ') : token.to_s(16) , payload.kind_of?(Hash) ? payload.to_apn_payload : payload, timestamp)
|
55
|
+
Notification.new(token, token.kind_of?(String) ? token.delete(' ') : token.to_s(16) , payload.kind_of?(Hash) ? payload.to_apn_payload : payload, timestamp)
|
56
56
|
end
|
57
57
|
|
58
58
|
# Converts to binary string wich can be writen directly into socket
|
data/lib/sender.rb
CHANGED
@@ -27,7 +27,7 @@ module KwAPN
|
|
27
27
|
end
|
28
28
|
@count = notifications.length
|
29
29
|
start_threads(notifications)
|
30
|
-
return [:ok, @failed_index_array.collect{|a| notifications[a].
|
30
|
+
return [:ok, @failed_index_array.collect{|a| notifications[a].token_original}]
|
31
31
|
rescue => e
|
32
32
|
failed
|
33
33
|
self.class.log("(#{app_id} - #{session_id}) Exception: #{e.message}\n\t#{e.backtrace.join("\n\t")}")
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kw_apn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Jonathan Cichon
|
@@ -16,7 +17,7 @@ autorequire:
|
|
16
17
|
bindir: bin
|
17
18
|
cert_chain: []
|
18
19
|
|
19
|
-
date: 2011-02-
|
20
|
+
date: 2011-02-21 00:00:00 +01:00
|
20
21
|
default_executable:
|
21
22
|
dependencies: []
|
22
23
|
|