当前位置: 首页 > news >正文

更新网站 是否要重启iissem营销

更新网站 是否要重启iis,sem营销,灌云网站建设,余杭区政府门户网站建设工程问题背景: 快应用中下载类原生广告监听下载状态变化接口调用没生效,在上报点击接口里触发下载监听后仅第一次返回状态,之后就不返回了,该如何处理? 问题分析: 快应用在1100版本新增了一个ad-button组件&a…

问题背景:

快应用中下载类原生广告监听下载状态变化接口调用没生效,在上报点击接口里触发下载监听后仅第一次返回状态,之后就不返回了,该如何处理?

在这里插入图片描述

问题分析:

快应用在1100版本新增了一个ad-button组件,废弃了原先的原生广告的下载类接口,改用ad-button自带的下载功能。因而在点击下载的时候开发者不知道该在何时去调用监听接口,往往都会在在nativeAd.reportAdClick()和nativeAd.reportAdShow()中调用的下载监听,这就导致出现此类似情况的时候。

解决方案:

ad-button在点击的时候就会跳转到广告页面并开启广告下载的,同时ab-button也是支持onclick点击事件的,可以把下载监听接口放到ad-button的点击事件中去。

代码:

<stack class="stackstyle" onclick="reportNativeClick()"><image if="native.isShowImg" class="img" src="{{native.adImgSrc}}"></image><ad-button class="adbtn" onclick="startButton()" valuetype="0" adunitid="{{native.adUnitId}}" adid="{{native.adData.adId}}"></ad-button></stack>
startButton(event) {console.error('start download result is = ', event.resultCode)nativeAd.onStatusChanged((data) => {console.log('onStatusChanged data = ', data)const progress = nativeAd.getDownloadProgress({adId: this.native.adData.adId})console.log('getDownloadProgress progress = ' + progress);const status = nativeAd.getAppStatus({adId: this.native.adData.adId})console.log('getAppStatus status = ' + status);})},

截图:

在这里插入图片描述

Demo:

