Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banner广告ios正常,android不显示 #9

Open
error-code opened this issue Apr 24, 2023 · 3 comments
Open

Banner广告ios正常,android不显示 #9

error-code opened this issue Apr 24, 2023 · 3 comments

Comments

@error-code
Copy link

描述

Banner广告ios正常,android不显示

代码

GTAdsBannerWidget(
          //需要的广告位组
          codes: [
            GTAdsCode(alias: "ylh", probability: 5,androidId: "9055941703623169",iosId: "3015049793632342"),
          ],
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.width/6.4,
          //超时时间 当广告失败后会依次重试其他广告 直至所有广告均加载失败 设置超时时间可提前取消
          timeout: 5,
          //默认随机模式
          model: GTAdsModel.RANDOM,
          callBack: GTAdsCallBack(
            onShow: (code) {
              print("横幅显示 ${code.toJson()}");
            },
            onClick: (code) {
              print("横幅点击 ${code.toJson()}");
            },
            onFail: (code,message) {
              print("横幅错误 $message");
            },
            onClose: (code) {
              print("横幅关闭 ${code.toJson()}");
            },
            onTimeout: () {
              print("横幅加载超时");
            },
            onEnd: () {
              print("横幅所有广告位都加载失败");
            },
          ),
        )

设备版本

Flutter (Channel stable, 3.7.7, on Microsoft Windows [版本 10.0.19045.2728], locale zh-CN)

插件版本

gtads_csj: ^1.2.2 #穿山甲广告
gtads_ylh: ^1.2.1 #优量汇

日志

详细的log日志或者截图录屏

E/flutter_tencentad_BannerAdView(18267): ---onADReceive---BannerAdView  Banner广告加载成功回调
I/flutter (18267): onShow ====  {width: 373.2272644042969, height: 0.8636363744735718}
I/flutter (18267): 横幅显示 {alias: ylh, androidId: 9055941703623169, iosId: 3015049793632342, probability: 5}
E/FrameEvents(18267): updateAcquireFence: Did not find frame.
E/gdt_ad_mob(18267): ADEvent 参数为空,type:109
E/FrameEvents(18267): updateAcquireFence: Did not find frame.
E/flutter_tencentad_BannerAdView(18267): ---onADExposure---BannerAdView  Banner广告曝光
@wghzyy
Copy link

wghzyy commented Jun 3, 2023

请问您解决了吗?我的也是

image

@gstory0404
Copy link
Owner

更新试一下 是否仍复现?

@leafsoar
Copy link

leafsoar commented Jun 14, 2024

flutter_tencentad 中,Android 平台会存在回调 宽度和高度 错误的问题。
https://github.com/gstory0404/flutter_tencentad/blob/1.2.21/lib/banner/banner_ad_view.dart
115 行,Android 会设置宽高为 [0.5,0.5] 所以没有展示 Android 的 banner,如果将这里注释,可以正常展示,可能是内部回调传入错误参数。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants