Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

AdMobInterstitial

The AdMobInterstitial item allows monetizing your app with fullscreen interstitial ads on Android and iOS. More...

Import Statement: import Felgo 4.0
Inherits:

PluginItem

Properties

Signals

Methods

Detailed Description

Interstitials are full-screen ads with interactive content that can be presented to the user e.g. when a level of a game was completed. Since they do not take away precious screen space while the game is running, they are perfectly suitable for games.

 import Felgo

 App {
   NavigationStack {
     AppPage {
       title: "Admob Interstitial"

       AdMobInterstitial {
         adUnitId: "ca-app-pub-3940256099942544/1033173712" // interstitial test ad by AdMob
         testDeviceIds: [ "<your-test-device-id>" ]

         onInterstitialReceived: {
           showInterstitialIfLoaded()
         }
         onPluginLoaded: {
           loadInterstitial()
         }
       }
     }
   }
 }

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.


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.


[since Felgo 3.9.0] requestAdTrackingAuthorization : bool

Set this property to true to automatically request ad tracking authorization on iOS.

The item will ask the user for permission to use the advertising identifier (IDFA) before showing any ad. If the user accepts, ads can be attribute to them better.

The item still shows the ad even if the user denies the request.

To support the ad tracking authorization, adapt your ios/Project-Info.plist. Add the NSUserTrackingUsageDescription key with a description of usage. Example:

 <key>NSUserTrackingUsageDescription</key>
 <string>This identifier will be used to deliver personalized ads to you.</string>

You can find more information here.

Note: This property only has an effect on iOS and is ignored on other platforms.

This property was introduced in Felgo 3.9.0.


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".


Signal Documentation

interstitialClosed()

This handler is called when an interstitial is dismissed by the user.

Note: The corresponding handler is onInterstitialClosed.


interstitialFailedToReceive()

This handler is called if an interstitial can not be loaded, e.g. due to a network error.

Note: The corresponding handler is onInterstitialFailedToReceive.


interstitialLeftApplication()

This handler is called when the user clicked an interstitial, and the app is going to be moved to the background to display the ad, e.g. in a browser.

Note: The corresponding handler is onInterstitialLeftApplication.


interstitialOpened()

This handler is called when an interstitial is displayed.

Note: The corresponding handler is onInterstitialOpened.


interstitialReceived()

This handler is called after the loadInterstitial() request has finished and the interstitial is ready to display.

Note: The corresponding handler is onInterstitialReceived.

See also loadInterstitial() and showInterstitialIfLoaded().


Method Documentation

void loadInterstitial()

Call this method to start downloading an interstitial ad in the background. When finished, the interstitialReceived signal will be emitted.

See also interstitialReceived and showInterstitialIfLoaded().


void showInterstitialIfLoaded()

This method displays an interstitial ad that was previously requested via a coll to the loadInterstitial() method.

For example, it can be called directly after interstitialReceived is emitted:

 import Felgo

 App {
   NavigationStack {
     AppPage {
       title: "Admob Interstitial"

       AdMobInterstitial {
         adUnitId: "ca-app-pub-3940256099942544/1033173712" // interstitial test ad by AdMob
         testDeviceIds: [ "<your-test-device-id>" ]

         onInterstitialReceived: {
           showInterstitialIfLoaded()
         }
         onPluginLoaded: {
           loadInterstitial()
         }
       }
     }
   }
 }

See also loadInterstitial() and interstitialReceived.


Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded