startNodeService method

  1. @override
Future<void> startNodeService(
  1. String mainFileName,
  2. String title,
  3. String content, {
  4. bool redirectOutputToLogcat = true,
})
override

Starts the Node.js script as a foreground service (e.g. Android Notification Service).

  • mainFileName: The Node.js file to execute.
  • title: Title for the notification.
  • content: Content text for the notification.
  • redirectOutputToLogcat: If true, routes stdout/stderr to Logcat.

Platform-specific implementations must override this.

Implementation

@override
Future<void> startNodeService(
  String mainFileName,
  String title,
  String content, {
  bool redirectOutputToLogcat = true,
}) async {
  await _methodChannel.invokeMethod('startNodeService', {
    'mainFileName': mainFileName,
    'options': {
      'redirectOutputToLogcat': redirectOutputToLogcat,
      'title': title,
      'content': content,
    },
  });
}