You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何将Ionic+Phaser游戏中AdMob横幅尺寸从SMART_BANNER改为BANNER?

How to Change AdMob Banner Size from SMART_BANNER to BANNER in Phaser + Ionic

Hey there! Switching the banner size is straightforward with the AdMob-Plus plugin—here's exactly what you need to do:

  1. Update your banner show configuration
    The default banner size is SMART_BANNER, so you just need to explicitly add the size parameter to your admob.banner.show() call and set it to 'BANNER'.

    Here's your modified code snippet:

    admob.banner.show({
      id: {
        ios: 'ca-app-pub-xxx~xxx',
        android: 'ca-app-pub-xxx~xxx' // Pro tip: Add your Android ad ID here too for full cross-platform support
      },
      size: 'BANNER' // This is the key line to override the default size
    });
    
  2. Verify the change
    After updating the code, rebuild and test your app on your target platforms. The banner should now render as the standard BANNER size instead of the responsive SMART_BANNER.

    For future reference, other valid size options you might use include 'LARGE_BANNER', 'MEDIUM_RECTANGLE', or 'FULL_BANNER'—all align with Google's official AdMob banner size specifications.

内容的提问来源于stack exchange,提问作者Lukas B

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 08:42:53