Search code examples
iosimagereact-nativetestflight

React native: Display image in TestFlight not working


I have app who I had uploaded to Testflight, Almost everything works fine, but there is one Image who not displays. This image is inside my IOS folder and displayed as a background Image in the package "RNSketchCanvas".

If run my App one the simulator it works perfect.

Here is the following code who I use to display the image:

localSourceImage={{
  filename:
   '/Users/username/Desktop/ProjectName/iOS/image.png',
    mode: 'AspectFit',
    directory: 'SketchCanvas.MAIN_BUNDLE',
 }}

Could it be the "PNG" format who is the problem or that I have to put the image inside "images.xcassets" or something else?


Solution

  • Like the documentation states here:

    https://github.com/terrylinla/react-native-sketch-canvas#background-image

    you need to add the image to your native project. You should not even add it to an xcassets folder but just as a plain image file to your native App bundle. After that you can use it with the filename and directory to RNSketchCanvas.MAIN_BUNDLE. On Android you have to add it to resources.