添加插屏广告IDE报:removeTextView:fail 或 insertTextView:fail问题试分析

发布于 4 年前作者 guiyingjiang3043 次浏览最后编辑 4 年前来自 share
let interstitialAd = null
Page({
  onLoad() {
    if(wx.createInterstitialAd){
      interstitialAd = wx.createInterstitialAd({ adUnitId: 'xxxx' })
      interstitialAd.onLoad(() => {
        console.log('onLoad event emit')
      })
      interstitialAd.onError((err) => {
        console.log('onError event emit', err)
      })
      interstitialAd.onClose((res) => {
        console.log('onClose event emit', res)
      })
    }
  }
})

大致原因就在于官方这个close函数是没有返回值的,如果监听将会报错。

在小程序管理平台里的代码是没有返回值的,可能是官方文档还没有更新。

2 回复
chao43
chao431 楼4 年前
你的意思就是不写onClose,onError   就什么问题都没了?
jing52
jing522 楼3 个月前

论坛崩了吗?发不了帖子