Skip to content

241.[微信小程序]微信小程序——插屏广告 #241

Description

@webVueBlog

[微信小程序]

letinterstitialAd=nullPage({onLoad(){if(wx.createInterstitialAd){//1.创建广告实例interstitialAd=wx.createInterstitialAd({adUnitId: 'xxxx'})//3.监听广告,广告显示出来以后你要做的操作interstitialAd.onLoad(()=>{console.log('onLoad event emit')})//其实可以不用管这个onError,它的作用是如果广告拉取失败,就提示你interstitialAd.onError((err)=>{console.log('onError event emit',err)})//广告关闭时,触发。interstitialAd.onClose((res)=>{console.log('onClose event emit',res)})}//2.让广告显示出来interstitialAd.show().catch((err)=>{console.error(err)})}})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions