Open In for iOS
Moderators: FourthWorld, heatherlaine, Klaus, robinmiller, monte
Open In for iOS
I looked at mergExt's mergDoc and it appears that it can present a popover for opening a file in another app, but I was wondering if mergExt (or anyone else's product) has an external that allows your app to register for file types that it can open, such as discussed on this page from Apple. I would still need to figure out how to get such a document onto the device – probably email ...
Re: Open In for iOS
Hmmm, the more I dig the more it looks like I need to mess with the plist.info, but this Apple document implies that your app has to handle a special event when asked to open the file. So maybe the question should be: has anyone done this sort of thing, and is an external required?
Re: Open In for iOS
I have one of my Apps doing this if I understand what you are asking.
If the users is sent a file type via mail, my App shows up in the list of Apps that will support/use it. I took it a little further and extended my needs to a custom file type.
if this is what you mean let me know and I can share how I got it to work
(BTW, didn't need an external from memory)
If the users is sent a file type via mail, my App shows up in the list of Apps that will support/use it. I took it a little further and extended my needs to a custom file type.
if this is what you mean let me know and I can share how I got it to work
(BTW, didn't need an external from memory)
Re: Open In for iOS
Kia is right. You don't need an external for this.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: Open In for iOS
Cool. Yes, that is exactly what I am looking for. I was hoping to email a game file to another iPad and when they tapped the file it would present a "Open In" [my app] menu item.Nakia wrote:if this is what you mean let me know and I can share how I got it to work
(BTW, didn't need an external from memory)
If you want to take this offline, or out of this forum, let me know. I am at dale dot hurtt at specitllc dot com.
Thanks in advance,
Dale
Re: Open In for iOS
Okay,
Firstly this is how I got it to work. I am not saying its correct or the best but it works for me!
Step 1:
You need to edit your 'Settings.plist' file and add the following. FYI you find this by Right clicking on your LC Program in Apps then exploring to
"Contents/Runtime/iOS/Device/"
Firstly this is how I got it to work. I am not saying its correct or the best but it works for me!
Step 1:
You need to edit your 'Settings.plist' file and add the following. FYI you find this by Right clicking on your LC Program in Apps then exploring to
"Contents/Runtime/iOS/Device/"
Code: Select all
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Icon.png</string> -->This is the name of the PNG Mail will show in the list of Applications that can process the File Type
</array>
<key>CFBundleTypeName</key>
<string>Cool Game File</string> --> This is the description of your custom file type (Example, 'Cool Game File')
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.companyname.appname.extension</string> --> This is partially taken from detail you set in LC Standalone App Settings (Example, 'com.blueducksoftware.coolgame.cgf')
</array>
</dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.plain-text</string> --> This describes to iOS what Type the file conforms to, if it's just text this should work.
<string>public.text</string> --> This describes to iOS what Type the file conforms to, if it's just text this should work.
</array>
<key>UTTypeDescription</key>
<string>Cool Game File</string> --> This is the description of your custom file type (Example, 'Cool Game File')
<key>UTTypeIdentifier</key>
<string>com.companyname.appname.extension</string> --> This is partially taken from detail you set in LC Standalone App Settings (Example, 'com.blueducksoftware.coolgame.cgf')
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>cgf</string> --> This is your custom file extension (Example, 'cgf')
</dict>
</dict>
</array>
Re: Open In for iOS
Step 2:
All that is required to process this after your App is opened from one of these file is the 'URLWakeUp' command.
This will pass the path to the file (the one you clicked on in Mail App) from which you can then place into your Apps cache directory and do with it what you will.
Note:
1.The path URLWakeUp passes is fully justified so you have to pull out only the portion that you need.
2. When you open the file it creates an 'Inbox' folder in your App directory and you grab the file from there.
This is how I did mine
(Could be improved upon)
All that is required to process this after your App is opened from one of these file is the 'URLWakeUp' command.
This will pass the path to the file (the one you clicked on in Mail App) from which you can then place into your Apps cache directory and do with it what you will.
Note:
1.The path URLWakeUp passes is fully justified so you have to pull out only the portion that you need.
2. When you open the file it creates an 'Inbox' folder in your App directory and you grab the file from there.
This is how I did mine
(Could be improved upon)
Code: Select all
on urlWakeUp pURL
## Ability for the user to import Hours templates, will accept individual .wtt files which can be emailed to device
## then the user can open the file into WesTec for importing.
if the environment = "mobile" then
mobileBusyIndicatorStart "square", "Importing"
-- Retrieve the filename as passed to the Application
set the itemdel to "/"
put item (the number of items in pURL) of pURL into tFileName
set the itemdel to comma
-- Check to see the TimesheetTemplates folder exists, create if false
put specialFolderPath("Documents") & "/TimesheetTemplates/" into tFolderExists
if there is not a folder tFolderExists then
create folder specialFolderPath("Documents") & "/TimesheetTemplates/"
end if
-- Here we grab the contents of the wtt file
if tFileName contains ".wtt" then
put URL ("file:" & specialFolderPath("Documents")&slash&"Inbox"&slash&tFileName) into tFileContents
end if
on urlWakeUp pURL
Now you can do what you like with your file contents
Re: Open In for iOS
This is great. I will have to try it out. One question though: where do I put the "icon.png" file? Or do I simply add it as a file in the Standalone Settings and the build puts it in the proper path?
Thanks again.
Dale
Thanks again.
Dale
Re: Open In for iOS
I just used the copy files pane as you suggested!
I'm not even certain it uses it to be honest as I didn't have it there once and it still worked ???
I'm not even certain it uses it to be honest as I didn't have it there once and it still worked ???