pubnub listeners not working in react-native
问题 I am working on realtime geolocation-tracking app using pubnub and react-native-maps in react-native. pubnub.publish() is working when called inside Geolocation.getCurrentLocation() and Geolocation.watchPosition() inside componentDidMount() . Here is the code which is worlking fine: Geolocation.getCurrentPosition( position => { if (this.state.allowsGPS) { this.pubnub.publish({ message: { latitude: position.coords.latitude, longitude: position.coords.longitude, from: '1' }, channel: "location