Associating a file type / file extension with an LC iOS app
Introduction
This lessons describes the steps required to be able to open files (e.g. e-mail attachments) in Livecode apps on iOS. In this lesson we dealing with a .csv file, but any file extension, even a custom one, can be opened when the info.plist contains the correct data.
Prerequisite
You will need:
1. The stack iOS-Plist-AdditionalData.livecode
2. An iOS standalone of your project or a standalone of the sample stack FileLaunchTest.livecode
Note 1: If you are using the sample stack, then please adjust the iOS settings (Internal App ID and Profile)
Note 2: If you are using your own stack, then please add the script from step But how is our app informed about the file? to your stack
3. A text file with comma as column delimiter and the file extension .csv or use the capitals.csv file
Copy the info.plist from iOS app bundle
Right click on you iOS app bundle and select Show Package Contents
Move or copy the file info.plist to another folder. In our example we move it to the folder containing our stack.

Create the additional needed data
Open the the stack iOS-Plist-AdditionalData.livecode
Fill all fields with needed information (see annotations)
- enter a name/description e.g. My CSV File
- enter your internal App ID + .csv e.g. com.mycompany.myapp.csv (see annotation 9)
- enter a description e.g. CSV Document
- enter your internal App ID + .csv e.g. com.mycompany.myapp.csv (see annotation 9)
- enter the extension, e.g. csv
- press the magnifier glass to fetch the mime type for the entered extension
- press button create the....
- press the Clipboard Icon to copy the created data to the clipboard

Add the additional data to the info.plist
1. Open the info.plist file (the one you've copied/moved) in an editor and insert the additional data from your clipboard into it. The easiest option is to put the additional lines after the lines
<key>CFBundleSignature</key>
<string>????</string>
You should find them around line 19-20 or so.
2. Save the file info.plist

Modify standalone settings for your iOS app
1. In the Standalone Settings for your iOS app go to the Copy Files pane and add the custom info.plist file
2. Save the stack

First Test
- 1a. Create a new standalone app of your stack and install it on your device
or
- 1b. Connect your iOS device to your Mac, select your device in LC IDE under Development/Test Target and press the Test button/icon in IDE menu bar
- 2. send an email to yourself and attach the capitals.csv file or any other text file with .csv file extension and open that email on your iOS device.
- 3. If all went well then you should see your Livecode iOS app (maybe among others) in the list of Apps in which the .csv can be opened.

- 4. Select your iOS app. Your app should open, the path to the file will be shown in the field and the content of the csv file will show up in the browser widget.

But how is our app informed about the file?
To inform our app about the file we make use of the message urlWakeUp
.
- The parameter pURL contains the complete path to the file
- Put the pURL parameter into the "file" field
- Set the URL parameter of the browser widget to pURL
on urlWakeUp pURL
put pURL into field "file"
set the URL of widget "browser" to pURL
end urlWakeUp
Thanks, but I couldn't get iOS-PList-AdditionalData to work. When I press the "Create the additional PList data", it gives me a "Please fill out all fields" error message. I can't see any more fields to fill out ;-) I've tried inputting both data for my app & the example data given in the app's field headings. I've tried on MacOS & Windows. LC 9.0.4.