import { AppRegistry, StyleSheet, Text, View, Platform, NativeAppEventEmitter, DeviceEventEmitter,} from 'react-native';//添加DeviceEventEmittercomponentDidMount() { if(Platform.OS=='android'){ this.subscription = DeviceEventEmitter.addListener('userNameDidChange',(userName) => { alert('通知'); }) }else { this.subscription = NativeAppEventEmitter.addListener('userNameDidChange',(userName) => { alert('通知'); }) }},移除DeviceEventEmittercomponentWillUnmount() { // 移除 this.subscription.remove();},发送通知DeviceEventEmitter.emit('userNameDidChange', '通知来了');OK, 完成!