registerPlugin static method

Future<bool> registerPlugin({
  1. required String iosAppId,
  2. required String androidAppId,
  3. bool? useTextureView,
  4. required String appName,
  5. bool? allowShowNotify,
  6. bool? allowShowPageWhenScreenLock,
  7. bool? debug,
  8. bool? supportMultiProcess,
  9. List<int>? directDownloadNetworkType,
})

注册初始化插件

Implementation

static Future<bool> registerPlugin({
  required String iosAppId,
  required String androidAppId,
  bool? useTextureView,
  required String appName,
  bool? allowShowNotify,
  bool? allowShowPageWhenScreenLock,
  bool? debug,
  bool? supportMultiProcess,
  List<int>? directDownloadNetworkType,
}) async {
  try {
    return await _channel.invokeMethod("registerPlugin", {
      "iosAppId": iosAppId,
      "androidAppId": androidAppId,
      "useTextureView": useTextureView ?? false,
      "appName": appName,
      "allowShowNotify": allowShowNotify ?? true,
      "allowShowPageWhenScreenLock": allowShowPageWhenScreenLock ?? false,
      "debug": debug ?? false,
      "supportMultiProcess": supportMultiProcess ?? true,
      "directDownloadNetworkType": directDownloadNetworkType != null
          ? directDownloadNetworkType
          : [
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_MOBLE,
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_2G,
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_3G,
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_WIFI,
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_4G,
              FlutterPangolinUnionadNetStateCode.NETWORK_STATE_5G,
            ],
    });
  } catch (e) {
    print("registerPlugin: error message $e");
    return false;
  }
}