iOS Question Sharing with ActivityViewController - Error in iPad

hatzisn

Expert
Licensed User
Longtime User
I use in a b4i app this library I created.
The library uses for iOS in iPhone the Activity View Controller included in the iPhone library.


It works flawlessly in iPhone but in iPad it does not show at all. To be more precise it shows on the top an empty area (you can download in the above link the "Social Share.zip" and try the project in appetize.io) .


Google mentions this in the search:

On iPad, a UIActivityViewController must be presented as a popover using popoverPresentationController, unlike iPhone, where it can be presented modally. Failure to specify a source view or rectangle will cause it not to appear, as explained in the Apple Documentation.

it also shows this snippet:

Swift:
if let popoverController = activityViewController.popoverPresentationController {
    popoverController.sourceView = sender // button, view, etc.
    popoverController.sourceRect = sender.bounds // or specific area
}
present(activityViewController, animated: true)

and presents also these links


Is there a way to present in iPad with NativeObject what is presented above?


Implementaion in github:

 
Last edited:
Top