The City Docs
7.2
7.2
  • Welcome
  • ADMIN PANEL
    • Import Project
    • Structure
    • Notification
    • MySQL Database
    • Add New Category
    • News Info
    • Custom Color
    • Change Log
  • ANDROID
    • Getting Started
      • Installation
      • Import Project
    • Structure
    • REST API
      • Configure API Url
      • Validate Your Web
    • Category
      • Integration
      • Add New
    • Firebase [must]
    • Ads
    • Maps & Analytics
    • Sort By Distance
    • Lazy Load
    • SQLite Database
    • Custom Color
    • Change Log
Powered by GitBook
On this page
  • AdConfig.java
  • OPEN BIDDING FAN ( Facebook Audience Network )
  • Remote Config - Change Ad on The Go (Optional)
  • Disable Locally
  • ​GDPR
  1. ANDROID

Ads

Banner & Interstitial

Implement 4 Ad network type ( admob, fan, unity, applovin ) You can switch ad network on the go from Firebase Remote Config

AdConfig.java

From this file you can change default ad network, unit id, interval interstitial, and disable or enable ad

AdConfig.java
public static boolean ad_enable = true;
public static boolean enable_gdpr = true;
public static AdNetworkType ad_network = AdNetworkType.UNITY;
public static int ad_inters_interval = 5;

public static String ad_admob_publisher_id = "pub-3239677920600357";
public static String ad_admob_banner_unit_id = "ca-app-pub-3940256099942544/6300978111";
public static String ad_admob_interstitial_unit_id = "ca-app-pub-3940256099942544/1033173712";

public static String ad_fan_banner_unit_id = "IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID";
public static String ad_fan_interstitial_unit_id = "IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID";

public static String ad_applovin_banner_unit_id = "1849649d520e613b";
public static String ad_applovin_interstitial_unit_id = "d990fd82bd2f007b";

public static String ad_unity_game_id = "4655483";
public static String ad_unity_banner_unit_id = "Banner_Android";
public static String ad_unity_interstitial_unit_id = "Interstitial_Android";

OPEN BIDDING FAN ( Facebook Audience Network )

  1. AppLovin as a Bidding Mediation Partner for Audience Network : Official documentation

Remote Config - Change Ad on The Go (Optional)

After publish your app to market you can change ad network from Firebase Remote Config, so you no need update your app,

How to change config?

3. Add Key Value , key is the lowercase name variable at advertise/AdConfig.java this is remote config form

4. This is AdConfig.java, orange line is key, blue line is value

Disable Locally

this flag not fetch with remote config, so when you disable from this value, your data will not replace by remote config

public class AdConfig {

    // flag for display ads
    public static final boolean ADS_ENABLE = true;
    public static final boolean ADS_MAIN_INTERSTITIAL = ADS_ENABLE && true;
    public static final boolean ADS_MAIN_BANNER = ADS_ENABLE && true;
    public static final boolean ADS_RECIPE_DETAILS_BANNER = ADS_ENABLE && true;
    
    . . .
}

​GDPR

To comply GDPR regulation you must configure some data

1. Admob publisher ID.

Then change publisher Id in AdConfig.java

String ad_admob_publisher_id = "pub-3239677920600357"

2. Privacy Policy Url.

Then please change privacy_policy_url in res/value/string.xml

<string name="privacy_policy_url">
    http://dream-space.web.id/doc_..........
</string>
PreviousFirebase [must]NextMaps & Analytics

Last updated 2 years ago

AdMob as a Bidding Mediation Partner for Audience Network : Official documentation AdMob documentation how to set up ( Follow step 1 & 2 )

AppLovin guidance on how to set up

1. Go to your firebase console , select your project

2. Go to menu Remote Config

​

Here how you can found your admob publisher id : ​

To meet GDPR regulation you also must provide your own privacy and policy url, you can use generator like this : or you can use other tools, after generate you can upload into your hosting or anywhere so user can view it.

https://developers.facebook.com/docs/audience-network/bidding/partner-mediation/admob
https://developers.google.com/admob/android/mediation/facebook
https://developers.facebook.com/docs/audience-network/bidding/partner-mediation/max
https://dash.applovin.com/documentation/mediation/android/mediation-setup/facebook
https://console.firebase.google.com/
What is GDPR ?
https://support.google.com/admob/answer/2784578?hl=en
https://app-privacy-policy-generator.firebaseapp.com/
Here explanation about Firebase Remote Config