3

I'm trying to implement Airdrop feature in my app but I'm not able to see any nearby device even if Airdrop is enabled on both the e the devices. But if I go to Safari/Mail or any other app to use Airdrop, then the devices start appearing everywhere (INCLUDING MY APP also). I'm using the following code:

NSString *path = [[NSBundle mainBundle] pathForResource:@"Untitled" ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:path];
NSData *data = [NSData dataWithContentsOfURL:url];
NSArray *arr = [NSArray arrayWithObject:data];

UIActivityViewController *actVC = [[UIActivityViewController alloc] initWithActivityItems:arr applicationActivities:nil];

[self presentViewController:actVC animated:YES completion:nil];

Below is the image showing the no devices are detected.

airdrop image

I'm not getting what may be the problem for this. Do I need to have some specific settings in my app so that I can see near-by devices without using Safari or any other app.

4

0 回答 0