-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathHJOCInvokeRNWebView.js
58 lines (48 loc) · 1019 Bytes
/
HJOCInvokeRNWebView.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, {Component} from 'react';
import {
Image,
PixelRatio,
Platform,
StyleSheet,
Text,
TouchableNativeFeedback,
NativeAppEventEmitter,
View
} from 'react-native';
var HJOCInvokeRNWebView = React.createClass({
getInitialState: function() {
return {
msg: '',
};
},
componentDidMount(){
console.log('开始订阅通知...');
subscription = NativeAppEventEmitter.addListener(
'EventReminder',
(reminder) => {
let errorCode=reminder.errorCode;
if(errorCode===0){
this.setState({msg:reminder.name});
}else{
this.setState({msg:reminder.msg});
}
}
);
},
componentWillUnmount(){
subscription.remove();
},
render: function() {
return(
<Text>
dsjflkdsjfkldsjfkldjklfjdklsjf
</Text>
);
},
});
module.exports = HJOCInvokeRNWebView;