lib/apns_simple/notification.rb in apns_simple-0.1.2 vs lib/apns_simple/notification.rb in apns_simple-0.1.3
- old
+ new
@@ -17,10 +17,10 @@
def payload
payload = { aps: {} }
payload[:aps][:alert] = alert if alert
payload[:aps][:badge] = badge if badge
payload[:aps][:sound] = sound if sound
- payload[:aps][:content_available] = 1 if content_available
+ payload[:aps]['content-available'] = 1 if content_available
packed_message = payload.to_json.gsub(/\\u([\da-fA-F]{4})/) {|m| [$1].pack("H*").unpack("n*").pack("U*")}
packed_token = [token.gsub(/[\s|<|>]/,'')].pack('H*')
[0, 0, 32, packed_token, 0, packed_message.bytesize, packed_message].pack("ccca*cca*")
end
\ No newline at end of file