The CAS.AI (CleverAdsSolutions) extension lets you display banner, interstitial and rewarded ads.
Official website https://cas.ai Official andrdoid documentation https://github.com/cleveradssolutions/CAS-Android/wiki
NOTE: Banners are not implemented. Extension supports Android only for now.
Open game.project
and add a new entry to the dependencies
property:
https://github.com/Lerg/extension-cas/archive/master.zip
Then select Project -> Fetch Libraries
to download the extension in your project.
If you are using Admob you need to set the AdMob App Id for your iOS and/or Android app in game.project
. To do so open your game.project
and add these lines:
[cas]
admob_android_app_id = ca-app-pub-***~***
To control which ad providers are integrated add these lines to the [cas]
section in game.project
:
adcolony_android = 1
admob_android = 1
applovin_android = 1
bigo_android = 1
charboost_android = 1
facebook_android = 1
fyber_android = 1
hyprmx_android = 1
inmobi_android = 0
ironsource_android = 1
kidoz_android = 0
liftoff_android = 1
mintegral_android = 1
mytarget_android = 0
pangle_android = 1
superawesome_android = 0
unityads_android = 1
yandex_android = 1
Replace ca-app-pub-***~***
with your app ids. It can now be viewed or changed in the normal view of the game.project
file.
Initializes the extension. This function has to be called first before trying to show any ads.
params
: table Contains parameters for the call — see the next section for details.id
: string CAS application ID.disable_banner
: boolean Iftrue
no banners loading.disable_interstitial
: boolean Iftrue
no interstitial loading.disable_rewarded
: boolean Iftrue
no rewarded loading.test_device
: string Test device ID to enable testing on this device.test
: boolean Iftrue
the test ads will be served. ALWAYS use the test ads during development.debug
: boolean Iftrue
additional debug messages.listener
: function The callback function which receives all CAS events.
Prints to console SDK integration information.
Loads a specified ad type. No need to call this function, the ads is loaded automatically.
ad_type
: numbercas.BANNER
,cas.INTERSTITIAL
orcas.REWARDED
.
Returns true
if the specified ad type has been loaded.
ad_type
: numbercas.BANNER
,cas.INTERSTITIAL
orcas.REWARDED
.- return:
is_loaded
: boolean.
Displays a loaded ad.
ad_type
: numbercas.BANNER
,cas.INTERSTITIAL
orcas.REWARDED
.
Removes a loaded banner from the screen.
Changes settings.
-
param
: number Parameter id. -
value
: number|boolean|table Value id or value itself. -
cas.TAGGED_AUDIENCE
:cas.AUDIENCE_CHILDREN
cas.AUDIENCE_NOT_CHILDREN
cas.AUDIENCE_UNDEFINED
-
cas.USER_CONSENT
:cas.CONSENT_ACCEPTED
cas.CONSENT_DENIED
-
cas.CCPA
:cas.CCPA_OPT_IN_SALE
cas.CCPA_OPT_OUT_SALE
-
cas.TARGETING_GENDER
:cas.GENDER_UNKNOWN
cas.GENDER_MALE
cas.GENDER_FEMALE
-
cas.TARGETING_AGE
:value
: number Age as a number.
-
cas.TARGETING_KEYWORDS
:value
: table Array of string keywords.
-
cas.MUTED_AD_SOUNDS
:value
: boolean Muted iftrue
.
phase
: number Event phase.type
: number Event type.
phase
:cas.INIT
type
:cas.INIT
protection_applied
: boolean.user_country_iso2O
: string Nullable.error
: string Nullable.
phase
:cas.LOADED
cas.FAILED_TO_LOAD
type
:cas.BANNER
cas.INTERSTITIAL
cas.REWARDED
.
phase
:cas.SHOWN
cas.FAILED
cas.CLICKED
cas.COMPLETE
cas.CLOSED
type
:cas.INTERSTITIAL
cas.REWARDED
If you like this extension please consider supporting me on Patreon https://patreon.com/Lerg