pu.sh icon indicating copy to clipboard operation
pu.sh copied to clipboard

`apns-priority` and `apns-push-type` needed for remote notifications

Open kejadlen opened this issue 6 years ago • 1 comments

Thanks for this script - it was very helpful for doing development, but we found that for sending content-available pushes, the following headers needed to be set:

apns-priority: 5
apns-push-type: background

Apple documentation:

header description
apns-push-type (Required for watchOS 6 and later; recommended for macOS, iOS, tvOS, and iPadOS) The value of this header must accurately reflect the contents of your notification’s payload. If there is a mismatch, or if the header is missing on required systems, APNs may return an error, delay the delivery of the notification, or drop it altogether.
apns-priority The priority of the notification. If you omit this header, APNs sets the notification priority to 10. Specify 10 to send the notification immediately. A value of 10 is appropriate for notifications that trigger an alert, play a sound, or badge the app’s icon. Specifying this priority for a notification that has a payload containing the content-available key causes an error. Specify 5 to send the notification based on power considerations on the user’s device. Use this priority for notifications that have a payload that includes the content-available key. Notifications with this priority might be grouped and delivered in bursts to the user’s device. They may also be throttled, and in some cases not delivered.

I don't know if you want to handle this in the script or just add it as documentation for the README.

kejadlen avatar Apr 06 '20 18:04 kejadlen

Hi @kejadlen thanks for this (and sorry for taking forever to reply 🙂)

If you create a PR placing it in the readme file I'll be happy to merge it in!

tsif avatar Oct 30 '20 15:10 tsif