fetch-event-source icon indicating copy to clipboard operation
fetch-event-source copied to clipboard

Does React Native app supported?

Open satriapr opened this issue 1 year ago • 1 comments

Hello everyone,

I'd like to inquire about the compatibility of React Native with this project. I've reviewed the documentation and discussions but couldn't find any explicit mentions regarding React Native support. The only reference I came across is this closed PR: link to closed PR.

I've attempted to integrate this project into a React Native app, specifically for iOS on Apple TV. However, it seems that I'm encountering an issue where I cannot establish a connection.

Here's the error message I've encountered:

ReferenceError: document is not defined

You can view a screenshot of the error here.

I also experimented with adding openWhenHidden: true, but that only resulted in more errors.

Interestingly, when I tried the same integration with a web app, everything appeared to work correctly.

I appreciate any insights or guidance on this matter. Thanks!

satriapr avatar Sep 27 '23 14:09 satriapr

With the way the code is written, no this does not support react-native apps.

Reason: The dispose method is not device agnostic ( uses both document and window )

rcampbel avatar Dec 22 '23 18:12 rcampbel