当前位置:网站首页>The problem of multiple callback of video ads stimulated by applets (offcolse problem)

The problem of multiple callback of video ads stimulated by applets (offcolse problem)

2022-06-25 00:24:00 Mr, Guo

The small program inspires the video advertisement to call back many times (offColse problem )

Developing tiktok applet ( The same is true for wechat applets ), Watch multiple ad videos , Back to repeat callback , Cause the problem of sending rewards repeatedly , Official documents demo Too simple , This place is a waste of time in self-development , break out Demo Let's avoid detours

   let videoAd = tt.createRewardedVideoAd({
    
        adUnitId: " Your advertisement id",
    });
      try{
    
          if(videoAd.closeHandler){
    
            videoAd.offClose(videoAd.closeHandler);
            console.log("videoAd.offClose Uninstall successfully ");
          }
      } catch (e) {
    
          console.log("videoAd.offClose  Uninstall failed ");
          console.error(e);
      }
      videoAd.closeHandler= function (res) {
    
          //  The user clicked 【 Close advertising 】 Button 
          if (res && res.isEnded || res === undefined) {
    
              //  End of normal playback , Game rewards can be distributed 
              console.log(" Play finished ");
          } else {
    
              // Close applet in advance 
          }
      };
      videoAd.onClose(videoAd.closeHandler);
原网站

版权声明
本文为[Mr, Guo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210548307031.html