AdMobBanner

The AdMob item allows monetizing your app by embedding AdMob ads on Android and iOS. More...

Import Statement: import VPlayPlugins.admob 1.0
Inherits:

Item

Properties

Signals

Detailed Description

Ad banners can be used to display ads within your app without distracting your user from the app's main functionality. If you just want to include simple banner ads into your apps, Smart Banners are probably the right thing for you. They are versatile, support all device types and sizes and are really easy to use, see Example Usage for a simple example.

AdMob also offers a range of different-sized banners, which you can incorporate into your apps and games. Please note that some of the available sizes can only be used on tablets due to their dimensions.

Banners get only loaded if the QML item is visible, menaing that it's visible property is not set to false and all its parent items are visible too.

If AdMobBanner.Smart is set as banner type the banner will automatically resize to the full width on screen orientation changes.

For more information also have a look at AdMob Plugin.

Property Documentation

adUnitId : string

Provide your Ad unit ID retrieved from the AdMob console in the format ca-app-pub-xxxxxxxxxxxxxxxx/xxxxxxxxxx here. If you do not have an AdMob account yet, you can create a new one at http://www.google.com/ads/admob/. Once you are logged in, you can acquire a new Ad unit ID by creating a new app and defining a new ad unit.


This enum type defines what kind of banner should be displayed.

  • AdMobBanner.None - No Banner is displayed
  • AdMobBanner.Standard - A standard banner of size 320 x 50
  • AdMobBanner.Medium - A medium banner of size 300x250
  • AdMobBanner.Large - A large banner of size 468x60
  • AdMobBanner.LeaderBoard - A leaderboard-sized banner of size 728x90
  • AdMobBanner.Smart - A auto-resizing smart banner (recommended)

The default banner is AdMobBanner.None.

Note: Please keep in mind that some banners might be too large for displaying on some devices and therefore won't be displayed. It's recommended to use the AdMobBanner.Smart banner size for apps targeted for multiple device types.


childDirectedTreatment : bool

Set this property to true if you want to indicate that you want Google to treat your content as child-directed. Google will then take steps to disable IBA and remarketing ads for your ads.

More information can also be found here.


designedForFamilies : bool

Set this property to true if you have opted your app in to Google Play's Designed for Families program.

Note: This property is only applicable for Android. You need to ensure ads comply with the Designed for Families program requirements and ad policies.

More information can also be found here.


testDeviceIds : list<string>

Provide your device id as an array of string values here to receive test ads for the specific test devices.

Note: If you test your application with live ads frequently, Google might ban your account for fraud. Therefore if you are not able to provide the testDeviceIds and test with live ads instead, make sure not display the AdMob item everytime you test your app on your device.

You can find your testdeviceIds in the device log after you first run an your app with integrated AdMob plugin, search for "To get test ads on this device, call adRequest.addTestDevice".

 // Testing with live ads
 AdmobBanner {
   // if the item never gets visible, no ad request is sent
   // set this to true when you need the ad for you device test or when publishing!
   visible: false;
 }

Signal Documentation

onAdClosed()

This handler is called when the application was moved to background to display an ad e.g. in the browser and the user returns from the browser.


onAdFailedToReceive()

This handler is called either because of a network error or when an ad should be displayed, but AdMob can't find an ad that fits your application. A possible reason for this can be the filter settings in your AdMob account, or that AdMob does not have any related ads in your country.


onAdLeftApplication()

This handler is called when a banner is clicked and the application will be moved to the background to display the ad.

See also AdMobBanner::onAdOpened.


onAdOpened()

This handler is called when a banner is clicked and e.g. a new browser window will be opened by the ad soon.

See also AdMobBanner::onAdLeftApplication.


onAdReceived()

This handler is called as soon as the requested ad is loaded and displayed on the screen.


Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support