-
Notifications
You must be signed in to change notification settings - Fork 3
reward_video
This module contains functions for rewarded video ads.
This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.
AdMob_RewardedVideo_Init⛔- AdMob_RewardedVideo_Set_AdUnit
- AdMob_RewardedVideo_Free_Load_Instances
- AdMob_RewardedVideo_Max_Instances
- AdMob_RewardedVideo_Load
- AdMob_RewardedVideo_Show
- AdMob_RewardedVideo_IsLoaded
- AdMob_RewardedVideo_Instances_Count
⛔ This function was deprecated with version 1.3.0.
This function initialises the target identifier for rewarded video ad functions.
Note
Please refer to AdMob_RewardedVideo_Set_AdUnit for more information.
Syntax:
AdMob_RewardedVideo_Init(adUnitId)
Argument | Type | Description |
---|---|---|
adUnitId | String |
Returns:
N/A
Versioning:
-
1.3.0
- ⛔ This function was deprecated.
This function sets the target identifier for rewarded video functions. Rewarded video functions allow multiple identifiers.
Syntax:
AdMob_RewardedVideo_Set_AdUnit(adUnitId)
Argument | Type | Description |
---|---|---|
adUnitId | String |
Returns:
N/A
Versioning:
-
1.3.0
- This function was introduced.
This function releases the requested number of Rewarded Video load instances.
Syntax:
AdMob_RewardedVideo_Free_Load_Instances(count)
Argument | Type | Description |
---|---|---|
count | Real | The number of instances to release (-1 will free all the loaded instances) |
Returns:
N/A
Versioning:
-
1.3.0
- This function was introduced.
This function sets the max number of Rewarded Video load instances, this allows you to present consecutive ads. Default value is 1.
Syntax:
AdMob_RewardedVideo_Max_Instances(count)
Argument | Type | Description |
---|---|---|
count | Real | The maximum number of instances |
Returns:
N/A
Versioning:
-
1.3.0
- This function was introduced.
This function should be called when you want to load a rewarded video ad. Calling it will send a request to the ad server to provide a rewarded ad, which will then be loaded into the app for display.
This function does not show the ad, just stores it in memory ready for showing. If you do not call this function before trying to show an ad, nothing will be shown.
Note
You can check whether a rewarded video is loaded or not using the function AdMob_RewardedVideo_IsLoaded.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
AdMob_RewardedVideo_Load()
Returns:
Triggers:
This event is triggered if the awaited task fails.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_LOAD_FAILED
|
unit_id | String | Unit identifier of the advertisement |
errorMessage | String | the error code responsible for the failure |
errorCode | Real | the error message of the error code |
This event is triggered if the awaited task succeeds.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_LOADED
|
unit_id | String | Unit identifier of the advertisement |
This function will show the next rewarded video ad, if one is available and loaded. You can check whether an ad has previously been loaded using the function AdMob_RewardedVideo_IsLoaded.
Note
While a rewarded video ad is being shown, your app will be put into the background and will effectively be "paused".
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.
Syntax:
AdMob_RewardedVideo_Show()
Returns:
Triggers:
This event is triggered when the ad view is closed by the user.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_DISMISSED
|
unit_id | String | Unit identifier of the advertisement |
This event is triggered if the awaited task fails.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_SHOW_FAILED
|
unit_id | String | Unit identifier of the advertisement |
errorMessage | String | the error code responsible for the failure |
errorCode | Real | the error message of the error code |
This event is triggered if the awaited task succeeds.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_SHOWED
|
unit_id | String | Unit identifier of the advertisement |
This event is triggered if the user should be rewarded.
Key | Type | Description |
---|---|---|
type | AdMobEvent | The constant ADMOB_EV_REWARDED_REWARD
|
unit_id | String | Unit identifier of the advertisement |
This function returns whether a rewarded video ad has been loaded or not.
Syntax:
AdMob_RewardedVideo_IsLoaded()
Returns:
This function returns the number of Rewarded video load instances that are ready.
Syntax:
AdMob_RewardedVideo_Instances_Count()
Returns:
Versioning:
-
1.3.0
- This function was introduced.
YoYoGames 2024