IOS Files App Folder

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

IOS Files App Folder

Post by Batninja » Tue Jun 23, 2020 10:12 am

Hi all.

I'd like to try and get a custom folder in the IOS iPhone Files app to expose documents created by my app. I know that LiveCode mobile saves to a sandbox documents folder but how can I get that folder (or a different new one) to show up in the Files app?

In Files I can see folders for Excel, LoppyHD, Adobe Scan etc. and individual files like audio recordings. I'd like a folder with the name of my app so that I can 1. edit a JSON file with a nice interface, 2. allow a user to copy it into an external disk drive

Any suggestions or comments welcomed, thanks.

Roger

mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Location: Berlin
Contact:

Re: IOS Files App Folder

Post by mimu » Sun Sep 27, 2020 12:47 pm

did you try to flag the "File Sharing" in the "Standalone Application Settings" for iOS?
afterwards you should have the

<key> UIFileSharingEnabled</key>
<true/>

inside the info.plist inside your app bundle.

some useful hints:
http://forums.livecode.com/viewtopic.php?t=12162
http://lessons.livecode.com/m/4069/l/10 ... lc-ios-app

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: IOS Files App Folder

Post by Batninja » Sun Sep 27, 2020 6:59 pm

Many thanks for the suggestion, sadly I could not get it to work.

I enabled the File Sharing check box in a test app in the IOS Standalone Settings - Requirements screen but despite working in Run mode on my Mac and making a folder then writing to it I had no luck with a Simulator or iPhone 6 or iPad Air 2.

This is the code I used in a button

Code: Select all

on mouseUp pButtonNumber
   set the defaultFolder to specialFolderPath("documents")
   create folder "Rogy" #does nothing if folder exists
   put "hello" into URL("file:Rogy/testfile")
end mouseUp
Thanks anyway

mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Location: Berlin
Contact:

Re: IOS Files App Folder

Post by mimu » Sat Oct 03, 2020 7:45 am

Have you tried to name your file something like testfile.txt?

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: IOS Files App Folder

Post by Batninja » Sun Oct 04, 2020 7:54 pm

Thanks for the suggestion, I did try just writing a plain text file and it will save and retrieve but again nothing in the Files area on the iPhone.

mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Location: Berlin
Contact:

Re: IOS Files App Folder

Post by mimu » Sun Oct 04, 2020 9:05 pm

Your file should have a file extension!
Like .txt or .xml or .csv at the end of the filename

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: IOS Files App Folder

Post by Batninja » Mon Oct 05, 2020 8:27 am

Yes thanks it did, have you managed to get it work and be accessed from the Files app on IOS 14?

denilvega
Posts: 1
Joined: Thu Oct 22, 2020 10:19 am

Re: IOS Files App Folder

Post by denilvega » Thu Oct 22, 2020 10:26 am

According to me Files app isn’t about giving the iPhone and iPad a local file system. It’s about making it easier for people to work with files and move them between apps, especially on the iPad.

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: IOS Files App Folder

Post by Batninja » Thu Oct 22, 2020 11:55 am

Yes :D , you can plug a USB stick into the IOS device and access/copy files across into the Files app. Its those I would like to read and write to, i.e. not just locally to the LiveCode app itself.

Batninja
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 55
Joined: Sat Oct 15, 2011 9:43 am

Re: IOS Files App Folder

Post by Batninja » Fri Oct 23, 2020 11:06 am

I think I'm making some headway with this :)

I can use MergDoc to export out from the "documents" folder to the Files app. Presumably, I can then use custom info.plist (lesson http://lessons.livecode.com/m/4069/l/10 ... lc-ios-app) so that in the Files app I can "open in" my LiveCode app.

What I'm trying to do is be able to plug an OP-Z synth into an iPhone (which then appears as a drive in the Files app) and use a Livecode app to edit the JSON config files with radio buttons rather than having to edit manually using a text editor).

So 1. Connect OP-Z to iPhone, open drive in Files and open JSON doc in LiveCode app.
then 2. Edit JSON doc in Livecode app and save back out to Files choosing OP-Z drive.

simples! :wink:

Post Reply

Return to “iOS Deployment”