lib/j7w1/sns_push_client.rb in j7w1-0.0.27 vs lib/j7w1/sns_push_client.rb in j7w1-0.0.27.1

- old
+ new

@@ -160,10 +160,10 @@ def ios_truncated_payload(data) payload = data.to_json # Truncation is skipped when the payload is sufficiently lightweight. - return payload if (limit_break = payload.bytesize - APNX_MAX_PAYLOAD) >= 0 + return payload if (limit_break = payload.bytesize - APNS_MAX_PAYLOAD) >= 0 # Raise error if shortening of the alert cannot make the payload sufficiently short. size_to_reduce = limit_break + SHORTEN_REPLACEMENT_LENGTH raise "Payload is too heavy (#{payload.length})" unless data[:alert] && data[:alert].bytesize > size_to_reduce