6

I was using a UIActivityViewController instance in several previous versions of an app in order to share content through AirDrop, and other services. And now, without even recompiling, when running the app in iOS 11 Beta, the dialog (UIActivityViewController instance) shows the following row with the message "Unable to load":

enter image description here

Here is the code:

let handlerOk = { () -> Void in
    let activityItems = [NSURL(fileURLWithPath: fullPath, isDirectory: true)]
    self.viewControllerShare = UIActivityViewController(activityItems: activityItems, applicationActivities: nil)

    if let viewControllerShare = self.viewControllerShare {
        viewControllerShare.popoverPresentationController?.sourceView = sender

        let excludedActivities = [
            UIActivityType.postToFacebook,
            UIActivityType.postToTwitter,
            UIActivityType.postToWeibo,
            //UIActivityType.message,
            //UIActivityType.mail,
            UIActivityType.print,
            UIActivityType.copyToPasteboard,
            UIActivityType.assignToContact,
            UIActivityType.saveToCameraRoll,
            UIActivityType.addToReadingList,
            UIActivityType.postToFlickr,
            UIActivityType.postToVimeo,
            UIActivityType.postToTencentWeibo,
            UIActivityType.openInIBooks
        ]
        viewControllerShare.excludedActivityTypes = excludedActivities

        self.present(viewControllerShare, animated: true, completion: nil)
    }
}

Right now I'm compiling with XCode 9 in Swift 4, but I don't think this is relevant since as said, if an older version of the app is run in iOS 11 (compiled with XCode 8.somenthing or even downloading the binary from TestFlight) the problem is the same. So this really looks like an iOS 11 API problem...

Is there anything new regarding the dialog initialization that may prevent the "Unable to load" row to appear?

EDIT: I tested a third party app (from Apple) that uses the same sharing dialog, and found that that row belongs to iCloud. But I'm not using iCloud in my app, so the previous UIActivityViewController behaviour was correct: it just did not show anything. So I made an experiment: disabled from iOS' Settings the iCloud permission for that third party app, and it showed the same unkind "Unable to load" message. I hope this is not the way that the final iOS 11 version works, and that it's just a Beta problem.

That said, workarounds are still welcome! Thanks!

nbloqs
  • 3,152
  • 1
  • 28
  • 49

0 Answers0