Reputation: 5725
I am sending the remote file (for example: image file, pdf file ... ) to Airdrop. I have only the direct link of this file : http://example.com/xxx/png. Currently, I am doing something like below code
NSString *filePath = self downloadFileFromServerWithURL
NSURL *urlFilePath = [NSURL fileURLWithPath:filePath];
NSArray *Items = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:indexPath.row],
urlFilePath,nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:Items applicationActivities:[NSArray arrayWithObjects:xxx, yyy,nil];
[self presentViewController:activityViewController animated:YES completion:nil];
So, my question is, how can I share the remote file with Airdrop without downloading it before? I show a lot of iOS softwares can do that, like DropBox
Thank you
Upvotes: 0
Views: 426
Reputation: 4656
you should look into using a subclass of UIActivityItemProvider which will let you asynchronously get/generate the actual item to be shared. The AirDrop sample code has an example of this.
Upvotes: 1