register static method
SDK注册初始化
androidAppId
穿山甲广告 Android appid 必填
androidAppId
穿山甲广告 ios appid 必填
useTextureView
使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView 选填
appname
必填
allowShowNotify
是否允许sdk展示通知栏提示 选填
allowShowPageWhenScreenLock
是否在锁屏场景支持展示广告落地页 选填
debug
是否显示debug日志
supportMultiProcess
是否支持多进程,true支持 选填
themeStatus
主题模式 FlutterUnionAdTheme 选填
directDownloadNetworkType
允许直接下载的网络状态集合 选填
personalise
是否开启个性化推荐 选填 FlutterUnionadPersonalise.open开启 FlutterUnionadPersonalise.close关闭
Implementation
static Future<bool> register({
required String iosAppId,
required String androidAppId,
bool? useTextureView,
required String appName,
bool? allowShowNotify,
bool? allowShowPageWhenScreenLock,
bool? debug,
bool? supportMultiProcess,
String? personalise,
int? themeStatus,
List<int>? directDownloadNetworkType,
}) async {
return await _channel.invokeMethod("register", {
"iosAppId": iosAppId,
"androidAppId": androidAppId,
"useTextureView": useTextureView ?? false,
"appName": appName,
"allowShowNotify": allowShowNotify ?? true,
"allowShowPageWhenScreenLock": allowShowPageWhenScreenLock ?? false,
"debug": debug ?? false,
"supportMultiProcess": supportMultiProcess ?? false,
"personalise": personalise ?? FlutterUnionadPersonalise.open,
"themeStatus": themeStatus ?? FlutterUnionAdTheme.DAY,
"directDownloadNetworkType": directDownloadNetworkType != null
? directDownloadNetworkType
: [
FlutterUnionadNetCode.NETWORK_STATE_MOBILE,
FlutterUnionadNetCode.NETWORK_STATE_2G,
FlutterUnionadNetCode.NETWORK_STATE_3G,
FlutterUnionadNetCode.NETWORK_STATE_4G,
FlutterUnionadNetCode.NETWORK_STATE_WIFI
]
});
}