激励视频广告播放失败,显示错误为:
激励视频 广告显示失败
WAGame.js:1 Uncaught (in promise) {errMsg: "operateWXData:fail 系统错误,错误码:-12001,invalid scope"}
(anonymous) @ WAGame.js:1
(anonymous) @ WAGame.js:1
x @ WAGame.js:1
(anonymous) @ WAGame.js:1
(anonymous) @ gamePage.html:1
(anonymous) @ WAGame.js:1
(anonymous) @ WAGame.js:1
setTimeout (async)
setTimeout @ WAGame.js:1
(anonymous) @ gamePage.html:1
(anonymous) @ gamePage.html:1
(anonymous) @ gamePage.html:1
_ws.onmessage @ gamePage.html:1
原始代码为:
// 创建激励视频广告实例,提前初始化
if (wx.createRewardedVideoAd) {
videoAd1 = wx.createRewardedVideoAd({
adUnitId: 'adunit-a63b62488acdffd0'
})
}
// 用户触发广告后,显示激励视频广告
videoAd1.show().catch(() => {
// 失败重试
videoAd1.load()
.then(() => videoAd1.show())
.catch(err => {
console.log('激励视频 广告显示失败')
})
})
已解决。