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 React Native app supported? #60

Open
satriapr opened this issue Sep 27, 2023 · 3 comments
Open

Does React Native app supported? #60

satriapr opened this issue Sep 27, 2023 · 3 comments

Comments

@satriapr
Copy link

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!

@rcampbel
Copy link

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 )

@DeepikaSharma5
Copy link

Any alternative packages where we can use for react Native with Typescript? @satriapr @rcampbel

@rcampbel
Copy link

@DeepikaSharma5 I have not found one that yet meets my needs.
Most of the libs that I have come across do not do true streaming, they use long polling, or have streamed but don't release the data for use until the network connection closes.

I have come across one that looks promising, that I have yet to review and does not have a large following on npm. You may want to look at react-native-sse to see if it fits your needs.

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