react-native-event-source | native interface for EventSource : Server-Sent Events | iOS library
kandi X-RAY | react-native-event-source Summary
kandi X-RAY | react-native-event-source Summary
A react-native interface for EventSource: Server-Sent Events for iOS and Android
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Polling events for an event
- Poll for events to poll
react-native-event-source Key Features
react-native-event-source Examples and Code Snippets
Community Discussions
Trending Discussions on react-native-event-source
QUESTION
I am working with server sent events with spring boot in the backend and react-native/expo as client. To handle server send event on the client I use react-native-event-source. But the problem is only some events are received by the client. Here is the scenario:
- event id 0 -> not received
- event id 1 -> received
- event id 2 -> not received
- event id 3 -> received
- event id 4 -> not received
- event id 5 -> received ...
on the server side we tried deferent hacks and logs show that the server is actually sending each event but the expo client seems to ignore some events (1 event in two).
Here is how we initialize connection to get server sent events:
...ANSWER
Answered 2020-Mar-05 at 15:26react-native-event-source
does not use true EventSource but rather works around by polling. So my guess is your client miss messages because there are multiple in single polling interval (that is 500ms).
Reason for this is react native currently does not support HTTP streams.
QUESTION
I'm working on a notifications system with React Native and Symfony. I configured Mercure with docker to handle front subscription to real time updates : the .env file :
...ANSWER
Answered 2020-Feb-26 at 13:24I fix the issue, it was about the publish url I can't use a local url so i create a host and i config the url like this :
http://mercure.preprod.oryx-immobilier.com/.well-known/mercure
Now i can receive real time response from the backned
QUESTION
I migrate my expo project to react native project. I removed expo and i tried to use the native way to add splash screen and push notifications and to add fonts without expo. I also installed react navigation with the native way without expo. I run the project using android studio and Xcode. I have some problems but i fixed them by fixing some packages versions in my package.json file Now i get this error :
...ANSWER
Answered 2020-Feb-13 at 09:23In your case actually this is not an error. This is a warning from react native.
componentWillReceiveProps is a synchronous hook. Calling asynchronous function like data fetching inside this hook will need to render in between when the new props are set and when data has finished loading.
Thus, componentWillReceiveProps is being deprecated in favor of the following reason:
- Use componentDidUpdate
So, I suggest you to use componentDidUpdate hook as far as possible and update your code.
- The similar things happen when comparing componentWillMount and componentDidMount. Use componentDidMount whenever you need operate async operation and forget componentWillMount at all condition.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-event-source
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page