gpt4 book ai didi

react-native - 如何在React Native Android应用中显示当前的CodePush版本标签?

转载 作者:行者123 更新时间:2023-12-03 21:16:41 25 4
gpt4 key购买 nike

寻找类似的东西:

<Text>VERSION={CodePush.VersionLabel}</Text>


其中CodePush.VersionLabel是类似于“ v6”的内容,它显示在code-push deployment ls <MyApp>

我想在登录屏幕的底部显示此内容。

最佳答案

componentDidMount(){
codePush.getUpdateMetadata().then((metadata) =>{
this.setState({label: metadata.label, version: metadata.appVersion, description: metadata.description});
});
}

render() {
return(
<Text>{this.state.version}.{this.state.label}</Text>
);
}


注意: .label属性是CodePush使用的内部内部版本号(例如 v24

关于react-native - 如何在React Native Android应用中显示当前的CodePush版本标签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39796511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com