pushmeup 0.1.3.beta1 → 0.1.4.hf1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.md +14 -6
- data/Rakefile +6 -1
- data/lib/pushmeup/apns/core.rb +7 -8
- data/lib/pushmeup/apns/notification.rb +1 -1
- data/lib/pushmeup/version.rb +1 -1
- metadata +3 -3
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -168,26 +168,34 @@ You can use multiple keys to send notifications, to do it just do this changes i
|
|
168
168
|
# For single notification
|
169
169
|
GCM.send_notification( destination, :identity => :key1 )
|
170
170
|
# Empty notification
|
171
|
-
|
171
|
+
|
172
172
|
GCM.send_notification( destination, data, :identity => :key1 )
|
173
173
|
# Notification with custom information
|
174
|
-
|
174
|
+
|
175
175
|
GCM.send_notification( destination, data, :collapse_key => "placar_score_global", :time_to_live => 3600, :delay_while_idle => false, :identity => :key1 )
|
176
176
|
# Notification with custom information and parameters
|
177
|
-
|
177
|
+
|
178
178
|
# For multiple notifications
|
179
179
|
options1 = {}
|
180
180
|
options2 = {..., :identity => :key2}
|
181
181
|
n1 = GCM::Notification.new(destination1, data1, options1.merge({:identity => :key2}))
|
182
182
|
n2 = GCM::Notification.new(destination2, data2, :identity => :key1)
|
183
183
|
n3 = GCM::Notification.new(destination3, data3, options2)
|
184
|
-
|
184
|
+
|
185
185
|
GCM.send_notifications( [n1, n2, n3] )
|
186
186
|
# In this case, every notification has his own parameters, options and key
|
187
187
|
|
188
|
-
##
|
188
|
+
## Status
|
189
|
+
|
190
|
+
#### Build Status [![Build Status](https://secure.travis-ci.org/NicosKaralis/pushmeup.png?branch=master)](http://travis-ci.org/NicosKaralis/pushmeup) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/NicosKaralis/pushmeup)
|
191
|
+
|
192
|
+
#### Dependency Status [![Dependency Status](https://gemnasium.com/NicosKaralis/pushmeup.png?travis)](https://gemnasium.com/NicosKaralis/pushmeup)
|
193
|
+
|
194
|
+
## Contributing
|
195
|
+
|
196
|
+
We would be very pleased if you want to help us!
|
189
197
|
|
190
|
-
|
198
|
+
Currently we need a lot of testing so if you are good at writing tests please help us
|
191
199
|
|
192
200
|
## License
|
193
201
|
|
data/Rakefile
CHANGED
data/lib/pushmeup/apns/core.rb
CHANGED
@@ -23,23 +23,22 @@ module APNS
|
|
23
23
|
sock, ssl = self.open_connection
|
24
24
|
|
25
25
|
notifications.each do |n|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
ssl.write(n.packaged_notification)
|
27
|
+
end
|
28
|
+
|
29
29
|
ssl.close
|
30
30
|
sock.close
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.feedback
|
34
|
-
raise "Not implemented yet"
|
35
34
|
sock, ssl = self.feedback_connection
|
36
35
|
|
37
36
|
apns_feedback = []
|
38
37
|
|
39
|
-
while line =
|
38
|
+
while line = ssl.read(38) # Read lines from the socket
|
40
39
|
line.strip!
|
41
40
|
f = line.unpack('N1n1H140')
|
42
|
-
apns_feedback <<
|
41
|
+
apns_feedback << { :timestamp => Time.at(f[0]), :token => f[2] }
|
43
42
|
end
|
44
43
|
|
45
44
|
ssl.close
|
@@ -77,10 +76,10 @@ module APNS
|
|
77
76
|
puts fhost
|
78
77
|
|
79
78
|
sock = TCPSocket.new(fhost, 2196)
|
80
|
-
ssl = OpenSSL::SSL::SSLSocket.new(sock,context)
|
79
|
+
ssl = OpenSSL::SSL::SSLSocket.new(sock, context)
|
81
80
|
ssl.connect
|
82
81
|
|
83
82
|
return sock, ssl
|
84
83
|
end
|
85
84
|
|
86
|
-
end
|
85
|
+
end
|
data/lib/pushmeup/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushmeup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4.hf1
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -120,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
120
120
|
version: '0'
|
121
121
|
segments:
|
122
122
|
- 0
|
123
|
-
hash: -
|
123
|
+
hash: -548351084538645532
|
124
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
125
|
none: false
|
126
126
|
requirements:
|