How is it possible to read asset file with iOS?

EFile is working file, but with iOS, it is not possible to use extension :frowning:
How is it possible to read asset file with iOS ?

Thanks for switching this issue to a new topic in App Inventor for iOS.
I do not understand your answer? (the attached image)

Which file do you want to read from the assets. Show your blocks.

here are my blocks, my text file and the aia project:


test.txt (31 Bytes)
Test_for_iOS.aia (10.3 KB)

Actually, that's what I tried first. But there is the same issue, and that's why I tried to add asking permission
This simple version:
image
Test_for_iOS.aia (9.8 KB)
has the same issue

I've only tested it with Companion so far. And this works. Are you talking about the compiled app (IPA)?

You are right, it is working with companion, but not with the .ipa

1 Like

And this method? I think that the "//" method is a bit outdated and someone may have forgotten about it in the iOS implementation.

Set File Scope does not work with iOS :frowning:

2 Likes

Try this (workaround):

Tested with the compiled app (IPA).

Yew, this is working.
However, this is a workaround for small text....
I need to be able to store data in a file as I have lot of text in different languages that I manage with other tools
Anyway, thanks for this proposal

@Jacques_Dumarest Based in your target I think will be better if you put your text file in your web server. With your App you can access this file with the block WebViewer. This block runs well in iOS (inc. IPA) for a small text file <70 KB (ca 800 text-lines).
Additionaly in the future you will can change your text file without changing your App.

The blocks to use are similar theses


Thank you very much Ferran !
This is definitively a solution working for Android, iOS both companion and compiled App :slight_smile:

I have put my test text file on my Google Drive. I "build" the test file url using info provided here: https://www.howtogeek.com/747810/how-to-make-a-direct-download-link-for-google-drive-files/
In my app, I download the file (provide url and send GET) then I display the text: OK! Save the file and read the saved file, and again I get the correct text :smiley:

Keep attention that for a big text file the answer in iOS is very delayed. I had reported this issue to @ewpatton. For a more than 100 KB the answer time is not good in iOS.

Thanks

I've put this on my todo list for this week.

1 Like