I am using https://github.com/voximplant/react-native-foreground-service library for running foreground tasks.
const channelConfig = {
id: 'channelId',
name: 'Channel name',
description: 'Channel description',
enableVibration: false
};
VIForegroundService.createNotificationChannel(channelConfig);
when Im running this part of code which I got from documentation, happens error and I dont know why? Did you met this issue?
This answer is quite late but I hope it will help people in the future,
I was getting:
But after adding:
import ReactNativeForegroundService from '@supersami/rn-foreground-service'; ReactNativeForegroundService.register(); AppRegistry.registerComponent(appName, () => App);
Into my
index.js
, The Foreground service was working.*Replace The import in the code above with the service you are using.