How do I create a app specific file type for iOS - iphone

How do I create an app specific file type for iOS and then save my app's data into this file which I can attach to emails and then other uses of the app can open this file in the app.
Mindjet for iPad does this.

See this question: How do I associate file types with an iPhone application?.
And read up on UTI: http://developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html

Related

Is it possible to save a file that shows up in the files app in an iPad Swift playgrounds app

I can't seem to add an info.plist file so I‘m not sure I can save to iCloud, is there any other way to store a file and have it accessible from the files app on iPad?
It could be possible, but it isn‘t intended: https://rambo.codes/posts/2021-12-28-a-document-based-app-in-swift-playgrounds-for-ipad/

opening file from mail in Unity3d app and handling the file

I wish to create my own file type to use in my app. I have already linked a file type to my app but now i need to tell the app to handle the file, so when i open a file that i sent over email, i open it with my app.
This is where i didn't figure it out yet.
How can i handle the file that i sent via email in unity3d code?
If you set the property "Application supports iTunes file sharing" to true in Xcode -> Info -> Custom iOS Target Properties, you will see that the file you've opened with your app is visible in itunes -> your_device -> Apps -> File Sharing in a folder named "Inbox".
So, what unity3d does, it makes a copy of the file you've opened with your app and stores it in your Documents folder for your app under the Inbox folder. Hope this is useful.
Also, you can implement this in native code (iOS) from here: http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app

ios registering document in document files

I am working on app that reads gpx (topografix) file attached to an email. I have successfully registered this document type to my app so whenever I select such a file I get the option to open it by this app on iPhone. It works fine on my iPhone but on iPad my app is not recognised for opening such a file so my app does not appear on the list of apps that are capable to open it. This app uses iPhone environment and is set for iPhone not for universal environment. By changing on universal environment does not change anything. Why is my app not recognised in the list?
Well the conversion of an iphone app to ipad app has to be done if you want to make it universal.
refer this

IOS file association - default app to open certain file

Is there any way to make my application default to open certain file types(e.g from Mail app). In this moment it is opened by Preview by default and the application is listed in the Open in.... Howeever, preview has nothing to do with this file type and this application is the only one, that can handle this file type.
So I would like to make my application default for this file type, so Preview will not open it by default. Some google search has revealed that in Mac OSX there is key like LSIsAppleDefaultForType, that can make app default, but I can't find any option for IOS...
You have to associate you app with the file types you want it to open.
You do this by adding some parameters to your Info.plist.
This post explains it:
How do I associate file types with an iPhone application?

How does "Open With" some app in iPhone work?

As far as I know, from iOS SDK 3.2, file type handling is added and an iOS application can associate itself with some file type so that other applications can open this kind of file with the application.
Because of the sandbox mechanism in iOS, I wonder when a file in appA is opened with appB, which registered itself with this kind of file, what will happen? Is this file copied to appB and both appA and appB keep a copy of this file? If the answer is yes, is it possible to make appB open the file under appA's document folder? I cannot find any Apple documentation on this.
For example, appA stores a Keynote document in it, if I open this Keynote document with the Keynote app, is it possible to let Keynote app to edit this document in place so that after editing, appA can see the updated document?
Any help is appreciated.
There are a few different questions in here.
When you register your app to handle types of files using the info.plist entry Document types your app will be on the list of apps that are shown when you perform an action with that file (for example tapping a file attachment in an email). Then when your app is launched, the method application:didFinishLaunchingWithOptions: is run as normal, and the launchOptions dictionary will contain the path to the file that was sent to your app. What you do with the file from there is up to you, but it is a copy of the file, not a link to it. So if the user makes changes to the file in the original app they must 'launch' your app again, with the new file.
See here for more info: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/application:didFinishLaunchingWithOptions:
You can't access any other app's document folder with the current SDK.
Also, for sharing documents in iTunes (like Pages, Numbers etc), look into the two info.plist entries Document types and UIFileSharingEnabled. (Apples docs: http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW20) Basically, by setting UIFileSharingEnabled to YES you will expose the /Documents directory of your app in iTunes. Then again it's up to your to show the user once they are back in your app what's in that directory.
Sndbox implemented over standard unix permissions control. All applications are stored in folders with unique name (actually, GUIDs), however owner for them is the same mobile:mobile.
So it looks like they just sends full file path to application which opens the corresponding file.