如何在iOS 8系统范围的共享菜单中列出? [英] How to get listed in the iOS 8 system wide share menu?

查看:110
本文介绍了如何在iOS 8系统范围的共享菜单中列出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的iOS 8应用程序列在iOS 8系统范围的共享菜单中,用于图像扩展名.png,.jpg(.jpeg),. gif(静态)。
我需要添加到 info.plist 文件中?我在 iOS文档示例但是没有用,我的应用程序没有显示在共享列表中。

I'm trying to get my iOS 8 app listed in the iOS 8 system wide share menu for the image extensions .png, .jpg (.jpeg), .gif (static). What do I need to add to the info.plist file? I tried the code below from the iOS docs example but that didn't work, my app isn't showing up in the share list.

<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionServiceRoleType</key>
<string>NSExtensionServiceRoleTypeEditor</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ui-services</string>
<key>NSExtensionPrincipalClass</key>
<string>ActionViewController</string>
</dict>

为清楚起见,这是 iOS 8共享菜单(也称为分享表)我的意思是: http://cdn1.tekrevue.com/wp-content/uploads/2014/09/ios8-share-sheets-customize.jpg

To make it clear, this is the iOS 8 Share Menu (also known as share sheet) I mean: http://cdn1.tekrevue.com/wp-content/uploads/2014/09/ios8-share-sheets-customize.jpg

推荐答案

您缺少NSExtensionActivationRule。请参阅Apple的扩展编程指南:声明共享或操作扩展的支持数据类型

You are missing the NSExtensionActivationRule. See Apple's Extension programming guide: Declaring Supported Data Types for a Share or Action Extension


例如,声明您的共享扩展程序最多可支持10美元b图片,一部电影和一个网页网址,您可以使用
以下字典获取NSExtensionAttributes键的值:

For example, to declare that your Share extension can support up to ten images, one movie, and one webpage URL, you might use the following dictionary for the value of the NSExtensionAttributes key:

<key>NSExtensionAttributes</key>
    <dict>
        <key>NSExtensionActivationRule</key>
        <dict>
            <key>NSExtensionActivationSupportsImageWithMaxCount</key>
            <integer>10</integer>
            <key>NSExtensionActivationSupportsMovieWithMaxCount</key>
            <integer>1</integer>
            <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
            <integer>1</integer>
        </dict>
    </dict>


这篇关于如何在iOS 8系统范围的共享菜单中列出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