nomad-cli / houston

Apple Push Notifications; No Dirigible Required
http://nomad-cli.com
MIT License
2.93k stars 229 forks source link

iOS 13 requires new headers to the APNS #170

Closed RebMeir closed 3 years ago

RebMeir commented 5 years ago

Hey all! The new iOS 13 requires some new headers in the APNS so the pushes will work apns-push-type & apns-priority Otherwise the pushes won't work for iOS 13 + os

ab320012 commented 5 years ago

hm i have an issue for this already #168 and a PR albeit broken

nightpool commented 5 years ago

It looks like Houston currently uses the legacy, binary notification format instead of the HTTP/2 api. Apple so far has not provided any documentation on how to supply this parameter with the legacy notification, or if one is even required. Has someone been able to test that pushes through Houston are actually rejected from an iOS 13 device, or are we just going off of possibly inaccurate documentation?

monochrome-particles commented 5 years ago

I can confirm rejections from iOS 13 devices. Houston reports a successful send, but the push notification never reaches the device.

monochrome-particles commented 5 years ago

If you noticed that some messages are not getting received by the device, check your payload. Chances are, the payload does not include an alert parameter -- probably because you meant to send it as a 'background' message, like updating the badge, or signalling.

A workaround for this is to send a payload with some alert text (try an empty string), and the message will be received by the iOS 13 device.

Example:

notification = Houston::Notification.new(device: token)
notification.alert = ''
notification.badge = 2
notification.category = 'SOME_CATEGORY'
notification.content_available = true

APN.push(notification)