mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	Refactor demo
This commit is contained in:
		| @@ -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> | ||||
|     ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sunnylqm
					sunnylqm