handleBackgroundIsolateCall function

  1. @visibleForTesting
Future<bool> handleBackgroundIsolateCall(
  1. MethodCall call
)

Runs a push on the background isolate, with the handler found by the handle native stored when the app registered it. Returns false when this build of the app no longer has that handler.

Implementation

@visibleForTesting
Future<bool> handleBackgroundIsolateCall(MethodCall call) async {
  final arguments = call.arguments as Map;
  final handler = PluginUtilities.getCallbackFromHandle(
    CallbackHandle.fromRawHandle(
        arguments[NativeMethodParams.handlerHandle] as int),
  );
  if (handler is! BackgroundPushHandler) return false;
  await handler(_backgroundPush(arguments));
  return true;
}