仅针对特定应用ios7限制空投功能 [英] restrict airdrop feature for specific app only ios7

查看:199
本文介绍了仅针对特定应用ios7限制空投功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用airdrop功能创建一个应用程序,我想将一个消息(NSString)从一个设备传递到其他设备。我已完成该部分,但我想仅为我的应用程序限制此功能。目前发生的情况是,当我通过airdrop(假设设备A)在设备附近发送NSString时,即使我的应用程序未安装在其中,其他设备B也可以接收此字符串。

I am creating one application using airdrop feature, I want to pass one message(NSString) from one device to other device. I had completed that part, but I want restrict this feature for my application only. Currently what happen, when I am sending NSString via airdrop (let say Device A) in near by device, the other Device B can receive this string even if my application is not installed in it.

我的要求是只将一个消息从一个设备共享到另一个设备,这个事情只能通过airdrop进行我的应用程序。请给出建议。谢谢.. !!

My requirement is to share one message from one device to other device only and this thing happen via airdrop for my application only. Please give suggestion. Thanks..!!

推荐答案

要确保只有您的应用可以打开此有效负载,您必须注册一个新的UTI系统,并在提供要共享的项目时提供相同的UTI UIActivityViewcontroller (使用 UIActivityItemSource 协议)。 AirDrop示例代码中有一个注册新示例的示例UTI并使用它(参见通过AirDrop发送/接收自定义类的实例作为数据部分样本)

To ensure that only your app can open this "payload" you must register a new UTI with the system, and supply that same UTI when providing the item to share to UIActivityViewcontroller (using the UIActivityItemSource protocol). The AirDrop sample code has an example of registering a new UTI and using it (see the "Sending/receiving an instance of a custom class as data via AirDrop" parts of the sample)

这篇关于仅针对特定应用ios7限制空投功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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