This repository was archived by the owner on Jun 28, 2024. It is now read-only.
Commit 07636a5 1 parent 96b090e commit 07636a5 Copy full SHA for 07636a5
File tree 1 file changed +21
-20
lines changed
1 file changed +21
-20
lines changed Original file line number Diff line number Diff line change @@ -378,27 +378,28 @@ Then to start the foreground service:
378
378
import notifee , { AndroidImportance } from ' @notifee/react-native' ;
379
379
380
380
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
+ },
399
400
},
400
- },
401
- });
401
+ });
402
+ }
402
403
};
403
404
```
404
405
You can’t perform that action at this time.
0 commit comments