backgroundEntrypoint function

Future<void> backgroundEntrypoint(
  1. List<String> args
)

Implementation

@pragma('vm:entry-point')
Future<void> backgroundEntrypoint(List<String> args) async {
  WidgetsFlutterBinding.ensureInitialized();
  final service = IOSServiceInstance._();
  final int handle = int.parse(args.first);
  final callbackHandle = CallbackHandle.fromRawHandle(handle);
  final onStart = PluginUtilities.getCallbackFromHandle(callbackHandle)
      as FutureOr<bool> Function(ServiceInstance instance)?;
  if (onStart != null) {
    final result = await onStart(service);
    await service._setBackgroundFetchResult(result);
  }
}