You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+18-16Lines changed: 18 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -403,14 +403,16 @@ In the location notification json specify the full file name:
403
403
To use channels, create them at startup and pass the matching `channelId` through to `PushNotification.localNotification` or `PushNotification.localNotificationSchedule`.
channelDescription:"A channel to categorise your notifications", // (optional) default: undefined.
411
413
playSound:false, // (optional) default: true
412
414
soundName:"default", // (optional) See `soundName` parameter of `localNotification` function
413
-
importance:4, // (optional) default: 4. Int value of the Android notification importance
415
+
importance:Importance.HIGH, // (optional) default: Importance.HIGH. Int value of the Android notification importance
414
416
vibrate:true, // (optional) default: true. Creates the default vibration patten if true.
415
417
},
416
418
(created) =>console.log(`createChannel returned '${created}'`) // (optional) callback returns whether the channel was created, false means it already existed.
@@ -590,10 +592,10 @@ Returns an array of local scheduled notification objects containing:
590
592
591
593
Available options:
592
594
593
-
"max" = NotficationCompat.PRIORITY_MAX
594
-
"high" = NotficationCompat.PRIORITY_HIGH
595
-
"low" = NotficationCompat.PRIORITY_LOW
596
-
"min" = NotficationCompat.PRIORITY_MIN
595
+
"max" = NotficationCompat.PRIORITY_MAX\
596
+
"high" = NotficationCompat.PRIORITY_HIGH\
597
+
"low" = NotficationCompat.PRIORITY_LOW\
598
+
"min" = NotficationCompat.PRIORITY_MIN\
597
599
"default" = NotficationCompat.PRIORITY_DEFAULT
598
600
599
601
More information: https://developer.android.com/reference/android/app/Notification.html#PRIORITY_DEFAULT
@@ -604,25 +606,25 @@ More information: https://developer.android.com/reference/android/app/Notificati
604
606
605
607
Available options:
606
608
607
-
"private" = NotficationCompat.VISIBILITY_PRIVATE
608
-
"public" = NotficationCompat.VISIBILITY_PUBLIC
609
-
"secret" = NotficationCompat.VISIBILITY_SECRET
609
+
"private" = NotficationCompat.VISIBILITY_PRIVATE\
610
+
"public" = NotficationCompat.VISIBILITY_PUBLIC\
611
+
"secret" = NotficationCompat.VISIBILITY_SECRET
610
612
611
613
More information: https://developer.android.com/reference/android/app/Notification.html#VISIBILITY_PRIVATE
612
614
613
615
## Notification importance
614
616
615
-
(optional) Specify `importance` to set importance of notification. Default value: "high"
617
+
(optional) Specify `importance` to set importance of notification. Default value: Importance.HIGH
618
+
Constants available on the `Importance` object. `import PushNotification, {Importance} from 'react-native-push-notification';`
@@ -30,7 +30,7 @@ export default class NotifService {
30
30
channelName: `Default channel`,// (required)
31
31
channelDescription: "A default channel",// (optional) default: undefined.
32
32
soundName: "default",// (optional) See `soundName` parameter of `localNotification` function
33
-
importance: 4,// (optional) default: 4. Int value of the Android notification importance
33
+
importance: Importance.HIGH,// (optional) default: Importance.HIGH. Int value of the Android notification importance
34
34
vibrate: true,// (optional) default: true. Creates the default vibration patten if true.
35
35
},
36
36
(created)=>console.log(`createChannel 'default-channel-id' returned '${created}'`)// (optional) callback returns whether the channel was created, false means it already existed.
@@ -41,7 +41,7 @@ export default class NotifService {
41
41
channelName: `Sound channel`,// (required)
42
42
channelDescription: "A sound channel",// (optional) default: undefined.
43
43
soundName: "sample.mp3",// (optional) See `soundName` parameter of `localNotification` function
44
-
importance: 4,// (optional) default: 4. Int value of the Android notification importance
44
+
importance: Importance.HIGH,// (optional) default: Importance.HIGH. Int value of the Android notification importance
45
45
vibrate: true,// (optional) default: true. Creates the default vibration patten if true.
46
46
},
47
47
(created)=>console.log(`createChannel 'sound-channel-id' returned '${created}'`)// (optional) callback returns whether the channel was created, false means it already existed.
@@ -56,7 +56,7 @@ export default class NotifService {
channelDescription: `A custom channel to categorise your custom notifications. Updated at: ${Date.now()}`,// (optional) default: undefined.
58
58
soundName: "default",// (optional) See `soundName` parameter of `localNotification` function
59
-
importance: 4,// (optional) default: 4. Int value of the Android notification importance
59
+
importance: Importance.HIGH,// (optional) default: Importance.HIGH. Int value of the Android notification importance
60
60
vibrate: true,// (optional) default: true. Creates the default vibration patten if true.
61
61
},
62
62
(created)=>console.log(`createChannel returned '${created}'`)// (optional) callback returns whether the channel was created, false means it already existed.
0 commit comments