Native Ad Component
Introduction
Native ad component.
Attribute Description
| Attribute Name | Type | Required | Default | Description | Minimum Version |
|---|---|---|---|---|---|
| app-id | string | Yes | Total application ID for the mini program (obtained from hisavana platform configuration) | 2.2.0 | |
| code-seat-id | string | Yes | Code seat ID for the mini program (obtained from hisavana platform configuration) | 2.2.0 | |
| code-seat-type | string | Yes | 1 | Native ad component, set as "1"; filling any other value may lead to ad request failure | 2.8.0 |
| bindload | EventHandle | No | Callback for successful ad loading. | 2.2.0 | |
| binderror | EventHandle | No | Callback for failed ad loading. | 2.2.0 | |
| bindclose | EventHandle | No | Callback for ad closing. | 2.2.0 |
Ad Type Description
| Value | Type | Description |
|---|---|---|
| 1 | string | Native ad component |
| 2 | string | Banner ad |
| 3 | string | Interstitial ad |
| 4 | string | Splash ad |
| 5 | string | Rewarded Video ad |
Example
<!-- pages/index/index.dlt -->
<view>
<ad
code-seat-id="xxx"
app-id="xxx"
code-seat-type="1"
bind:binderror="handleAdError"
>
</ad>
</view>
// pages/index/index.js
Page({
handleAdError() {
console.log("ad error");
},
});