jirapong-apn_on_rails 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -80,7 +80,8 @@ class APN::Notification < APN::Base
|
|
80
80
|
# Creates the binary message needed to send to Apple.
|
81
81
|
def message_for_sending
|
82
82
|
json = self.to_apple_json
|
83
|
-
|
83
|
+
c = "\0".encode('UTF-8')
|
84
|
+
message = "#{c}#{c} #{self.device.to_hexa.encode('UTF-8')}#{c}#{json.length.chr.encode('UTF-8')}#{json.encode('UTF-8')}"
|
84
85
|
raise APN::Errors::ExceededMessageSizeError.new(message) if message.size.to_i > 256
|
85
86
|
message
|
86
87
|
end
|
data/lib/apn_on_rails/version.rb
CHANGED