Open files from Safari with “Open in” in my app

2019-05-26 03:02发布

问题:

I need to be able to open any file from Safari in my app via the "Open in" feature. My app will appear in the "Open in"-list when I try to open any file in mail-app or another custom app, but my app won't appear in Safari. Why? What I did:

I specified following stuff in my plist:

  1. Added a new row named: "Document types"
  2. Opened node "Item 0"
  3. Specified value "All files" for "Document Type Name"
  4. Opened node "Document Content Type UTIs"
  5. Added two rows
  6. For "Item 0" I specified "public.data"
  7. For "item 1" I specified "public.content"

Then:

  1. I open mail app
  2. See email with doc-attachment
  3. Open in -> Yes, my App appears

Then:

  1. I open Safari and google for "test word doc".
  2. I open the first Word document and I see it in Safari.
  3. Then I tap on "Open in" and my app does not appear!

Why? What do I need to do to get the ability to open files in my app via Safari?

回答1:

You can try to set "Document Role" to "Editor"

I think your Document types is right because Dropbox app does the same way

This is a part of info.plist of Dropbox app