Houzi Docs logo Houzi Docs

Register your app as an AdMob app by completing the following steps:

  1. Sign in to or Sign up for an AdMob account.
  2. Register your app with AdMob. This step creates an AdMob app with a unique AdMob App ID for each platform.

Setup Admob App ID

After getting your app AdMob App ID go to:

- Android houzi > android > app > src > main > res > values > strings.xml file, and look for google_ads_app_id. Replace its value with your own AdMob App ID.

- iOS Project_HOME > ios > Runner > Info.plist file, and look for GADApplicationIdentifier. Replace its value with your own AdMob App ID.

Enable iOS App Tracking Transparency

You need to enable App Tracking Transparency in iOS Project. Follow here: Setup iOS ads tracking

Good to remember: After creating AdMob app, update your GoogleServices-Info.plist for iOS and google-services.json for android by downloading fresh copy from firebase.

Create a native ad unit.

We use native ad units in the app. To create a native ad unit. follow this link to get it: Create a native ad unit. When you’ve acquired Native Ad Unit IDs, configure it in the app in the steps below.

Add/Change AdMob Native ids by Houzi Config

Open houzi config and go to the section Api & Config. Enter your Android and iOS native ads id here

enter-ad-mob-key.JPG

Add/Change AdMob Native ids by editing config.json

Copy that native ad unit and go to the Project_HOME > assests > configuration > configuration.json file, and look for android_native_ad_id for android and ios_native_ad_id for IOS. Replace its value with your own native ad unit. Make sure set the value of show_ads: true to turn on the ads

Add/Change AdMob Native ids by editing constants.dart

Copy that native ad unit and go to the Project_HOME > packages > houzi_package > lib > common > constants.dart file, and look for ANDROID_NATIVE_AD_ID for android and IOS_NATIVE_AD_ID for IOS. Replace its value with your own native ad unit. Make sure set the value of SHOW_ADS=true to turn on the ads

Enable Ad Validator to Debug your ads

AdMob sdk provides a way to validate your ads on screen. We’ve disabled the ad validator by default. However you can enable the ad validator to check if you’ve any issues with your configurations.

Enable Ad Validator Android

Open houzi > android > app > src > main > AndroidManifest.xml file, and look for com.google.android.gms.ads.flag.NATIVE_AD_DEBUGGER_ENABLED. Replace its value android:value="false" to true.

Enable Ad Validator iOS

Open file Project_HOME > ios > Runner > Info.plist file, and look for GADNativeAdValidatorEnabled. Replace its next tag <false/> with <true/>

This will enable ad validator for your app.

Previous: Setup Phone sign in Next: Setup iOS ads tracking