Official Content

Shows Ads (Advertising) on your applications in any place. This control is available in the Toolbox and supports several providers.

Ads View control - Toolbox

Scope

Objects: Panel, WorkWith
Generators:  AppleAndroid

Considerations

For the Android generator, you must set the Ads Provider property at the Main object level.

Design-time properties

Specific properties are available depending on the value selected for the Ads Provider property.

When Ads Provider property = 'AdMob'

Property Description
Ad Unit Id property Identifier of the Ad that this control will display on the screen. This ad must be a Banner.
Refer to HowTo: Get AdMob Unit Id for advertising in Native Mobile Applications.


When Ads Provider property = 'GoogleMobileAds'

Property Description
Ad Unit Id property Identifier of the Ad that this control will display on the screen. This ad must be a Banner.
Refer to Google Ad Manager - Get Started.

Run-time properties

AdUnitId

Changes the Ad Unit Id design-time property at run-time. Its value must be character-based. Available when Ads Provider property has AdMob value.

image_2018328113413_1_png

Methods

RequestAd

It forces the request for a new Ad in a specific time.
Return value None
Parameters None

Sample

First, turn on the Enable Ads property for the Main Object for Native Mobile applications.
Then drag (at least) one Ads View control from the toolbox inside the layout of a Panel object.

After that, you must set its properties properly depending on the provider.
In this case, because the provider is AdMob, the identifier of the ad (occasionally more than one and different from each other).

SD Ads View control - Properties

In this case, include a fixed ad on the bottom of the screen. You can do it by setting its properties on the Panel.

Finally, run your application and wait until your ads are displayed.

SD Ads View control - Runtime

Note how the controls on the edges of the screen are displayed and there is a fixed advertisement on the bottom.

Notes

  • With the mechanism described here, you can include an Ad where you want. In the mechanism described in the Ads (Advertising) article, the default behavior is that every Panel contains an ad unless Show Ads property is disabled for those Panels that you don't want to show an ad.
  • You can include multiple Ads View controls on the same Panel object. In addition, you can set the Show Ads and Ads Position properties (at the Panel level) to display them in a fixed position.


Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant