新的广告使用方法

flutter_ads: ^0.1.7 或者 flutter_ads: git: url: https://gitlab.com/novapps/flutter-app/frameworks/new_ads_plugin.git

参数配置 bannerWidth nativeWidth bannerHeight nativeHeight分别设置banner和native广告的期望高度 这在调试ttad广告中很有用

setConfig( {bool isNeedPermission = true, int bannerWidth = 360, int nativeWidth = 360, double bannerHeight, double nativeHeight})

开屏广告

Android平台内部集成了广告sdk 目前支持gdt和穿山甲广告
if(Platform.isAndroid){
      adsSplashView = AdsSplashView(
        adsTick: (int) {
          print(int);
        },
        asdIsFinish: () {
          Navigator.of(context).pop();
        },
      );
    }else if(Platform.isIOS){
      adsSplashView = AdsSplashView(

        adsTick: (int) {
          print(int);
        },
        asdIsFinish: () {
          Navigator.of(context).pop();
        },
      );
    }

Bannner广告

if (Platform.isAndroid) {
      adsBannerView = AdsBannerView();
    } else if (Platform.isIOS) {
      adsBannerView = AdsBannerView(
        adsFailure: () {
          print('加载失败');
        },
        asdIsFinish: () {
          print('加载结束');
        },
      );
    }
Container(
          color: Colors.blue,
          child: ListView.builder(
              itemCount: 10,
              itemBuilder: (context, index) {
                return adsBannerView;
              })),

激励视频(目前仅限于Android平台的穿山甲广告)


 激励视频
 FlutterAds.initRewardVideo(callback: (value){
                      print("广告结果$value");
                      test ="广告结果1$value";
                      setState(() {});
                    });

插屏 initInsertVideo

Android广告加载不出来请检查后台kv配置,包名,签名是否有误

Libraries

ads_bannerview
ads_insertview
ads_nativeview
ads_splashview
flutter_ads
i18n