flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

IOS: when you call Isolate.spawn, Error occur

Open spysoos opened this issue 3 years ago • 0 comments

call Isolate.spawn inner "onStart" function, you will get An error

  WidgetsFlutterBinding.ensureInitialized();
  FlutterBackgroundService.initialize(onStart);
  runApp(MyApp());
}

void onStart() {
  WidgetsFlutterBinding.ensureInitialized();

  var _mainReceiverPort = ReceivePort();
  Isolate.spawn(_sendSub, _mainReceiverPort.sendPort);
}```

spysoos avatar Dec 15 '21 10:12 spysoos