registerPlugin static method
注册初始化插件
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;
}
}