potatojam/defold-ads-wrapper/ads_wrapper.events
Ads Wrapper response results, response codes and debug verbosity levels, as hashes.
- GitHub: potatojam/defold-ads-wrapper — pinned to
1.5.1- Pick a release from potatojam/defold-ads-wrapper releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as events from "ads_wrapper.events"
- Pick a release from potatojam/defold-ads-wrapper releases and add its Source code (zip) URL (or a packaged
Variables
ABORT: Hash
Result a network step returns to stop the queue early; the callback receives it as SUCCESS.
SUCCESS: Hash
response.result when the call succeeded.
ERROR: Hash
response.result when the call failed.
C_SKIPPED: Hash
response.code when the rewarded ad was skipped.
C_ERROR_UNKNOWN: Hash
response.code for an unknown error.
C_ERROR_AD_BLOCK: Hash
response.code when an ad blocker caused the error.
C_ERROR_NO_CONNECTION: Hash
response.code when there is no internet connection.
V_NONE: Hash
queue.set_verbose_mode level that logs nothing; the default.
V_ERROR: Hash
queue.set_verbose_mode level that logs every error.
V_SUCCESS: Hash
queue.set_verbose_mode level that logs every success response.
V_ALL: Hash
queue.set_verbose_mode level that logs every message.
Types
ads_network
ads_network.setup(params?: unknown | undefined)
Api setup
Parameters
params?:unknown | undefined
ads_network.init(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Initializes admob sdk.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.request_idfa(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Requests IDFA
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.is_supported(): boolean
Check if the environment supports admob api
Returns
boolean
ads_network.is_initialized(): boolean
Check if the admob is initialized
Returns
boolean
ads_network.show_rewarded(callback?: ads_callback | undefined, params?: unknown)
Shows rewarded ads.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:unknown— additional parameters
ads_network.load_rewarded(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Loads rewarded ads
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.is_rewarded_loaded(params?: LuaTable | undefined): boolean
Check if the rewarded ads is loaded
Parameters
params?:LuaTable | undefined— additional parameters
Returns
boolean
ads_network.show_interstitial(callback?: ads_callback | undefined, params?: unknown)
Shows interstitial ads.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:unknown— additional parameters
ads_network.load_interstitial(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Loads interstitial ads
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.is_interstitial_loaded(params?: LuaTable | undefined): boolean
Check if the interstitial ads is loaded
Parameters
params?:LuaTable | undefined— additional parameters
Returns
boolean
ads_network.is_banner_setup(): boolean
Check if the banner is set up
Returns
boolean
ads_network.load_banner(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Loads banner. Use ads.T_BANNER parameter.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.unload_banner(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Unloads active banner.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.is_banner_loaded(params?: LuaTable | undefined): boolean
Check if the banner is loaded
Parameters
params?:LuaTable | undefined— additional parameters
Returns
boolean
ads_network.show_banner(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Shows loaded banner.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.hide_banner(callback?: ads_callback | undefined, params?: LuaTable | undefined)
Hides loaded banner.
Parameters
callback?:ads_callback | undefined— the function is called after execution.params?:LuaTable | undefined— additional parameters
ads_network.is_banner_showed(params?: LuaTable | undefined): boolean
Check if the banner is showed
Parameters
params?:LuaTable | undefined— additional parameters
Returns
boolean