@@ -5,83 +5,26 @@ import JPushModule from 'jpush-react-native'
55const { View, Text, TouchableHighlight, StyleSheet } = ReactNative
66
77export default class Second extends React . Component {
8- onBackPress = ( ) => {
9- if ( ! this . props . navigator ) {
10- this . props . navigator . pop ( )
11- } else {
12- console . log ( 'finishing second activity' )
13- JPushModule . finishActivity ( )
14- }
15- }
168
17- componentDidMount ( ) {
9+ componentDidMount ( ) {
10+ // Receive extra
1811 JPushModule . addReceiveExtrasListener ( map => {
1912 console . log ( 'Got extra, key: hello, value: ' + map . hello )
2013 } )
2114 }
2215
23- onButtonPress = ( ) => {
24- console . log ( 'will jump to setting page' )
25- if ( ! this . props . navigator ) {
26- this . props . navigator . push ( {
27- name : 'setActivity'
28- } )
29- } else {
30- }
31- }
32-
33- render ( ) {
16+ render ( ) {
3417 return (
3518 < View >
36- < TouchableHighlight
37- style = { styles . backBtn }
38- underlayColor = '#e4083f'
39- activeOpacity = { 0.5 }
40- onPress = { this . onBackPress }
41- >
42- < Text > Back</ Text >
43- </ TouchableHighlight >
4419 < Text style = { styles . welcome } > Welcome !</ Text >
45- < TouchableHighlight
46- underlayColor = '#e4083f'
47- activeOpacity = { 0.5 }
48- style = { styles . btnStyle }
49- onPress = { this . onButtonPress }
50- >
51- < Text style = { styles . btnTextStyle } > Jump To Setting page!</ Text >
52- </ TouchableHighlight >
5320 </ View >
5421 )
5522 }
5623}
5724
5825var styles = StyleSheet . create ( {
59- backBtn : {
60- padding : 10 ,
61- marginTop : 10 ,
62- marginLeft : 10 ,
63- borderWidth : 1 ,
64- borderColor : '#3e83d7' ,
65- backgroundColor : '#3e83d7' ,
66- borderRadius : 8 ,
67- alignSelf : 'flex-start'
68- } ,
6926 welcome : {
7027 textAlign : 'center' ,
7128 margin : 10
7229 } ,
73- btnStyle : {
74- marginTop : 10 ,
75- borderWidth : 1 ,
76- borderColor : '#3e83d7' ,
77- borderRadius : 8 ,
78- backgroundColor : '#3e83d7' ,
79- alignSelf : 'center' ,
80- justifyContent : 'center'
81- } ,
82- btnTextStyle : {
83- textAlign : 'center' ,
84- fontSize : 25 ,
85- color : '#ffffff'
86- }
8730} )
0 commit comments