当前位置: 首页> 游戏> 网游 > 成熟交bgmbgmbgm在线_nba今日数据_google官方下载_seo的最终是为了达到

成熟交bgmbgmbgm在线_nba今日数据_google官方下载_seo的最终是为了达到

时间:2025/7/14 15:25:43来源:https://blog.csdn.net/qq_34081612/article/details/144695355 浏览次数:0次
成熟交bgmbgmbgm在线_nba今日数据_google官方下载_seo的最终是为了达到

业务场景:鸿蒙调取接口检测到需要更新,跳转到应用市场更新

前提设置:在app.json5文件中设置版本号
在这里插入图片描述

  loadAppVersion() {appVersion().then(res => {if (res.code == 200) {let data = plainToClass(AppVersionBean, res.data as AppVersionBean)if (data.version > VERSION_CODE) {DialogHelper.showAlertDialog({backCancel: data.is_force != 1,autoCancel: data.is_force != 1,content: data.client_details,title: "应用更新",secondaryButton: "确认",onAction: (action: number, dialogId: string, content: string): void => {if (action == DialogAction.TWO) {let appId = 'com.example.shilrey'const want: Want = {uri: `store://appgallery.huawei.com/app/detail?id=${appId}`};const context = getContext(this) as common.UIAbilityContext;context.startAbility(want).then(() => {//拉起成功}).catch(() => {// 拉起失败showAlertMsg('应用有更新,可在应用市场更新app')});}}})}}})}

导入的依赖是这几个

import { VERSION_CODE } from 'BuildProfile'
import { DialogAction, DialogHelper } from '@pura/harmony-dialog'
import { common, Want } from '@kit.AbilityKit'

如果你的应用还没有在华为的鸿蒙市场上线过,跳转过去是这样的页面
在这里插入图片描述
这样是正常的哈,等你上架过一次就能正常跳转咯

关键字:成熟交bgmbgmbgm在线_nba今日数据_google官方下载_seo的最终是为了达到

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: