restrict airdrop feature for specific app only ios7

350 Views Asked by At

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.

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..!!

1

There are 1 best solutions below

0
On

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)