-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Fetch Request not working on android, but working on IOS #30827
Comments
I faced the same issue. On web i handled it with installing 'cors' extension -- now it works on web. |
Hmm, the person trying in the other issue thought it could be to do with the "Alt-Svc" header, do you think it could be due to this?? |
I don't know what to set for 'alt-svc'? I found one example I have added to my api some headers, like
And now fetch works in web without any chrome extensions for 'cors'. |
How do you host your api?? From your local network or a provider ? |
both. I have next.js server, on local for dev, and on vercel for production. They both are working well from expo web emulator (also in poster). But doesn't work on expo android client (even without any error message, while I use |
this is happening for me also when calling https request, the cert is form goddady and my server is hosted on digital ocean cloud. react-native: 0.63.4 |
Hi, any luck? |
I didn't remember exactly what I did to solve, :) I suggest it was different headers of client request, and server response. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
i got the same issus did anyone got it? |
Same issue here. Surprisingly it works on web perfectly, but not on mobile devices. Any success? |
Description
Hi, I have been developing with react native for awhile with Ios, but when it came to testing on android I get a "TypeError: Network request failed "error when trying to connect to my API, other APIs work but I just can't get mine to work, I raised an issue with expo and they couldn't figure it out and said it was probably an upstream react-native issue.
They thought it may be down to an Alt-Svc header
See expo/expo#11679 for original issue
Thanks In Advance :)
React Native version:
Expo SDK 40
Steps To Reproduce
Expected Results
The request response would outputted in the console, the catch runs and the error is outputted as an alert
Snack, code example, screenshot, or link to a repository:
In steps to reproduce
The text was updated successfully, but these errors were encountered: