Original library: https://developers.mopub.com/publishers/android/
Based on MoPub Android SDK 5.15.0 (November 18, 2020)
Banner, Interstitial and Rewarded Video Ads (untested).
Currently is not possible to use this library with B4a.
This library can mediate AdMob and Facebook Audience Network trough MoPub implemented adapters.
That means 3 large networks, AdMob, Facebook and Marketplace (Mopub) compete each other for higher eCPM price = more profit for you. Network with higher ad price will show ad in your app. At any time you have full control what where and how will be shown in your app. Turning on/off some of these network in your live app is just one click away in MoPub dashboard.
If you want to use one of the best mediation network in mobile world, then use MoPub as you can customize everything, including Back fill, Direct sold ads and much much more.
Download library zip file from this link and extract archive to Additional Libraries folder. I'm not able to upload on forum, as size of file is over maximum allowed limit.
MoPub library depend on files from Facebook Audience Network Library. You need to have files in Additional Libraries folder, no need to include FAN library in your project.
v5.13 - Check manifest in MoPubExample. Manifest have some breaking changes from previous version.
v5.15 - Rewarded Video Ads, Manifest update. I'm not able to test Rewarded Video Ads. You can try by follow these steps.
Based on MoPub Android SDK 5.15.0 (November 18, 2020)
Banner, Interstitial and Rewarded Video Ads (untested).
Currently is not possible to use this library with B4a.
MoPubAds
Author: Author: MoPub - B4a Wrapper: Pendrush
Version: 5.15
- MoPubBanner
- Events:
- BannerClicked
- BannerCollapsed
- BannerExpanded
- BannerFailed (Error As String)
- BannerInitialized
- BannerLoaded
- Fields:
- AD_BANNER_HEIGHT_50 As Object
- AD_BANNER_HEIGHT_90 As Object
- Functions:
- BringToFront
- DestroyAd
Destroy Ad- Initialize (arg1 As String)
- InitializeBanner (EventName As String, UnitId As String, ForceGdprApplies As Boolean)
Initialize Banner Ad
MoPubBanner1.InitializeBanner("MoPubBanner1", "b195f8dd8ded45fe847ad89ed1d016da", False)
ForceGdprApplies - explanation
If the publisher is not using the forceGDPRApplies flag, consent is considered valid where isGDPRApplicable is true as defined by MoPub.
If a publisher then starts using the forceGDPRApplies flag for a user not identified by MoPub as being subject to GDPR,
our SDK will treat that user as subject to GDPR for the duration of the app lifetime.
If the publisher is using the forceGDPRApplies flag, consent is valid for users for whom the forceGDPRApplies flag is on.
If, in a later update, the publisher decides that they no longer want to use the forceGDPRApplies flag, new users will be treated as subject to GDPR as determined by MoPub,
and any existing users for whom the forceGDPRApplies flag was previously set will still be treated as subject to GDPR as defined by publisher.
This cannot be revoked by any means except with app deletion and re-installation.- Invalidate
- Invalidate2 (arg0 As android.graphics.Rect)
- Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- IsInitialized As Boolean
- LoadAd (BannerAdHeight As com.mopub.mobileads.MoPubView.MoPubAdSize)
Load Ad in event BannerInitialized or after, not before BannerInitialized fire.
MoPubBanner1.LoadAd(MoPubBanner1.AD_BANNER_HEIGHT_50)- OpenConsentDialogForced
OpenConsentDialogForced is valid in event BannerInitialized or after, not before BannerInitialized fire
Dialog will open if you ForceGdprApplies in InitializeBanner method, or if user is in EEA zone.- RemoveView
- RequestFocus As Boolean
- SendToBack
- SetBackgroundImage (arg0 As android.graphics.Bitmap) As BitmapDrawable
- SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
- SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
- SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
- SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
- Properties:
- Background As android.graphics.drawable.Drawable
- CollectPersonalInformation As Boolean [read only]
CollectPersonalInformation is valid in event BannerInitialized or after, not before BannerInitialized fire.
If True, can collect personal information. User select Yes on Gdpr consent dialog, or not in EEA zone.- Color As Int [write only]
- Enabled As Boolean
- GdprApplies As Boolean [read only]
GdprApplies is valid in event BannerInitialized or after, not before BannerInitialized fire.
True if user is in EEA zone.- Height As Int
- Left As Int
- Padding As Int()
- Parent As Object [read only]
- Tag As Object
- Top As Int
- Visible As Boolean
- Width As Int
- MoPubInterstitial
- Events:
- InterstitialClicked
- InterstitialDismissed
- InterstitialFailed (Error As String)
- InterstitialLoaded
- InterstitialShown
- Functions:
- DestroyAd
Destroy Ad- InitializeInterstitial (EventName As String, UnitId As String)
Initialize Interstitial Ad in event BannerInitialized or after, not before BannerInitialized fire.
MoPubInterstitial1.InitializeInterstitial("MoPubInterstitial1", "24534e1901884e398f1253216226017e")
MoPubInterstitial1.LoadAd- IsReady As Boolean
IsReady, return True if Interstitial Ad is ready to be shown.- LoadAd
Load Interstitial Ad in event BannerInitialized or after, not before BannerInitialized fire.
MoPubInterstitial1.LoadAd- ShowAd
Show Ad.- MoPubRewardedVideo
- Events:
- RewardedVideoClicked
- RewardedVideoClosed
- RewardedVideoCompleted (Successful As Boolean, Label As String, Amount As Int)
- RewardedVideoLoadFailure (Error As String)
- RewardedVideoLoadSuccess
- RewardedVideoPlaybackError (Error As String)
- RewardedVideoStarted
- Functions:
- HasRewardedVideo As Boolean
Return True if Rewarded Video Ad is ready to be shown.- InitializeRewarded (EventName As String, UnitId As String)
Initialize Rewarded Video Ad.
MoPubRewardedVideo1.InitializeRewarded("MoPubRewardedVideo1", "920b6145fb1546cf8b5cf2ac34638bb7")- LoadRewardedVideo
Load Rewarded Video Ad.- ShowRewardedVideo
Show Rewarded Video Ad.
MoPub, a Twitter company, provides monetization solutions for mobile app publishers and developers around the globe. Our flexible network mediation solution, leading mobile programmatic exchange, and years of expertise in mobile app advertising mean publishers trust us to help them maximize their ad revenue and control their user experience.
This library can mediate AdMob and Facebook Audience Network trough MoPub implemented adapters.
That means 3 large networks, AdMob, Facebook and Marketplace (Mopub) compete each other for higher eCPM price = more profit for you. Network with higher ad price will show ad in your app. At any time you have full control what where and how will be shown in your app. Turning on/off some of these network in your live app is just one click away in MoPub dashboard.
If you want to use one of the best mediation network in mobile world, then use MoPub as you can customize everything, including Back fill, Direct sold ads and much much more.
Download library zip file from this link and extract archive to Additional Libraries folder. I'm not able to upload on forum, as size of file is over maximum allowed limit.
MoPub library depend on files from Facebook Audience Network Library. You need to have files in Additional Libraries folder, no need to include FAN library in your project.
v5.13 - Check manifest in MoPubExample. Manifest have some breaking changes from previous version.
v5.15 - Rewarded Video Ads, Manifest update. I'm not able to test Rewarded Video Ads. You can try by follow these steps.
Attachments
Last edited: