handleMethodCall method

  1. @visibleForTesting
Future<void> handleMethodCall(
  1. MethodCall call
)

Handles a call coming from the platform side of the background channel.

Implementation

@visibleForTesting
Future<void> handleMethodCall(MethodCall call) async {
  if (call.method != BackgroundChannel.onRegionEvent) {
    return;
  }
  try {
    await _dispatchRegionEvent(call.arguments as List<dynamic>);
  } catch (error) {
    debugPrint('Woosmap background callback failed: $error');
  }
  await _channel.invokeMethod<void>(BackgroundChannel.eventProcessed);
}