Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for Notification channelImportance. #818

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/declarations/interfaces/Notification.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,5 +473,36 @@ declare module "react-native-background-geolocation" {
*/
channelName?: string;

/**
* Configure the importance of the plugin's notification-channel used to display the [[Config.foregroundService]] notification.
* @break
*
* On Android O+, the plugin's foreground-service needs to create a "Notification Channel". This will control the **importance** of the notification channel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android O+ this is a little confusing? Did you mean 10+ or Oreo+?

*
* The following `notificationPriority` values defined as static constants upon the [[BackgroundGeolocation]] object:
*
* | Value | Description |
* |---------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
* | [[BackgroundGeolocation.NOTIFICATION_PRIORITY_DEFAULT]] | Default notification importance: shows everywhere, makes noise, but does not visually intrude. |
* | [[BackgroundGeolocation.NOTIFICATION_PRIORITY_HIGH]] | Higher notification importance: shows everywhere, makes noise and peeks. May use full screen intents. |
* | [[BackgroundGeolocation.NOTIFICATION_PRIORITY_LOW]] | Low notification importance: Shows in the shade, and potentially in the status bar, but is not audibly intrusive. |
* | [[BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN]] | Min notification importance: Only shows in the shade, below the fold. |
*
* @example
* ```javascript
* BackgroundGeolocation.ready({
* notification: {
* channelImportance: BackgroundGeolocation.NOTIFICATION_PRIORITY_LOW
* });
*
* // or with #setConfig
* BackgroundGeolocation.setConfig({
* notification: {
* channelImportance: BackgroundGeolocation.NOTIFICATION_PRIORITY_LOW
* }
* });
* ```
*/
channelImportance?: NotificationPriority
}
}