mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 13:23:12 +08:00 
			
		
		
		
	working on android
This commit is contained in:
		| @@ -1,51 +1 @@ | ||||
| /** | ||||
|  * Sample React Native App | ||||
|  * https://github.com/facebook/react-native | ||||
|  */ | ||||
| 'use strict'; | ||||
| import React, { | ||||
|   AppRegistry, | ||||
|   Component, | ||||
|   StyleSheet, | ||||
|   Text, | ||||
|   View | ||||
| } from 'react-native'; | ||||
|  | ||||
| class testHotUpdate extends Component { | ||||
|   render() { | ||||
|     return ( | ||||
|       <View style={styles.container}> | ||||
|         <Text style={styles.welcome}> | ||||
|           Welcome to React Native! | ||||
|         </Text> | ||||
|         <Text style={styles.instructions}> | ||||
|           To get started, edit index.android.js | ||||
|         </Text> | ||||
|         <Text style={styles.instructions}> | ||||
|           Shake or press menu button for dev menu | ||||
|         </Text> | ||||
|       </View> | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  | ||||
| const styles = StyleSheet.create({ | ||||
|   container: { | ||||
|     flex: 1, | ||||
|     justifyContent: 'center', | ||||
|     alignItems: 'center', | ||||
|     backgroundColor: '#F5FCFF', | ||||
|   }, | ||||
|   welcome: { | ||||
|     fontSize: 20, | ||||
|     textAlign: 'center', | ||||
|     margin: 10, | ||||
|   }, | ||||
|   instructions: { | ||||
|     textAlign: 'center', | ||||
|     color: '#333333', | ||||
|     marginBottom: 5, | ||||
|   }, | ||||
| }); | ||||
|  | ||||
| AppRegistry.registerComponent('testHotUpdate', () => testHotUpdate); | ||||
| require('./js/index'); | ||||
|   | ||||
| @@ -1,69 +1 @@ | ||||
| /** | ||||
|  * Sample React Native App | ||||
|  * https://github.com/facebook/react-native | ||||
|  */ | ||||
| 'use strict'; | ||||
| import React, { | ||||
|   AppRegistry, | ||||
|   Component, | ||||
|   StyleSheet, | ||||
|   Text, | ||||
|   View, | ||||
|   TouchableOpacity, | ||||
| } from 'react-native'; | ||||
|  | ||||
| import {downloadFile, reloadUpdate} from 'react-native-update' | ||||
|  | ||||
| class testHotUpdate extends Component { | ||||
|   render() { | ||||
|     return ( | ||||
|       <View style={styles.container}> | ||||
|         <Text style={styles.welcome}> | ||||
|           Welcome to React Native! | ||||
|         </Text> | ||||
|         <Text style={styles.instructions}> | ||||
|           To get started, edit index.ios.js | ||||
|         </Text> | ||||
|         <TouchableOpacity onPress={ | ||||
|           ()=>{ | ||||
|             downloadFile({updateUrl:'http://7xjhby.com2.z0.glb.qiniucdn.com/ios1.ppk', hashName:'test'}) | ||||
|           } | ||||
|         }> | ||||
|         <Text style={styles.instructions}> | ||||
|           Press To DownloadFile | ||||
|         </Text> | ||||
|         </TouchableOpacity> | ||||
|         <TouchableOpacity onPress={ | ||||
|           ()=>{ | ||||
|             reloadUpdate({hashName:'test'}) | ||||
|           } | ||||
|         }> | ||||
|           <Text style={styles.instructions}> | ||||
|             Press To Reload | ||||
|           </Text> | ||||
|         </TouchableOpacity> | ||||
|       </View> | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  | ||||
| const styles = StyleSheet.create({ | ||||
|   container: { | ||||
|     flex: 1, | ||||
|     justifyContent: 'center', | ||||
|     alignItems: 'center', | ||||
|     backgroundColor: '#F5FCFF', | ||||
|   }, | ||||
|   welcome: { | ||||
|     fontSize: 20, | ||||
|     textAlign: 'center', | ||||
|     margin: 10, | ||||
|   }, | ||||
|   instructions: { | ||||
|     textAlign: 'center', | ||||
|     color: '#333333', | ||||
|     marginBottom: 5, | ||||
|   }, | ||||
| }); | ||||
|  | ||||
| AppRegistry.registerComponent('testHotUpdate', () => testHotUpdate); | ||||
| require('./js/index'); | ||||
|   | ||||
							
								
								
									
										69
									
								
								Example/testHotUpdate/js/index.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								Example/testHotUpdate/js/index.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,69 @@ | ||||
| /** | ||||
|  * Sample React Native App | ||||
|  * https://github.com/facebook/react-native | ||||
|  */ | ||||
| 'use strict'; | ||||
| import React, { | ||||
|   AppRegistry, | ||||
|   Component, | ||||
|   StyleSheet, | ||||
|   Text, | ||||
|   View, | ||||
|   TouchableOpacity, | ||||
| } from 'react-native'; | ||||
|  | ||||
| import {downloadFile, reloadUpdate} from 'react-native-update' | ||||
|  | ||||
| class testHotUpdate extends Component { | ||||
|   render() { | ||||
|     return ( | ||||
|       <View style={styles.container}> | ||||
|         <Text style={styles.welcome}> | ||||
|           Welcome to React Native! | ||||
|         </Text> | ||||
|         <Text style={styles.instructions}> | ||||
|           To get started, edit index.ios.js | ||||
|         </Text> | ||||
|         <TouchableOpacity onPress={ | ||||
|           ()=>{ | ||||
|             downloadFile({updateUrl:'http://7xjhby.com2.z0.glb.qiniucdn.com/ios1.ppk', hashName:'test'}) | ||||
|           } | ||||
|         }> | ||||
|           <Text style={styles.instructions}> | ||||
|             Press To DownloadFile | ||||
|           </Text> | ||||
|         </TouchableOpacity> | ||||
|         <TouchableOpacity onPress={ | ||||
|           ()=>{ | ||||
|             reloadUpdate({hashName:'test'}) | ||||
|           } | ||||
|         }> | ||||
|           <Text style={styles.instructions}> | ||||
|             Press To Reload | ||||
|           </Text> | ||||
|         </TouchableOpacity> | ||||
|       </View> | ||||
|     ); | ||||
|   } | ||||
| } | ||||
|  | ||||
| const styles = StyleSheet.create({ | ||||
|   container: { | ||||
|     flex: 1, | ||||
|     justifyContent: 'center', | ||||
|     alignItems: 'center', | ||||
|     backgroundColor: '#F5FCFF', | ||||
|   }, | ||||
|   welcome: { | ||||
|     fontSize: 20, | ||||
|     textAlign: 'center', | ||||
|     margin: 10, | ||||
|   }, | ||||
|   instructions: { | ||||
|     textAlign: 'center', | ||||
|     color: '#333333', | ||||
|     marginBottom: 5, | ||||
|   }, | ||||
| }); | ||||
|  | ||||
| AppRegistry.registerComponent('testHotUpdate', () => testHotUpdate); | ||||
| @@ -7,6 +7,6 @@ | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "react-native": "^0.20.0", | ||||
|     "react-native-update": "git+https://github.com/reactnativecn/react-native-pushy" | ||||
|     "react-native-pushy": "../.." | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 tdzl2003
					tdzl2003