This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed
Examples/HybridMobileDeployCompanion Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 9
9
AppRegistry,
10
10
StyleSheet,
11
11
Text,
12
+ TouchableOpacity,
12
13
View,
13
14
} = React ;
14
15
15
- var HybridMobileDeploy = require ( 'react-native-hybrid-mobile-deploy' ) ( 'http://localhost:3000/' , 'HybridMobileDeployCompanion' ) ;
16
+ var Button = require ( "react-native-button" ) ;
17
+
18
+ var HybridMobileDeploy = require ( 'react-native-hybrid-mobile-deploy' ) ( 'http://localhost:3000/' , '<deployment key here>' ) ;
16
19
17
20
var HybridMobileDeployCompanion = React . createClass ( {
21
+ componentDidMount : function ( ) {
22
+ this . fetchData ( ) ;
23
+ } ,
24
+ fetchData : function ( ) {
25
+ HybridMobileDeploy . queryUpdate ( ( err , update ) => {
26
+ this . setState ( { update : update , updateString : JSON . stringify ( update ) } ) ;
27
+ } ) ;
28
+ } ,
29
+ getInitialState : function ( ) {
30
+ return { update : false , updateString : "" } ;
31
+ } ,
32
+ handlePress : function ( ) {
33
+ console . log ( "pressed" ) ;
34
+ } ,
18
35
render : function ( ) {
36
+ var updateView ;
37
+ if ( this . state . update ) {
38
+ updateView = (
39
+ < View >
40
+ < Text > Update Available: { '\n' } { this . state . update . scriptVersion } - { this . state . update . description } </ Text >
41
+ < Button style = { { color : 'green' } } onPress = { this . _handlePress } >
42
+ Update
43
+ </ Button >
44
+ </ View >
45
+ ) ;
46
+ } ;
19
47
return (
20
48
< View style = { styles . container } >
21
49
< Text style = { styles . welcome } >
@@ -28,6 +56,7 @@ var HybridMobileDeployCompanion = React.createClass({
28
56
Press Cmd+R to reload,{ '\n' }
29
57
Cmd+D or shake for dev menu
30
58
</ Text >
59
+ { updateView }
31
60
</ View >
32
61
) ;
33
62
}
Original file line number Diff line number Diff line change 7
7
},
8
8
"dependencies" : {
9
9
"react-native" : " ^0.8.0-rc" ,
10
- "react-native-hybrid-mobile-deploy" : " file:../.."
10
+ "react-native-hybrid-mobile-deploy" : " file:../.." ,
11
+ "react-native-button" : " ^1.2.0"
11
12
}
12
13
}
You can’t perform that action at this time.
0 commit comments