jirapong-apn_on_rails 0.4.8 → 0.4.9
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.
@@ -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