Permalink
Browse files

fix checking size from total message to payload (part of message)

  • Loading branch information...
1 parent d1a879e commit 4bada94eefd3ab3a417fc5cbb08755324d705467 @niku committed Apr 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/apn_on_rails/app/models/apn/group_notification.rb
View
2 lib/apn_on_rails/app/models/apn/group_notification.rb
@@ -72,7 +72,7 @@ def to_apple_json
def message_for_sending(device)
json = self.to_apple_json
message = "\0\0 #{device.to_hexa}#{[json.length].pack('n')}#{json}"
- raise APN::Errors::ExceededMessageSizeError.new(message) if message.size.to_i > 256
+ raise APN::Errors::ExceededMessageSizeError.new(message) if json.size.to_i > 256
message
end

0 comments on commit 4bada94

Please sign in to comment.