0

In a React Native project, I am using the following code to get the image from the server and display it.

<Image source={{uri: `https://infuraa-club.appspot.com/ImageResizer?categoryId=4844470512123904&width=400&height=400`}} style={styles.thumbnail} /> 

And, the style is defined as

thumbnail: { width: 100, height: 100, }, 

Everything Works well on Android, but not on IOS

I tried loading other images from different servers, ex (http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api) and it worked fine in both the platforms.

Not sure what's wrong with the images served from my server.

Things I have already tried,

  • looked at http/https issues
  • looked at http headers
  • loaded other static images from my server with JPG/PNG extensions, Worked!
  • Changed the content type to jpg and png

Can someone please help me with this.

2
  • 1
    please share the stylesheet for styles.thumbnail Commented Jan 20, 2017 at 6:28
  • thumbnail: { width: 100, height: 100, }, Commented Jan 20, 2017 at 6:45

1 Answer 1

0

Got the Solution.

The Problem was not with React Native, The Problem was in the server.

I was returning the byte[] and Content-Type: image/png and HTTP Status as HttpStatus.CREATED

I just Changed the HttpStatus.CREATED to HttpStatus.OK and everything started working

Hope it helps others..

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.