Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 07636a5

Browse files
committed
Update readme
1 parent 96b090e commit 07636a5

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

README.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -378,27 +378,28 @@ Then to start the foreground service:
378378
import notifee, { AndroidImportance } from '@notifee/react-native';
379379

380380
const startForegroundService = async () => {
381-
if (Platform.OS === 'android') return;
382-
const channelId = await notifee.createChannel({
383-
id: 'video_call',
384-
name: 'Video call',
385-
lights: false,
386-
vibration: false,
387-
importance: AndroidImportance.DEFAULT,
388-
});
389-
390-
await notifee.displayNotification({
391-
title: 'Your video call is ongoing',
392-
body: 'Tap to return to the call.',
393-
android: {
394-
channelId,
395-
asForegroundService: true,
396-
ongoing: true,
397-
pressAction: {
398-
id: 'default',
381+
if (Platform.OS === 'android') {
382+
const channelId = await notifee.createChannel({
383+
id: 'video_call',
384+
name: 'Video call',
385+
lights: false,
386+
vibration: false,
387+
importance: AndroidImportance.DEFAULT,
388+
});
389+
390+
await notifee.displayNotification({
391+
title: 'Your video call is ongoing',
392+
body: 'Tap to return to the call.',
393+
android: {
394+
channelId,
395+
asForegroundService: true,
396+
ongoing: true,
397+
pressAction: {
398+
id: 'default',
399+
},
399400
},
400-
},
401-
});
401+
});
402+
}
402403
};
403404
```
404405

0 commit comments

Comments
 (0)