Dan Peresenchuk Dan Peresenchuk - 4 months ago 44
iOS Question

Sharing multiple files between apps using UIActivityViewController in iOS 10

I have two applications named, for example, App_A and App_B. I have UIActivityViewController to share single or group of files:

NSArray *itemsToShare = [self getItemsToShare]; // returns list with NSUrl objects
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
// presenting controller

When prompted, popover contains App_B in the list. But when I select an App_B icon, I receive only the first url from the itemsToShare list at my application:openURL:sourceApplication:annotation: method in App_B delegate. Also, Documents/Inbox folder contains only one file no matter how much files I try to share.

Why UIActivityViewController send only one file? Is it normal behaviour, or I missed something?


There are different ways to communicate info to another app. In your case, you have decided to use application:openURL:sourceApplication:annotation:. In that case, yes, this is only for handing one object to other app. It is intended for letting the user copy a file from the current app to the other app's inbox.