From 2a6c09e511693590b48e04b340735b7b0634a149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernestas=20Sipavi=C4=8Dius?= Date: Sat, 13 Oct 2018 20:19:50 +0300 Subject: [PATCH] Update Readme how to use channels --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 77daca9..4e84db7 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', +}; +``` -- 2.26.2