Skip to content
Documentation menu
SDKMobile appsKotlin · Android

Methods and options

Methods

MethodBehavior
create(context, platformId, baseUrl)One client per installation. Persists installationId in SharedPreferences; reads packageName from Context.
requestAd(AdRequest): MobileAd?suspend. Fetch and cache; null on no-fill. HTTP/network errors: SidekickException/IOException.
interact(ad, action): MobileAdsuspend. Pass the original action token. The scene retains deliveryId and expiresAtMillis.
trackView(ad): Booleansuspend. For custom UI after a visible view. Test ads and local repeats return false.
close()Permanently closes the client and cancels its tasks.
SidekickAdView.load(client, request)Fetch and render. Errors/no-fill hide only the ad.
SidekickAdView.bind(client, ad)Render an existing response with automatic /seen.
appearance / screenActive / onErrorAppearance, screen activity, error callback.
clear() / release()Unmount the card / permanently dispose the View. Do not reuse a released View.

AdRequest

FieldTypeConstraint
requestIdString1-128; A-Z a-z 0-9 _ . : -
placementStringchat; 1-64; A-Z a-z 0-9 _ -
languageCodeString1-32; defaults to Locale language
acceptedFormatsSet<AdFormat>TEXT, IMAGE, RESPONSE, CARD, CONSENT, QUIZ
contextAdContext?question ≤4096; answer ≤16384
test / testFormatBoolean / AdFormat?false / null. Test platforms always return demo ads.

Cache: 64 entries and up to 64 concurrent requests. No-fill: 30 seconds; ads: until expiresAtMillis. Reusing requestId with different content is rejected.

MobileAd · AdAppearance