无法从“接收网站URL并粘贴文本”;“分享”;在iOS应用程序中

无法从“接收网站URL并粘贴文本”;“分享”;在iOS应用程序中,ios,xamarin.ios,Ios,Xamarin.ios,我正在构建一个iOS应用程序,我希望从其他应用程序接收共享内容,例如Safari web URL、用户已共享的粘贴文本等,无论是从共享表还是从所选文本“共享”按钮 除非我在info.plist中指定了“com.adobe.pdf”,否则我的应用程序似乎根本不会出现在共享表中 我试过: public.url 公共内容 公共数据 以下是我的info.plist中的条目: <key>CFBundleDocumentTypes</key> <array>

我正在构建一个iOS应用程序,我希望从其他应用程序接收共享内容,例如Safari web URL、用户已共享的粘贴文本等,无论是从共享表还是从所选文本“共享”按钮

除非我在info.plist中指定了“com.adobe.pdf”,否则我的应用程序似乎根本不会出现在共享表中

我试过:

  • public.url
  • 公共内容
  • 公共数据
以下是我的info.plist中的条目:

<key>CFBundleDocumentTypes</key>
  <array>
    <dict>
      <key>CFBundleTypeName</key>
      <string>PDF</string>
      <key>CFBundleTypeRole</key>
      <string>Viewer</string>
      <key>LSHandlerRank</key>
      <string>Alternate</string>
      <key>LSItemContentTypes</key>
      <array>
        <string>com.adobe.pdf</string>
        <string>public.url</string>
        <string>public.url-name</string>
        <string>public.html</string>
        <string>public.content</string>
        <string>public.data</string>
      </array>
    </dict>
  </array>
CbundleDocumentTypes
CbundleTypeName
PDF
CbundleTypeRole
观众
伊斯汉德兰克
候补
lsItemContentType
com.adobe.pdf
public.url
public.url-name
public.html
公共内容
公共数据
我还尝试添加具有以下内容的CbundleUrlTypes键(CbundleTypeRole都设置为编辑器和查看器):

CbundleUrlTypes
CFBundleURLName
HTTPS
循环流化床锅炉方案
https
CbundleTypeRole
编辑
CFBundleURLName
超文本传输协议
循环流化床锅炉方案
http
CbundleTypeRole
编辑
我哪里做错了?我是否需要编写共享扩展来接收URL、粘贴文本等

提前谢谢


Chris

Check Thank@LucasZhang MSFT我使用了该页面中的public.url和其他UTI来构建我的info.plist条目,似乎不起作用。你是否覆盖了方法
OpenUrl
?是的。我可以在PDF文件(com.adobe.PDF)的共享页中看到我的应用程序,并且该类型调用了OpenUrl方法。您可以共享包含您的问题的示例,以便我可以在我这方面进行测试。
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLName</key>
            <string>HTTPS</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>https</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
        </dict>
        <dict>
            <key>CFBundleURLName</key>
            <string>HTTP</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>http</string>
            </array>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
        </dict>
    </array>
</dict>