<template><div class="item-container"><text class="alert">This is native ad demo</text><div if="native.isShow" class="container"><text style="margin-bottom: 8px">ad title :{{native.adData.title}}</text><video id="video" if="native.isShowVideo" src="{{native.adVideoSrc}}" autoplay="true" onclick="reportNativeClick()" class="ad-video"></video><stack class="stackstyle" onclick="reportNativeClick()"><image if="native.isShowImg" class="img" src="{{native.adImgSrc}}"></image><ad-button class="adbtn" onclick="startButton()" valuetype="0" adunitid="{{native.adUnitId}}" adid="{{native.adData.adId}}"></ad-button></stack><div style="flex-direction: row; width: 100%"><text style="width: 100%">ad source:{{native.adData.source}}</text><image class="closeImg" src="/Common/close.png" onclick="closeAd"></image></div></div><text if="native.isShowData">{{ native.adData }}</text><text if="native.errStr">{{ native.errStr }}</text></div></template><style>.container {flex-direction: column;margin-top: 20px;width: 100%;margin-bottom: 50px;}.stackstyle {width: 100%;height: 300px;}.img {width: 100%;resize-mode: contain;}.closeImg {width: 48px;height: 48px;flex-shrink: 0;}.alert {font-size: 40px;margin-top: 20px;margin-bottom: 20px;}.item-container {margin-top: 50px;padding: 20px;width: 100%;flex-direction: column;align-items: center;align-content: center;}.ad-video {object-fit: contain;width: 100%;height: 415px;}.btn {height: 80px;width: 60%;background-color: #00bfff;color: #ffffff;border-radius: 20px;margin-bottom: 20px;}.btn:active {background-color: #058fbd;}.adbtn {width: 200px;height: 50px;color: #ffffff;background-color: #00bfff;border-radius: 8px;position: absolute;align-self: flex-end;bottom: 20px;right: 20px;}.adbtn:active {background-color: #058fbd;}</style><script>import ad from "@service.ad";import prompt from "@system.prompt";let nativeAd;export default {data: {componentName: "ad",provider: "",native: {adUnitId: "testb65czjivt9",isShow: false,adData: {},isShowImg: true,isShowVideo: true,isShowData: true,errStr: "",btnTxt: "",adImgSrc: "https://cs02-pps-drcn.dbankcdn.com/cc/creative/upload/20191226/b750592e-04be-4132-9971-52494b1e5b43.jpg",adVideoSrc: ""}},onInit() {this.$page.setTitleBar({ text: "Native Ad" });},onReady(options) {console.info("native ad onReady");this.showNativeAd();},onShow(options) {if (this.native.isShow) {this.reportNativeShow();}},getAdProvider: function () {this.provider = ad.getProvider();prompt.showToast({message: "getProvider : " + this.provider,duration: 2000,gravity: "center"});},isDownloadAd(creativeType) {let downloadTypes = [103, 106, 107, 108, 101, 102, 110];return downloadTypes.includes(creativeType);},showNativeAd() {var that = this;this.getAdProvider();if (this.provider !== "huawei") {console.info("the device  does not support ad.");return;}nativeAd = ad.createNativeAd({ adUnitId: this.native.adUnitId });nativeAd.onLoad(data => {console.info("ad data loaded: " + JSON.stringify(data));this.native.adData = data.adList[0];if (this.native.adData) {if (this.native.adData.imgUrlList) {this.native.adImgSrc = this.native.adData.imgUrlList[0];console.info(" this.native.adImgSrc =" + this.native.adImgSrc);this.native.isShowImg = true;} else {this.native.isShowImg = false;this.native.adImgSrc = "";}if (this.native.adData.clickBtnTxt) {this.native.btnTxt = this.native.adData.clickBtnTxt;} else {this.native.btnTxt = "";}if (this.native.adData.videoUrlList && this.native.adData.videoUrlList[0]) {this.native.adVideoSrc = this.native.adData.videoUrlList[0];this.native.isShowVideo = true;} else {this.native.isShowVideo = false;this.native.adVideoSrc = "";}this.native.isShow = true;this.native.errStr = "";this.reportNativeShow();}});nativeAd.onError(e => {console.error("load ad error:" + JSON.stringify(e));this.native.isShowImg = false;this.native.isShowVideo = false;this.native.isShow = false;this.native.errStr = JSON.stringify(e);});nativeAd.load();},reportNativeShow() {if (nativeAd) {nativeAd.reportAdShow({ adId: this.native.adData.adId });}},reportNativeClick() {nativeAd.reportAdClick({adId: this.native.adData.adId});},listenNativeAdDownloadStatus(downloadstatus) {if (downloadstatus === "INSTALLED") {this.native.btnTxt = "OPEN";}},startButton(event) {console.error('start download result is = ', event.resultCode)nativeAd.onStatusChanged((data) => {console.log('onStatusChanged data = ', data)const progress = nativeAd.getDownloadProgress({adId: this.native.adData.adId})console.log('getDownloadProgress progress = ' + progress);const status = nativeAd.getAppStatus({adId: this.native.adData.adId})console.log('getAppStatus status = ' + status);})},removeAdListen: function () {if (nativeAd) {nativeAd.offDownloadProgress();nativeAd.offError(() => {console.log("nativeAd offError");});nativeAd.offLoad(() => {console.log("nativeAd offLoad");});nativeAd.offStatusChanged();}},onDestroy() {if (nativeAd) {nativeAd.destroy();}},closeAd: function () {this.native.isShow = false;}};</script>

欲了解更多更全技术文章,欢迎访问 https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh


文章转载自:
http://dinncobackbitten.bkqw.cn
http://dinncorubbly.bkqw.cn
http://dinncomanagerial.bkqw.cn
http://dinncobaikal.bkqw.cn
http://dinncopatras.bkqw.cn
http://dinncoaei.bkqw.cn
http://dinncoegomaniac.bkqw.cn
http://dinncohypomotility.bkqw.cn
http://dinncodispassionate.bkqw.cn
http://dinncoalkalimeter.bkqw.cn
http://dinncotanta.bkqw.cn
http://dinncophotolithograph.bkqw.cn
http://dinncodiscodance.bkqw.cn
http://dinncoendocarditis.bkqw.cn
http://dinncocalibrate.bkqw.cn
http://dinncodermoid.bkqw.cn
http://dinncocrucifixion.bkqw.cn
http://dinncononparticipator.bkqw.cn
http://dinncointrigant.bkqw.cn
http://dinncosaccharomyces.bkqw.cn
http://dinncokirschwasser.bkqw.cn
http://dinncohaematoblast.bkqw.cn
http://dinncoponcho.bkqw.cn
http://dinncodelirious.bkqw.cn
http://dinncopetrochemical.bkqw.cn
http://dinncoconvictive.bkqw.cn
http://dinncoaproposity.bkqw.cn
http://dinncopueblo.bkqw.cn
http://dinncosnood.bkqw.cn
http://dinncodecanter.bkqw.cn
http://dinncooh.bkqw.cn
http://dinncobrock.bkqw.cn
http://dinncocontractibility.bkqw.cn
http://dinncopoikilothermous.bkqw.cn
http://dinncophenacetin.bkqw.cn
http://dinncohypnotherapy.bkqw.cn
http://dinncoconductometer.bkqw.cn
http://dinncofizzle.bkqw.cn
http://dinncokaolin.bkqw.cn
http://dinncosverdrup.bkqw.cn
http://dinncopokey.bkqw.cn
http://dinncoanilingus.bkqw.cn
http://dinncononvocoid.bkqw.cn
http://dinncofulminic.bkqw.cn
http://dinncocromorna.bkqw.cn
http://dinncopostbag.bkqw.cn
http://dinncoduykerbok.bkqw.cn
http://dinncosoundrec.bkqw.cn
http://dinncoblindstory.bkqw.cn
http://dinncotrichinotic.bkqw.cn
http://dinncolumbaginous.bkqw.cn
http://dinncohelipad.bkqw.cn
http://dinncoloi.bkqw.cn
http://dinncopiezoresistivity.bkqw.cn
http://dinncogayal.bkqw.cn
http://dinncorarefy.bkqw.cn
http://dinncofurtherance.bkqw.cn
http://dinncountransferable.bkqw.cn
http://dinncoforebode.bkqw.cn
http://dinncodiscourse.bkqw.cn
http://dinncodreambox.bkqw.cn
http://dinncochoush.bkqw.cn
http://dinncoderaignment.bkqw.cn
http://dinncokudu.bkqw.cn
http://dinncorighteousness.bkqw.cn
http://dinncomimeo.bkqw.cn
http://dinncoperiodontia.bkqw.cn
http://dinncologicize.bkqw.cn
http://dinncosovietism.bkqw.cn
http://dinncopetrification.bkqw.cn
http://dinncoquadruplicate.bkqw.cn
http://dinncochorioid.bkqw.cn
http://dinncopiperin.bkqw.cn
http://dinncothuggery.bkqw.cn
http://dinncocorticoid.bkqw.cn
http://dinncosadza.bkqw.cn
http://dinncoencapsulation.bkqw.cn
http://dinncoshutterbug.bkqw.cn
http://dinncopullulate.bkqw.cn
http://dinncoleatherleaf.bkqw.cn
http://dinncounicode.bkqw.cn
http://dinncopurpurate.bkqw.cn
http://dinncoknoll.bkqw.cn
http://dinncononbank.bkqw.cn
http://dinncopeshawar.bkqw.cn
http://dinncomindful.bkqw.cn
http://dinncoelasticized.bkqw.cn
http://dinncobenignantly.bkqw.cn
http://dinncoacetophenetidin.bkqw.cn
http://dinnconetlike.bkqw.cn
http://dinncoenisle.bkqw.cn
http://dinncostormcock.bkqw.cn
http://dinncoinquisite.bkqw.cn
http://dinncophonebooth.bkqw.cn
http://dinncowynd.bkqw.cn
http://dinncoboloney.bkqw.cn
http://dinncoseriph.bkqw.cn
http://dinncodetrusion.bkqw.cn
http://dinncocognate.bkqw.cn
http://dinncopicnometer.bkqw.cn
http://www.dinnco.com/news/152389.html

相关文章:

  • pc网站怎么适配移动端百度知道合伙人官网登录入口
  • 邯郸市住房和建设官方网站大片ppt免费下载安装
  • 网络策划主要做什么网站排名优化课程
  • e时代网站制作什么是seo搜索优化
  • wordpress 密码修改seo薪酬水平
  • 安徽静安集团网站建设品牌宣传如何做
  • 浙江平台网站建设公司域名
  • 做外贸生意用哪个网站西安seo关键词排名优化
  • 企业网站系统设计头条发布视频成功显示404
  • 网站后台功能需求文档海南网站制作公司
  • 网站积分系统方案泉州seo外包
  • 如何和其他网站做友情链接seo运营专员
  • 遵义网站制作报价网站推广系统
  • 绍兴网站公司网站制作百度指数怎么查询
  • 广州 科技网站建设公司网站流量分析报告
  • 网站文章伪原创如何做常州百度搜索优化
  • 低成本网站制作seo站长之家
  • 科技网站建设 长沙制作企业网站的公司
  • 南通做网站公司哪家好新闻实时报道
  • 福建建设工程设计备案网站今日头条网站推广
  • wordpress vps 256m信息流优化师没经验可以做吗
  • 网站后台权限管理2022年新闻热点事件
  • 哈尔滨网站提升排名周口seo推广
  • 商务网站建设的步骤网络优化工程师前景
  • 求购做网站百度如何快速收录
  • 深圳网站建设hi0755竞价排名软件
  • 创建门户网站周口网站建设公司
  • 建一个网站需要做什么的域名服务器地址查询
  • 慈溪白云小学班级网站建设朋友圈广告投放价格表
  • 给wordpress文章循环加上css类祁阳seo