Incentive video advertisements need to allow users to actively choose to watch. The effect of the advertisement is to issue rewards to users after watching the video advertisement.
Usage scenarios include but are not limited to:
Template rendering of rewarded video ads: Provided by default
SDK rendering rewarded video ads: has been recycled and no longer provides creation
Remarks: There is no difference in the advertising request method for template rendering rewarded video and SDK rendering rewarded video, only the difference in request parameters.
In the incentive video request method of template rendering, the setExpressViewAcceptedSize parameter needs to be set. The value set is greater than 0.
Template rendering request AdSlot
SDK rendering request AdSlot
Parameter description
Method name | Method introduction |
setCodeId() | The code ID created by the platform starts with 9 and 9 digits |
setRewardName() | The reward name (optional) is consistent with the creation code. Obsolete in 3300 and above |
setRewardAmount() | The reward quantity (optional) is the same as the one filled in the creation code position. Obsolete in 3300 and above |
setExpressViewAcceptedSize() | Set the size of the requested template creative. Unit: dp, the value set is greater than 0 (required for template ads) |
setUserID() | tag_id |
setMediaExtra() | User transparent transmission information (optional) only supports a single json object format, and json objects cannot be nested |
setOrientation() | It is expected that the playback direction of the video is consistent with the direction checked in the creation code bit (required) |
Note: The template rendering code bit setExpressViewAcceptedSize is required, and the SDK template rendering code bit ID should not be passed.
Method | Parameter | Description |
void setRewardAdInteractionListener(TTRewardVideoAd.RewardAdInteractionListener var1) | TTRewardVideoAd.RewardAdInteractionListener var1 | Method description: Register a rewarded video ad callback |
void setRewardPlayAgainInteractionListener(TTRewardVideoAd.RewardAdInteractionListener var1) | TTRewardVideoAd.RewardAdInteractionListener var1 | Method description: Register for rewarded video and watch another advertisement callback |
void setDownloadListener(TTAppDownloadListener var1) | TTAppDownloadListener var1 | Method description: download callback of registered advertisement |
int getInteractionType() | NULL | Method description: |
@MainThreadvoid showRewardVideoAd(Activity var1) | Activity var1 | Method description: Display rewarded video advertisement interface |
Map<String, Object> getMediaExtraInfo() | NULL | Method description: return additional advertising information |
void showRewardVideoAd(Activity var1, RitScenes var2, String var3) | Activity var1, RitScenes var2, String var3 | Method description: Display rewarded video advertisement interface |
void setShowDownLoadBar(boolean var1) | boolean var1 | Method description: set display download bar |
int getRewardVideoAdType() | NULL | Method description: get the interactive type of the advertisement |
long getExpirationTimestamp() | NULL | Method description: Return the expiration time of the validity period. After this point in time, the advertisement is regarded as expired. |
public interface RewardAdInteractionListener () | NULL | RewardAdInteractionListener description |
Parameter | Description |
onAdShow() | Ad show callback |
onAdVideoBarClick() | Advertisement download bar click callback |
onAdClose() | Ad close callback |
onVideoComplete() | Video playback complete callback |
onSkippedVideo() | Skip video playback callback |
onRewardVerify() | Reward verification callback, Developers need to issue rewards in this callback |
Parameter | Description |
onError() | Advertisement request failed callback The returned error code (code) indicates the reason why the advertisement request failed. For details, please see链接 |
onRewardVideoCached() | Callback for the completion of the local loading of the ad video, the local video can be played directly after this callback |
onRewardVideoCached(TTRewardVideoAd ad) | The callback for the completion of the local loading of the ad video, the local video can be played directly after the callback, and the parameter object can be used to play directly |
onRewardVideoAdLoad() | Callback when ad loading is complete |
Note: In order to ensure the smooth playback of advertising video, it is recommended to call the showRewardVideoAd method in the main thread to display the advertisement after the onRewardVideoCached callback is loaded. After displaying the advertisement, set the advertisement object to null in time
onRewardVerify Callback description:
Summary: The onRewardVerify callback is only a result of the video playback status or the result returned by the developer, and does not represent advertising business indicators such as whether the playback is billed or not.
Parameter | Description |
rewardVerify | Is it valid |
rewardAmount | The number of rewards, the value configured when the media platform creates the code bit |
rewardName | Reward name, the name configured when the media platform creates the code bit |
code | Error code. New in version 3300 |
msg | msg error message. New in version 3300 |
Note: Add int code, String msg parameters in the onRewardVerify callback method of SDK3300 version
Need server judgment: the award can be issued based on rewardVerify as the judgment condition
No server judgment is required: rewardVerify returns true by default. The code bit of the test status rewardVerify returns false by default.
Refer to this document for reward distribution logic: Link
The server-to-server callback allows you to determine whether to provide rewards to users who watch the ad. When the user has successfully watched the ad, a verification request will be sent to the verification interface you configured in the CSJ platform, and the developer will determine whether the user will be rewarded for this viewing.
Key Note: The CSJ server only transmits the verification request transparently, and does not add verification logic in the intermediate process. In order to protect the interests of developers and user experience, developers can add their own verification logic in the verification process.
The CSJ server will request the callback link of the third-party service by GET method, and splicing the following parameters to return:user_id=%s&trans_id=%s&reward_name=%s&reward_amount=%d&extra=%s&sign=%s
Field name | Field definition | Field type | Remarks |
sign | Signature | string | Signature |
user_id | tagid | string | Call SDK to pass through |
trans_id | Transaction | string | The unique transaction ID that completed the watch |
reward_amount | rewardAmount | int | The value configured when the media platform creates the code bit |
reward_name | rewardName | sting | The name configured when the media platform created the code bit |
extra | Extra | string | Call the SDK to pass in and pass it through, or empty if not needed |
appSecurityKey: The key you obtained from the newly created reward video code bit on the CSJ media platform
transId:Transaction id
Python Example:
Field name | Field definition | Field type | Remarks |
isValid | Check result | bool | Judgment result, whether to issue rewards |
Note:
According to SDK requirements, the callback url that needs to be judged by the server is a get request. The default return is a json string {"isValid": true}
Example:
For rewarded video ads, please refer to RewardVideoActivity
in Demo
Online Customer Service24/7 Online Customer Service BotManual customer service, weekdays 10~ 12 o'clock/14~ 19 o'clock