Method signature
The method is meant to display banner advertisements found earlier with the FAPI.UI.requestBannerAds method.
FAPI.invokeUIMethod("showBannerAds")
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:
- 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.
Banner size
The size of the banner displayed upon the call of the method depends on following parameters:
- platform (Android only at the moment);
- type of display of the user’s device screen.
For each platform, the banner size for each state of the user’s device screen is predetermined.
Android platform
Banner size for landscape orientation:
- width: 362 dp;
- height: 106 dp.
Banner size for portrait orientation:
- width: 100% of the screen;
- height: 106 dp.
Call example
function showBannerAds() {
FAPI.invokeUIMethod("showBannerAds", "top")
}
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”