-
Notifications
You must be signed in to change notification settings - Fork 53
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
Console warning #8
Comments
First of all you're welcome! Can you post some sample code to help me recreate? I'm wondering if it could be your media servers' response when we use RNFetchBlob to request the image file. What happens if you use imgur or something as the remote image source? Do you still get the error? |
Yeah it must be the strange format of the response of the media server I am working with. Is like the server is cropping the image on runtime and the path to the original image is set in the query parameter. Here is an example of the response headers:
|
Okay to better my understanding of your situation, you were able to get your code to work correctly if you use a different image serving host like imgur or reddit or something right? Does your server require certain headers to be sent in the image request? Like some sort of basic auth scheme? |
Yes, it worked correctly when I switched the serving host to imgur. No, the image server doesn't require any specific headers in the request. |
Can you give me an example url that uses the actual server you will be using? Otherwise there isn't too much I can do to help since this appears to be related to your media server instead of react-native-image-cache-hoc. From your example above, it looks like you are using some sort of media server that consumes an external image via url, then crops/resizes/whatever on the fly then outputs the final image. If you hit the media server in the browser is it working as expected? |
Hitting the media server in the browser works. But however if you hit the media server specified in the query parameter then you get unauthorised. |
I've got this working for all the following urls insecure version http://sothebys-brightspot-lower.s3.amazonaws.com/b4/d3/1c65b5594fe4aad089c5a469a3d8/img-9904.JPG secure version: https://sothebys-brightspot-lower.s3.amazonaws.com/b4/d3/1c65b5594fe4aad089c5a469a3d8/img-9904.JPG NOTE: In order to make calls to http urls on iOS you need to update info.plist (not recommended in production). See https://facebook.github.io/react-native/docs/network.html
I'm going to close this issue, as the issue is unrelated to react-native-image-cache-hoc. Here is the example App.js file I used to show that react-native-image-cache-hoc is working as expected with the urls listed above. Note that I also updated info.plist to allow iOS to make request to http urls.
info.plist updates:
|
First of all, thank you for this project 🙏
I am getting a console waring in the app for each image.
"Received data was not a string, or was not a recognised encoding"
The only thing I found searching for a the cause of this warning was this issue on react-native facebook/react-native#1780 (comment)
"react-native": "^0.49.5",
"react-native-image-cache-hoc": "^1.4.0",
The text was updated successfully, but these errors were encountered: