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

[Android] Images with 301 redirect don't load #4940

Closed
satya164 opened this issue Dec 23, 2015 · 21 comments
Closed

[Android] Images with 301 redirect don't load #4940

satya164 opened this issue Dec 23, 2015 · 21 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@satya164
Copy link
Contributor

Loading images from server where it does a redirect doesn't seem to work on Android. It works fine on iOS.

Demo - https://rnplay.org/apps/UEdIbw

Currently I'm working around this by having a native module which resolves the final URL and sends it back to JavaScript. Its terrible, but at least it gets the job done.

@facebook-github-bot
Copy link
Contributor

Hey satya164, thanks for reporting this issue!

React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.

  • If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
  • If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
  • We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using, as well as the platform you're on e.g.- Android, iOS. Thank you for your contributions!

@satya164
Copy link
Contributor Author

@mkonicek
Copy link
Contributor

@satya164
Copy link
Contributor Author

@mkonicek No idea. I had searched, but didn't find anything on this. Also on a quick look, the Native module just seems to pass the URL to Fresco. Thanks for the upvote and the correct link. I had no idea that changing the title changes the link on ProductPains.

@mkonicek
Copy link
Contributor

mkonicek commented Jan 6, 2016

Pinged Tyrone.

@satya164
Copy link
Contributor Author

satya164 commented Jan 6, 2016

@mkonicek Thank you ❤️

@tyronen
Copy link

tyronen commented Jan 6, 2016

In ReactNative apps, Fresco delegates the network request to OkHttp. By default, OkHttp does follow 301 redirects.

We'd need to debug through OkHttp source to find out why this doesn't seem to be happening.

@satya164
Copy link
Contributor Author

satya164 commented Jan 6, 2016

@tyronen Lemme know if I can do anything to help.

@satya164
Copy link
Contributor Author

@mkonicek @tyronen Has there been any movement on this?

@just4fun
Copy link

@satya164 I encountered same issue here #5616 , but you mentioned that it works fine on iOS. My APP is built with RN but only for iOS, the pics with 301 will only display sometimes, it's very weird.

@npomfret
Copy link
Contributor

I have exactly the opposite problem. Android seemed to be ok, but IOS would only load the image once and subsequent attempts at displaying the image wouldn't work. Looking at the web server logs it doesn't even make a request.

Using RN 0.23

@lacker
Copy link
Contributor

lacker commented Oct 21, 2016

This looks like it was fixed in https://github.com/facebook/react-native/releases/tag/v0.26.0 . I'm going to close the issue but feel free to reopen if I am wrong about that.

@lacker lacker closed this as completed Oct 21, 2016
@just4fun
Copy link

@lacker I think what has been fixed in 0.26.0 is just for iOS version, please refer this commit 192ab6.

@wuestkamp
Copy link

We can confirm that this issue is still present in version 0.39 and Android, seems to be only fixed for iOS. Please reopen if possible.

Thanks!

@satya164 satya164 reopened this Jan 9, 2017
@luco
Copy link

luco commented Jan 19, 2017

Still happening on Android, can confirm on 0.40.
In my case, the bug happens when I try to reach an image created by node.

@jenstah
Copy link

jenstah commented Mar 9, 2017

I see this is happening on iOS as @npomfret reported on April 20.

In Facebook search "Danielles Guide to 504 Plans" which leads you to a card from Spokin Inc. Tapping on that card the first time successfully takes user to the URL http://www.spokin.com/504plans. But hitting back button and tapping on that card going forward goes to a 404.

https://screencast.com/t/EzVFUrP6usQ

Please add a label iOS and also change the title to include iOS

@dotneet
Copy link

dotneet commented Jul 6, 2017

I have encountered same issue with RN v0.4.51 iOS.
I tried to display facebook profile image with the url like this: http://graph.facebook.com/<user_id>/picture?type=large
but not works.
So, I changed the url to redirect target of the url(CDN's url). It works.

@dotneet
Copy link

dotneet commented Jul 6, 2017

I'm sorry, I resolved it and it's not related to this issue.
My issue is caused by App Transport Security. I changed a url to 'https' and it works.

@Noitidart
Copy link

Noitidart commented Sep 8, 2017

I am using Android - react native 0.48.1 and image with redirect is not loading. So this was only fixed for iOS here correct? - 192ab66

@satya164 may you please share your solution where the url is resolved then image is loaded?

@Silvercast
Copy link

same here. Images shown randomly

@stale
Copy link

stale bot commented Dec 30, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 30, 2017
@stale stale bot closed this as completed Jan 6, 2018
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests