Skip to content

ADMOB ads module with Google In-app billing integrated, this prefetch and inflate ads (70% show rate is guaranteed)

Notifications You must be signed in to change notification settings

BilalZurmati/Zeem-Ads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

Zeem-Ads

Module Integration:
Here is how we can integrate this ads module into our app
Project has different branches make sure to download the code from required branch.

Download zeem module from the project and paste it in your project's root folder.

In Settings.Gradle add this

Kotlin DSL:

include(":zeem")

Grovy:

include(':zeem')

in Project level gradle add this

For Grovy:

maven { url "https://jitpack.io" }

For Kotlin DSL:

maven { url = uri("https://www.jitpack.io" ) }

in App level gradle

implementation(project(":zeem"))


Add this to Manifest

<meta-data
      android:name="com.google.android.gms.ads.APPLICATION_ID"
      android:value="YOUR_ADMOB_APP_ID" />

AdsManager

This class is available in ads package, this class works as the manager which manages ads request, cahce ads, show ads. It works as a stand alone manager to handle the ad related queries, we will simply call this class methods to show and load ads whenever we need it.

Initialize module

Before initialzing this module first we will provide the required data

AdsManager.adData.bannerId = "admob_banner_ad_id_here"
AdsManager.adData.interstitialId = "admob_interstitial_ad_id_here"
AdsManager.adData.nativeId = "admob_native_ad_id_here"
AdsManager.adData.clickCapping = 3  // you can change this value as per your strategy
AdsManager.adData.BannerRequests = 2  //number of banner ads in each session
AdsManager.adData.interstitialRequests = 2  //number of interstitial ads in each session
AdsManager.adData.nativeRequest = 2   //number of native ads in each session

Call below method on splash to make this module start requesting ads for you

initAdManager(this, this)

Native Ad

Below method will inflate native ad

showNativeAd(context: Context,container: FrameLayout,layout: Layout) { inflated ->
                 returns true if ad is inflated or else it returns false
   }

just simply pass context, framelayout container where you want to inflate native Ad and Layout Type.

Here are Layout Types

Layout.FULL
Layout.SIDE_MEDIA
Layout.NO_MEDIA
Layout.SIDE_ICON
Layout.NO_ICON

Banner Ad

loadBannerAd(context: Context, container: FrameLayout) { inflated ->
                 returns true if ad is inflated or else it returns false
   }

Here are different types of Banners

BANNER.NORMAL
BANNER.COLLAPSE_TOP
BANNER.COLLAPSE_BOTTOM

Interstitial Ad

showInterstitialAd(activity: Activity,dismiss: InterstitialDismiss)  { dismissEvent ->
               Do your next event here.
   }

For InterstitialDismiss use one of this

InterstitialDismiss.ON_CLOSE
InterstitialDismiss.ON_IMPRESSION

About

ADMOB ads module with Google In-app billing integrated, this prefetch and inflate ads (70% show rate is guaranteed)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published