diff --git a/README.md b/README.md index 77daca95f0feb090bc946705c117d9b647ffcd8b..4e84db7caf522b79b4d82f2de4664392023f6111 100644 --- a/README.md +++ b/README.md @@ -735,3 +735,39 @@ fetch('https://fcm.googleapis.com/fcm/send', { }) }) ``` + +## Channels + +Right now for Android Orion 8 or API 26 is important to use channels. To make it working first of all add default meta data to `AndroidManifest`: + +``` + +``` + +Now you should `createNotificationChannel` on init app. Its creates if not exists yet. + +``` +FCM.createNotificationChannel({ + id: 'car_status', + name: 'Car status', + description: 'Notifies when changes car status', + priority: 'max', +}); +``` + +After this all notifications should have `channel` key and value with specified channel name. For example: + +``` +customNotification = { + id: 'id', + title: `title`, + body: 'body', + sound: 'default', + priority: 'high', + icon: 'ic_launcher', + show_in_foreground: true, + vibrate: 500, + channel: 'car_status', + action: 'android.intent.action.MAIN', +}; +```