1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Refactor demo

This commit is contained in:
sunnylqm 2021-04-08 23:46:29 +08:00
parent d9e307659f
commit 736b82aac6

@ -8,6 +8,7 @@ import {
TouchableOpacity,
Linking,
Image,
NativeModules,
} from 'react-native';
import {
@ -21,11 +22,11 @@ import {
switchVersionLater,
markSuccess,
downloadAndInstallApk,
cInfo,
} from 'react-native-update';
import _updateConfig from '../update.json';
const {appKey} = _updateConfig[Platform.OS];
export default class App extends Component {
state = {
received: 0,
@ -140,7 +141,7 @@ export default class App extends Component {
};
render() {
const { received, total } = this.state;
const {received, total} = this.state;
return (
<View style={styles.container}>
<Text style={styles.welcome}>欢迎使用热更新服务</Text>
@ -162,6 +163,16 @@ export default class App extends Component {
<TouchableOpacity onPress={this.checkUpdate}>
<Text style={styles.instructions}>点击这里检查更新</Text>
</TouchableOpacity>
<TouchableOpacity
style={{marginTop: 15}}
onLongPress={() => {
// TODO 调试pushy方法
}}>
<Text style={styles.instructions}>
react-native-update版本{cInfo.pushy}
</Text>
</TouchableOpacity>
{/* <WebView style={{flex:1}} source={{uri: require('../www/index.html')}}/> */}
</View>
);