简体   繁体   English

使用我的应用程序中的“打开方式”从Safari打开文件

[英]Open files from Safari with “Open in” in my app

I need to be able to open any file from Safari in my app via the "Open in" feature. 我需要能够通过“打开方式”功能从我的应用程序中的Safari打开任何文件。 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. 当我尝试在邮件应用程序或其他自定义应用程序中打开任何文件时,我的应用程序将出现在“打开方式”列表中,但我的应用程序不会出现在Safari中。 Why? 为什么? What I did: 我做了什么:

I specified following stuff in my plist: 我在plist中指定了以下内容:

  1. Added a new row named: "Document types" 添加了一个新行,名为:“文档类型”
  2. Opened node "Item 0" 打开的节点“项目0”
  3. Specified value "All files" for "Document Type Name" “文档类型名称”的指定值“所有文件”
  4. Opened node "Document Content Type UTIs" 打开节点“文档内容类型UTI”
  5. Added two rows 增加了两行
  6. For "Item 0" I specified "public.data" 对于“项目0”,我指定了“ public.data”
  7. For "item 1" I specified "public.content" 对于“项目1”,我指定了“ 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". 我打开Safari和Google来获取“测试字文档”。
  2. I open the first Word document and I see it in Safari. 我打开第一个Word文档,然后在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? 我需要做些什么才能通过Safari在我的应用程序中打开文件?

You can try to set "Document Role" to "Editor" 您可以尝试将"Document Role"设置为"Editor"

I think your Document types is right because Dropbox app does the same way 我认为您的Document types正确,因为Dropbox应用程式的运作方式相同

This is a part of info.plist of Dropbox app 这是Dropbox应用程序info.plist的一部分

在此处输入图片说明

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM