1515 NativeAppEventEmitter
1616} = React ;
1717
18- // var ToastAndroid = NativeModules.ToastAndroid;
1918var PushHelper = NativeModules . JPushHelper ;
20- // var JSHelper = NativeModules.JSHelper;
2119var PushActivity = React . createClass ( {
2220
2321 getInitialState : function ( ) {
@@ -35,11 +33,7 @@ var PushActivity = React.createClass({
3533 this . props . navigator . push ( { name :'setActivity' } ) ;
3634 } ,
3735 onInitPress ( ) {
38- // PushHelper.init( (success) => {
39- // // ToastAndroid.show(success, ToastAndroid.SHORT);
40- // }, (error) => {
41- // // ToastAndroid.show(error, ToastAndroid.SHORT);
42- // });
36+
4337 console . log ( 'on click init push ' ) ;
4438 PushHelper . setupPush ( 'dssdf' ) ;
4539
@@ -50,28 +44,7 @@ var PushActivity = React.createClass({
5044 onSetuplocalNotificationPress ( ) {
5145 this . props . navigator . push ( { name :'LocalPushActivity' } ) ;
5246 } ,
53- onResumePress ( ) {
54- // PushHelper.resumePush((success) => {
55- // ToastAndroid.show(success, ToastAndroid.SHORT);
56- // }, (error) => {
57- // ToastAndroid.show(error, ToastAndroid.SHORT);
58- // });
59- } ,
6047 componentWillMount ( ) {
61- // JSHelper.initModule(
62- // (map) => {
63- // this.setState({
64- // appkey: map.myAppKey,
65- // imei: map.myImei,
66- // package: map.myPackageName,
67- // deviceId: map.myDeviceId,
68- // version: map.myVersion
69- // })
70- // }
71- // );
72- // DeviceEventEmitter.addListener('receivePushMsg', (data) => {
73- // this.setState({ pushMsg: data });
74- // });
7548
7649 var subscription = NativeAppEventEmitter . addListener ( 'didRegisterToken' , ( token ) => {
7750 this . setState ( { pushToken : token } ) ;
@@ -143,15 +116,7 @@ var PushActivity = React.createClass({
143116 local notification
144117 </ Text >
145118 </ TouchableHighlight >
146- < TouchableHighlight
147- underlayColor = '#f5a402'
148- activeOpacity = { 0.5 }
149- style = { styles . btnStyle }
150- onPress = { this . onResumePress } >
151- < Text style = { styles . btnTextStyle } >
152- RESUMEPUSH
153- </ Text >
154- </ TouchableHighlight >
119+
155120 < Text style = { styles . textStyle } >
156121 token: { this . state . pushToken }
157122 </ Text >
0 commit comments