Skip to content

Not Working in android #3

Closed
Closed

Description

@tmirun

in iOS work fine but in android it's not working
I use android 10 with react native version 0.64.0

Activity

  1. wojciechkrol commented on Jun 22, 2021

    @wojciechkrol
    Collaborator

    Hello @tmirun,

    We have project in React Native 0.64.2 and we haven't noticed any issues on Android 10. Please, show us your code, console output if has errors etc. Without more details we can't help you.

  2. tmirun commented on Jun 22, 2021

    @tmirun
    Author

    I simply copied the code in the readme, using my SSE URL with basic auth

    it happens in debug mode

    const url = new URL('xxxxxxxxxxxx');
    
        const es = new EventSource(url, {
          headers: {
            Authorization: "Basic xxxxxxxx";
          },
        });
    
        const listener: EventSourceListener = (event) => {
          if (event.type === "open") {
            console.log("Open SSE connection.");
          } else if (event.type === "message") {
            console.log(`Received book ${event.data}`);
          } else if (event.type === "error") {
            console.error("Connection error:", event.message);
          } else if (event.type === "exception") {
            console.error("Error:", event.message, event.error);
          }
        };
    
        es.addEventListener("open", listener);
        es.addEventListener("message", listener);
        es.addEventListener("error", listener);
    
        return () => {
          es.removeAllEventListeners();
          es.close();
        };
      }, []);
    
  3. tmirun commented on Jun 22, 2021

    @tmirun
    Author

    I have discoverd where is the bug:
    meta/flipper#2495

  4. wojciechkrol commented on Jun 22, 2021

    @wojciechkrol
    Collaborator

    Thank you for finding the cause of the problem. We will follow your issue. Please let me know: Do you use URL with react-native-url-polyfill?

    From our README:

    import "react-native-url-polyfill/auto"; // Use URL polyfill in React Native
    
  5. tmirun commented on Jun 23, 2021

    @tmirun
    Author

    yes, i used "react-native-url-polyfill/auto",

    the library in iOS work perfectlly

  6. forster007 commented on Jul 19, 2021

    @forster007

    Still not working on Android. Any news about it?

  7. wojciechkrol commented on Feb 14, 2022

    @wojciechkrol
    Collaborator

    Since this issue is connected with Flipper (in debug mode) and no possible fix on our side I'm closing this issue.

    Just disable debugger/debug mode, or follow instructions above to disable Flipper network plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions