Ios lack of image

i build ios app.
When scan barcode it will show image.
Android everthing is ok.
But ios lack of image

clip preview
android
IOS

In order to help you with an issue in Thunkable, we need to see a screenshot of your blocks or a link to your project. A video of the result doesn’t help us know what caused it.

Link My project

The program is designed to work offline.
Lots of blocks and slow work.
Screen “playbarcode”
Can test with this barcode
barcode

When I test your project in Thunkable Live on an iPhone 11 and scan the barcode you posted, I hear “a ruler” and see this:

There are faster and more efficient (easier) ways to code what you’re trying to do:

I would use else if instead of else. That way, when the matching value is found, it won’t keep checking all of the other values.

But even better than that is to put all of your barcodes, image filenames, and sound filenames in a local data source and do a search with a loop (or better yet, the list of values block) to find the match and play/show the correct sound/image.

There’s also pattern matching that can help. For example, it seems like some/all of your image filenames are very similar to your barcode values. So instead of setting the Picture value to an image file you’ve uploaded, you can just set it to the green value block and replace the / with a _ using a Text “replace” block and joining it with the text string “.jpg”

Edit: 3819 blocks! Oh no! That’s sooo many blocks. No wonder it’s slow…

Do you have a thousand different barcodes??? I can’t imagine how long it took you to place all of those blocks. :cold_sweat: In the future, if you find yourself doing the same thing in Thunkable more than about a dozen times, ask for help on the forums. There’s almost always a faster way to do the same thing.

1 Like

Here’s an example of what I mean. I entered a few of your data points in a local db:

I then set up these blocks (sorry, the Snap to Place interface doesn’t have a list of values block):

The nice thing about setting up code this way is that it doesn’t matter if your database has 3 rows or 3,000 rows. It uses the same blocks. And troubleshooting problems or modifying the code is very quick and easy this way. I hope that’s helpful to you!

You can test the project with my changes here: Thunkable

Click on the Local DB button on the second screen. I deleted the playbarcode screen from my copy of your project because it was slowing down and even crashing the browser.

1 Like

Thank you.
It’s work for image. but sound can’t play.

i update block at screen2

The sound wouldn’t play for me in Thunkable Live on an iPhone 11 but it did play in the browser. I’ve always had trouble with sounds in Thunkable so I don’t know if I did something wrong.

1 Like