registerBackgroundMessageHandler method
This function registers background message handler to native side
Implementation
Future<void> registerBackgroundMessageHandler(MessageHandler handler) async {
if (Platform.isIOS) {
return;
}
if (!_bgHandlerInitialized) {
_bgHandlerInitialized = true;
HashMap<String, dynamic> list = HashMap();
list[_keyBackgroundHandler] = PluginUtilities.getCallbackHandle(callbackDispatcherLegacy)!.toRawHandle();
list[_keyOnPushReceiveBackground] = PluginUtilities.getCallbackHandle(handler)!.toRawHandle();
await _channel.invokeMethod(_keyStartBackgroundIsolate, list);
}
}