Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-fcm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
react-native-fcm
Commits
2a6c09e5
Commit
2a6c09e5
authored
Oct 13, 2018
by
Ernestas Sipavičius
Committed by
GitHub
Oct 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Readme how to use channels
parent
e3112d88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
README.md
README.md
+36
-0
No files found.
README.md
View file @
2a6c09e5
...
...
@@ -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`:
```
<meta-data
android:name=
"com.google.firebase.messaging.default_notification_channel_id"
android:value=
"@string/default_notification_channel_id"
/>
```
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',
};
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment