initializeMethodCall static method

Future<void> initializeMethodCall({
  1. required VoidCallback? onAppEnterForeground,
})

Initialize the callbacks from the native side to dart. @param onAppEnterForeground Function that needs to be called when the app enters foreground.

Implementation

static Future<void> initializeMethodCall({
  required VoidCallback? onAppEnterForeground,
}) async {
  if (!_methodCallInitialized) {
    _methodCallInitialized = true;
    _channel.setMethodCallHandler(_mbmessagesHandler);
    MBMessagesPlugin.onAppEnterForeground = onAppEnterForeground;
  }
}