-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EventSource is not working in android #1
Comments
Hey!
|
in ios and ios simulator works perfectly. the problem is in android, I was testing with debug mode (run yarn android in react-native 0.63), it's not working in real device and emulator basically the problem is I am looking for why happen this problem, I found this issue in react native, I think event source polyfill doesn't work in android. and maybe the problem is related to the Networking module |
I'm just tried to create new RN app and it is working fine. Try it by yourself - https://github.com/NepeinAV/SSETest. |
Initially SSE wasn't working, but after i comment that lines of code it starts successfully. |
thank you a lot for responding quickly. |
very strange it working for your project. So the problem will be with openhab sse channel 🤔 when I try to connect return this error
ok, I will invest in this problem. can you explain why we need to comment these lines? (I am not native programmer) // try to comment this code
________________________
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
}
);
_______________________ Thank you |
So this is network interceptor that allows us to see network interaction in Flipper app. My app was working in release mode, but not in debug and only one difference between them was this interceptor. This is not a right solution to solve this problem, but at least my app is working as needed right now. |
kk, I think this problem is something that should resolve by react-native team. I am following this issue, facebook/react-native#28835, hope RN team can do something to make SSE work in pure JS without a thirty party library. also, I mentioned 'rn-eventsource-reborn' in it. 😂 Thank you a lot. hope the ppl use this library and make it popular 😉 |
I will close this Issue |
hi @NepeinAV,
I am testing the library rc-eventsource-reborn.
it is not working in android device. including comment these lines.
did it work for you?
The text was updated successfully, but these errors were encountered: