Method signature
The method is meant to display banner advertisements found earlier with the FAPI.UI.requestBannerAds method.
The method makes the banner block with banner advertisements displayed on it visible. The position of the banner block is regulated by the “position” parameter. For example, bar format supports following position options:
- bottom: the banner is displayed at the bottom of the device screen (default value);
- top: the banner is displayed at the top of the device screen.
Complete list of supported formats is available with FAPI.UI.getBannerFormats method.
To set a format FAPI.UI.setBannerFormat method should be used.
Banner size
The size of the banner displayed upon the call of the method depends on following parameters:
- current platform;
- android OK app version;
- current mobile device layout.
For each platform, the banner size for each state of the user’s device screen is predetermined.
Platform | Format | Display layout | Width | Height |
android | bar | portrait | 100% | 106dp |
android | bar | landscape | 362dp | 106dp |
mobile web | bar | portrait | 404px | 106dp |
mobile web | bar | landscape | 404px | 106dp |
web | bar | - | 404px | 96px |
android | bar_outer | portrait | 100% | 106dp |
android | bar_outer | landscape | 100 | 106dp |
mobile web | bar_outer | portrait | 100% | 96px |
mobile web | bar_outer | landscape | 100% | 96px |
web | bar_outer | - | 100% | 96px |
android | thin | landscape | 100% | 56dp |
mobile web | thin | landscape | 100% | 48px |
web | thin | - | 404px | 48px |
android | thin_outer | landscape | 100% | 56dp |
mobile web | thin_outer | landscape | 100% | 48px |
web | thin_outer | - | 100% | 48px |
android | vertical | landscape | 120dp | 202dp-284dp |
mobile web | vertical | landscape | 104px | 276px |
web | vertical | - | 240px | 400px |
android | vertical_outer | landscape | 120dp | 100% |
mobile web | vertical_outer | landscape | 104px | 100% |
web | vertical_outer | - | 240px | 400px |
Showing multiple banners at once
If you’ve chosen to show multiple banners at once with FAPI.UI.setBannersCount method be aware that in additional to multiple banners there will be a 16px margin between them.
Call example
Callback example
As a result of a call, a callback with a notification on an event that happened will be returned to the game. Possible callbacks are described below.
A callback for a case when the advertisement block was displayed
method: “showBannerAds”
result: “ok”
data: “true”
A callback for a case when the advertisement block did not start displaying
method: “showBannerAds”
result: “ok”
data: “false”