Skip to content
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

Does not work on Android #3

Open
kovkev opened this issue May 16, 2020 · 4 comments
Open

Does not work on Android #3

kovkev opened this issue May 16, 2020 · 4 comments

Comments

@kovkev
Copy link

kovkev commented May 16, 2020

This library is great and it works well on iOS. However, it doesn't work on my Android device or my Android emulator. I have posted details about it here:

facebook/react-native#28835

@GaylordP
Copy link

Hello,

I confirm, it does not work on android (messages never arrive), I am desperately looking for a solution: /

Can you help me ?
thank you in advance

@kuznetsov-from-wonderland
Copy link

It works just fine. I had the same issue and the solution was to:

  • stick to a different library like import RNEventSource from 'react-native-event-source'.
  • deeply understand how the server works. In my case I was subscribed to the message event, but server-side guys did their own custom events like 'session_approved' and 'session_rejected'. So I was just listening to wrong events.
    es.addEventListener(SessionStatus.session_rejected, (event: { data: string }) => { bla-bla-bla}

@kovkev @GaylordP what I can recommend you guys is to double check everything, try to debug last-event-id comes from the server. Try to debug other events, not just the ones you are subscribed to. Try 'react-native-event-source'. Discuss the architecture - why not data-only-push notifications? Eventsource will only work while the App in foreground ☝🏻

@kuznetsov-from-wonderland

Also ensure you are not connecting via http on Android

@kuznetsov-from-wonderland

Also try with a real device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants