Banner Ad Component
Introduction
Banner ad component.
Attribute Description
Attribute Name | Type | Required | Default Value | Description | Lowest Supported Version |
---|---|---|---|---|---|
app-id | string | Yes | Total application ID of mini-program (obtained from hisavana platform configuration) | 2.2.0 | |
code-seat-id | string | Yes | ID of code seat for mini-program (obtained from hisavana platform configuration) | 2.2.0 | |
code-seat-type | string | Yes | 2 | Banner/banner, please set it to "2". If randomly filled in, the ad request might fail | 2.2.0 |
bindload | eventhandle | No | Callback when ad is loaded successfully | 2.2.0 | |
binderror | eventhandle | No | Callback when ad loading fails | 2.2.0 | |
bindclose | eventhandle | No | Callback when ad is closed | 2.2.0 |
Ad Type Explanation
Value | Type | Explanation |
---|---|---|
1 | string | Native/original |
2 | string | Banner/banner |
3 | string | Interstitial |
4 | string | Splash screen, currently not supported |
5 | string | Rewarded video, currently not supported |
Example
<!-- pages/index/index.dlt -->
<view>
<ad
code-seat-id="xxx"
app-id="xxx"
code-seat-type="2"
bind:binderror="handleAdError"
>
</ad>
</view>
// pages/index/index.js
Page({
handleAdError() {
console.log("ad error");
},
});