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
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -368,7 +368,23 @@ In the location notification json specify the full file name:
368
368
369
369
## Channel Management (Android)
370
370
371
-
This library doesn't include a full Channel Management at the moment. Channels are generated on the fly when you pass options to `PushNotification.localNotification` or `PushNotification.localNotificationSchedule`.
371
+
To use custom channels, create them at startup and pass the matching `channelId` through to `PushNotification.localNotification`
372
+
373
+
```javascript
374
+
PushNotification.createChannel(
375
+
{
376
+
channelId:"custom-channel-id", // (required)
377
+
channelName:"Custom channel", // (required)
378
+
channelDesc:"A custom channel to categorise your custom notifications", // (optional) default: undefined.
379
+
soundName:"default", // (optional) See `soundName` parameter of `localNotification` function
380
+
importance:4, // (optional) default: 4. Int value of the Android notification importance
381
+
vibrate:true, // (optional) default: true. Creates the default vibration patten if true.
382
+
},
383
+
(created:any) =>console.log(`createChannel returned '${created}'`) // (optional) callback returns whether the channel was created, false means it already existed.
384
+
);
385
+
```
386
+
387
+
Channels with ids that do not exist are generated on the fly when you pass options to `PushNotification.localNotification` or `PushNotification.localNotificationSchedule`.
0 commit comments