On iOS devices, the Mail app offers "Open In..." option for attachments. The apps listed have registered their CFBundleDocumentTypes with the OS. What I am wondering is how my app might allow users to open files generated by my app in other apps. Is Mail the only app that provides this feature?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
This is a great tutorial, that helped me.
I have added support for
*.xdxf
files in my app. In short, you have to do two things. First - add entries like this to your app'sPlist
file:Here, you should add
UTExportedTypeDeclarations
only if your file type is unique. Or by other words is not here.Second - handle delegate method in
AppDelegate
:Take a look at the Document Interaction Programming Topics for iOS: Registering the File Types Your App Supports.
As long as you provide your document types in your Info.plist, other apps that recognize that document type will list your app in their "open in" choices. Of course, that presumes that your app creates documents that other apps can open.
I add my app in "open in" list successfully as follows,
Add a new document type filter, which Name is anything you want and the type is defined in https://developer.apple.com/library/ios/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html#//apple_ref/doc/uid/TP40009259-SW1
Hope you can be success too!!
However, the feature I want to implement is "Share" like Facebook or Slack do, I can not make it still...anyone can give me a big hand :(
In order to be visible in the list of "open in..." for all files, you need to add this to your plist
Once your app shows in "open in...", you need to load that file. Most website shows to implement this function:
But this function that worked fine in IOS 7 crashes in IOS 8. I had to implement the following function instead to get it to work.