unipush 0.1.10 → 0.2.0
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 +8 -8
- data/lib/unipush.rb +13 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTlhY2IxNzgyZmNlZThiZjAyODc1NDNkNGVmNzY0MmY3ODBhMzJhYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTBkMTg4Y2JiZDgwNTQzZmNjZjI2NTQzNzFjZjUwZTYyYzk0NDEwNA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDhmNTZjN2VhZWY5YzJiN2I2NDhmNTU5OGNiNjk4M2ZiZWM0MzA1ODZlMTFh
|
10
|
+
NmQyMTlmM2E1NTQ3YzFkOGM0OWU3YzEzM2IzMDRjOGViZjA2OWY5ZTM2Y2E0
|
11
|
+
NDVjOGVmMjRkYmZmOGY5ZTcwZDQ3YzlkYWRmZWRkOTVjZTgwOGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzM2YzA5MjI3OWI1YjdiY2MyZGI1NTcwZDZlNTVlMDgyZDk4NGYzOWU0OTJl
|
14
|
+
ZmNkYzQ4NDE5Mjg2NGVlODg2ZjhkMzgxMDBjYzI4MTY5NDRjNTMzNmVhMTgx
|
15
|
+
M2E1NjY1NTk3NjE2ODQyMTkyMWZmNmYyOTBhMDE0YzJlZjI0M2E=
|
data/lib/unipush.rb
CHANGED
@@ -64,22 +64,20 @@ module Unipush
|
|
64
64
|
mes = prepare_ios_message(m[0], m[1], k)
|
65
65
|
if mes
|
66
66
|
if apns_check_conn
|
67
|
-
cnt = 0
|
68
|
-
@ssl.write(mes)
|
69
|
-
@logger.info(Time.now.to_s + " -- sent one message")
|
70
67
|
begin
|
71
|
-
|
72
|
-
tmp = @ssl.read_nonblock(8)
|
68
|
+
tmp = @ssl.read_nonblock(6)
|
73
69
|
reply = tmp.unpack("CCN")
|
74
70
|
@unsent_messages.push(reply[2])
|
75
71
|
@logger.error(Time.now.to_s + " -- error in message")
|
76
72
|
@last_error.push("Could not send message #{reply[2]} width error: "+reply.join(", "))
|
77
73
|
self.apns_close
|
78
|
-
break
|
79
74
|
rescue IO::WaitReadable
|
80
|
-
|
75
|
+
# no op
|
76
|
+
rescue EOFError
|
77
|
+
self.apns_close
|
81
78
|
end
|
82
|
-
|
79
|
+
@ssl.write(mes)
|
80
|
+
@logger.info(Time.now.to_s + " -- sent one message")
|
83
81
|
end
|
84
82
|
else
|
85
83
|
@unsent_messages = [] if @unsent_messages.nil?
|
@@ -507,15 +505,15 @@ module Unipush
|
|
507
505
|
|
508
506
|
def send_toast(text, uris)
|
509
507
|
builder = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
end
|
508
|
+
xml.toast{
|
509
|
+
xml.visual{
|
510
|
+
xml.binding('template'=>'toastText01') do
|
511
|
+
xml.text_('id'=>'1') do
|
512
|
+
xml.text text
|
516
513
|
end
|
517
|
-
|
514
|
+
end
|
518
515
|
}
|
516
|
+
}
|
519
517
|
end
|
520
518
|
|
521
519
|
content = builder.to_xml
|