Version: stable
| CONSTANTS | |
|---|---|
| COMMERCIAL_BREAK_SUCCESS | |
| COMMERCIAL_BREAK_START | |
| REWARDED_BREAK_ERROR | |
| REWARDED_BREAK_SUCCESS | |
| REWARDED_BREAK_START |
poki_sdk.gameplay_start()
Signals that gameplay has started.
PARAMETERS
None
poki_sdk.commercial_break(callback)
Requests a commercial break. The callback reports START if an ad starts and SUCCESS when Poki's commercial-break promise resolves.
PARAMETERS
callback |
function |
|
poki_sdk.rewarded_break(size,callback)
Requests a rewarded break. The size argument is optional and defaults to small. Call it as rewarded_break(callback) or rewarded_break(size, callback).
PARAMETERS
size |
string |
Optional reward size. Accepted values are small, medium, and large. Defaults to small. | ||||||
callback |
function |
|
poki_sdk.set_debug(is_debug)
Enables or disables Poki SDK debug mode.
PARAMETERS
is_debug |
boolean |
poki_sdk.capture_error(error)
Captures and reports an error to Poki.
PARAMETERS
error |
string |
poki_sdk.is_ad_blocked()
Deprecated: Poki no longer exposes ad-block detection. This compatibility function always returns false.
PARAMETERS
None
RETURNS
boolean |
Always false. |
poki_sdk.shareable_url(params,callback)
Generates a shareable URL with the supplied parameters.
PARAMETERS
params |
table |
String or number values to include in the generated URL. | ||||||
callback |
function |
|
poki_sdk.get_url_param(key)
Returns the URL parameter value provided by Poki. The Defold bridge maps a null or undefined result to nil.
PARAMETERS
key |
string |
RETURNS
stringnil |
The parameter value, or nil when the Poki result is null or undefined. |
poki_sdk.measure(category,what,action)
Sends a custom analytics event to Poki. Use start/complete/fail for progress, visible/interact for offer and UI engagement, or a custom action for other events. Do not duplicate commercial or rewarded ad playback and outcomes; Poki tracks those through the ad calls. The binding defaults omitted `what` and `action` to empty strings for compatibility.
PARAMETERS
category |
string |
|
what |
stringnil |
Optional event subject. Defaults to an empty string when omitted. |
action |
stringnil |
Optional event action. Defaults to an empty string when omitted. |
poki_sdk.move_pill(topPercent,topPx)
Moves the Poki pill to a different vertical position.
PARAMETERS
topPercent |
number |
Position from the top in percent. |
topPx |
number |
Additional position offset in pixels. |
poki_sdk.get_user(callback)
Retrieves the currently logged-in Poki user.
PARAMETERS
callback |
function |
|
poki_sdk.get_token(callback)
Retrieves the Poki auth token for the currently logged-in user.
PARAMETERS
callback |
function |
|
poki_sdk.login(callback)
Prompts the player to log in to their Poki account.
PARAMETERS
callback |
function |
|
poki_sdk.open_external_link(url)
Opens an external link in a new browser tab for user-initiated external navigation.
PARAMETERS
url |
string |