HomeDocs
Skip to main content

Banner Ad Component

Introduction

Banner ad component.

Attribute Description

Attribute NameTypeRequiredDefault ValueDescriptionLowest Supported Version
app-idstringYesTotal application ID of mini-program (obtained from hisavana platform configuration)2.2.0
code-seat-idstringYesID of code seat for mini-program (obtained from hisavana platform configuration)2.2.0
code-seat-typestringYes2Banner/banner, please set it to "2". If randomly filled in, the ad request might fail2.2.0
bindloadeventhandleNoCallback when ad is loaded successfully2.2.0
binderroreventhandleNoCallback when ad loading fails2.2.0
bindcloseeventhandleNoCallback when ad is closed2.2.0

Ad Type Explanation

ValueTypeExplanation
1stringNative/original
2stringBanner/banner
3stringInterstitial
4stringSplash screen, currently not supported
5stringRewarded 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");
},
});
Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.