Banners: Yes2SDK.banners

← Back to overview

Positioned display banners with explicit container IDs and sizes. Distinct from the simple top/bottom banner in the ads module. This module manages multiple named banners.

Available on CrazyGames and Yandex. On Yandex this is a single sticky banner: placement and size are managed for you, and refreshBanners re-displays it.


Methods (Core)

SignatureDescription
showBanner(id: string, size: string, x?: number, y?: number): Promise<void>Show a banner at an optional (x, y). id/size non-empty (size e.g. "300x250").
hideBanner(id: string): voidHide a specific banner by ID.
hideAllBanners(): voidHide all displayed banners.
refreshBanners(): voidRefresh all displayed banners.
getBannerStatusAsync(): Promise<BannerStatus>Query the current banner display status. Resolves { isShowing: false } where there's no status API.
isSupported(): booleanWhether banners are supported.

BannerStatus = { isShowing: boolean; reason?: string } (reason carries the platform-supplied reason a banner is not showing, e.g. Yandex 'ADV_IS_NOT_CONNECTED').

Documented sizes: "300x250" | "728x90" | "320x50" | "468x60" | "160x600" (the param is typed string, so other values are accepted).


Platform support

MethodPokiGameDistributionCrazyGamesYandexYouTube
showBannerNoneNoneReadyReady¹None
hideBannerNoneNoneReadyReady¹None
hideAllBannersNoneNoneReadyReadyNone
refreshBannersNoneNoneReady²Partial³None
getBannerStatusAsyncNoneNonePartial⁴Ready⁵None
isSupportedNoneNoneReadyReadyNone

¹ Yandex maps to a single sticky banner (ysdk.adv.showBannerAdv); id/size are ignored. ² CrazyGames refreshBanners if the SDK version exposes it (warns otherwise). ³ Yandex has no native refresh: emulated via hide-then-show. ⁴ CrazyGames has no banner status query: always resolves { isShowing: false, reason: "STATUS_QUERY_NOT_SUPPORTED" }. ⁵ Yandex maps to ysdk.adv.getBannerAdvStatus() (live state, with a platform reason).


Unity (C#)

Yes2SDK.Banners. Uses a BannerSize enum (serialized to JS via .ToString()).

SignatureDescription
void ShowBanner(string id, BannerSize size, Action onSuccess = null, Action<Error> onError = null)
void HideBanner(string id)
void HideAllBanners()
void RefreshBanners()
bool IsSupported()Editor: false.

BannerSize: Leaderboard_728x90, Medium_300x250, Mobile_320x50, Main_468x60, Large_Mobile_320x100.


Defold (Lua)

SignatureDescription
yes2sdk.banners_show(id, size)
yes2sdk.banners_hide(id)
yes2sdk.banners_hide_all()
yes2sdk.banners_is_supported()Boolean (default false).
Pitch your game