diff --git a/_includes/js/push-notifications.md b/_includes/js/push-notifications.md index 1ea7a2c32..d18745236 100644 --- a/_includes/js/push-notifications.md +++ b/_includes/js/push-notifications.md @@ -26,7 +26,7 @@ This class has several special fields that help you manage and target devices. * **`channels`**: An array of the channels to which a device is currently subscribed. * **`timeZone`**: The current time zone where the target device is located. This value is synchronized every time an `Installation` object is saved from the device. * **`deviceType`**: The type of device, "ios", "android", "winrt", "winphone", or "dotnet"_(readonly)_. -* **`pushType`**: This field is reserved for directing Parse to the push delivery network to be used. If the device is registered to receive pushes via FCM, this field will be marked "gcm". If this device is not using FCM, and is using Parse's push notification service, it will be blank _(readonly)_. +* **`pushType`**: This field is reserved for directing Parse to the push delivery network to be used. If the device is registered to receive pushes via FCM, this field will be marked "gcm". If this device is not using FCM, and is using Parse's push notification service, it will be blank _(readonly)_. * **`installationId`**: Universally Unique Identifier (UUID) for the device used by Parse. It must be unique across all of an app's installations. _(readonly)_. * **`deviceToken`**: The Apple or Google generated token used to deliver messages to the APNs or FCM push networks respectively. * **`channelUris`**: The Microsoft-generated push URIs for Windows devices. @@ -129,7 +129,7 @@ Parse.Push.send({ If we store relationships to other objects in our `Installation` class, we can also use those in our query. For example, we could send a push notification to all users near a given location like this. - ```javascript +```javascript // Find users near a given location var userQuery = new Parse.Query(Parse.User); userQuery.withinMiles("location", stadiumLocation, 1.0); @@ -163,7 +163,9 @@ If you want to send more than just a message, you can set other fields in the `d * **`alert`**: the notification's message. * **`badge`**: _(iOS only)_ the value indicated in the top right corner of the app icon. This can be set to a value or to `Increment` in order to increment the current value by 1. * **`sound`**: _(iOS only)_ the name of a sound file in the application bundle. -* **`content-available`**: _(iOS only)_ If you are a writing an app using the Remote Notification Background Mode [introduced in iOS7](https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW10) (a.k.a. "Background Push"), set this value to 1 to trigger a background download. +* **`content-available`**: _(iOS only)_ If you are a writing an app using the Remote Notification Background Mode [introduced in iOS7](https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW10) (a.k.a. "Background Push"), set this value to 1 to trigger a background download. You also have to set `push_type` starting iOS 13 and watchOS 6. +* **`push_type`**: _(iOS only)_ The type of the notification. The value is `alert` or `background`. Specify `alert` when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify `background` for silent notifications that do not interact with the user. Defaults to `alert` if no value is set. Required when delivering notifications to devices running iOS 13 and later, or watchOS 6 and later. +* **`priority`**: _(iOS only)_ The priority of the notification. Specify 10 to send the notification immediately. Specify 5 to send the notification based on power considerations on the user’s device. ([More detailed documentation](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)) * **`category`**: _(iOS only)_ the identifier of the [`UNNotification​Category`](https://developer.apple.com/reference/usernotifications/unnotificationcategory) for this push notification. * **`uri`**: _(Android only)_ an optional field that contains a URI. When the notification is opened, an `Activity` associated with opening the URI is launched. * **`title`**: _(Android only)_ the value displayed in the Android system tray notification. diff --git a/_includes/parse-server/push-notifications.md b/_includes/parse-server/push-notifications.md index 324d02a60..93aa34f03 100644 --- a/_includes/parse-server/push-notifications.md +++ b/_includes/parse-server/push-notifications.md @@ -20,6 +20,8 @@ We support most of the sending options. Check the detailed doc [here]({{ site.ba * `channels` to target installations by channels * `where` to target installations by `ParseQuery` +* `priority` under `data` for iOS push priority +* `push_type` under `data` for iOS push type * `alert` under `data` for notification message * number `badge` under `data` for iOS badge number * `sound` under `data` for iOS sound @@ -284,6 +286,8 @@ If you're interested in any of these features, [don't hesitate to jump in and se If you are seeing situations where silent notifications are failing to deliver, please ensure that your payload is setting the `content-available` attribute to Int(1) (or just 1 as in javascript) and not "1". This value will be explicitly checked. +When sending a push notification to APNs you also have to set `push_type` to `background` for delivering silent notifications to devices running iOS 13 and later, or watchOS 6 or later. + ### PPNS * [PPNS Protocol Specification (for Parse IoT devices)](https://github.com/parse-community/parse-server/wiki/PPNS-Protocol-Specification) diff --git a/_includes/rest/push-notifications.md b/_includes/rest/push-notifications.md index 500e7f65c..22dc9c830 100644 --- a/_includes/rest/push-notifications.md +++ b/_includes/rest/push-notifications.md @@ -620,7 +620,9 @@ If you want to send more than just a message, you can set other fields in the `d * **`alert`**: the notification's message. * **`badge`**: _(iOS only)_ the value indicated in the top right corner of the app icon. This can be set to a value or to `Increment` in order to increment the current value by 1. * **`sound`**: _(iOS only)_ the name of a sound file in the application bundle. -* **`content-available`**: _(iOS only)_ If you are a writing an app using the Remote Notification Background Mode [introduced in iOS7](https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW10) (a.k.a. "Background Push"), set this value to 1 to trigger a background download. +* **`content-available`**: _(iOS only)_ If you are a writing an app using the Remote Notification Background Mode [introduced in iOS7](https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW10) (a.k.a. "Background Push"), set this value to 1 to trigger a background download. You also have to set `push_type` starting iOS 13 and watchOS 6. +* **`push_type`**: _(iOS only)_ The type of the notification. The value is `alert` or `background`. Specify `alert` when the delivery of your notification displays an alert, plays a sound, or badges your app's icon. Specify `background` for silent notifications that do not interact with the user. Defaults to `alert` if no value is set. Required when delivering notifications to devices running iOS 13 and later, or watchOS 6 and later. +* **`priority`**: _(iOS only)_ The priority of the notification. Specify 10 to send the notification immediately. Specify 5 to send the notification based on power considerations on the user’s device. ([More detailed documentation](https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns)) * **`category`**: _(iOS only)_ the identifier of the [`UNNotification​Category`](https://developer.apple.com/reference/usernotifications/unnotificationcategory) for this push notification. * **`uri`**: _(Android only)_ an optional field that contains a URI. When the notification is opened, an `Activity` associated with opening the URI is launched. * **`title`**: _(Android only)_ the value displayed in the Android system tray notification.