-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error in Flutter Share only on iPad #44962
Comments
Hi @saeedjassani |
Code to reproduce:
|
Looking at the code for the share plugin, I see this
so unless the caller supplies a 'sharePositionOrigin' rect, this will fail on an iPad (as on iPad the 'popoverPresentationController.sourceRect' has to be supplied), so its a bug in the plugin. Simple workaround would be to pass in a (non-empty, so has width and height) sharePositionOrigin' rect in the Share.share(...) function (but needs the plugin updated to supply a default rect on iPad if no rect supplied - so check if userInterfaceIdiom == UIUserInterfaceIdiomPad - perhaps positioned bottom centre). |
Thanks for you comment @agreensh . I don't have any experience of iOS development. Can you suggest any work-around for me which which help me solve the issue? |
I have... in your Dart code, pass the |
I have the same problem. Cause
In iPad, ActionSheet always shows as popover. WorkaroundI expressly pass await Share.share(
'foo',
sharePositionOrigin: Rect.fromCenter(center: Offset(100, 100), width: 100, height: 100),
) if I attatch workaround to only Future<bool> _isIpad() async {
final iosInfo = await DeviceInfoPlugin().iosInfo;
return iosInfo.name.toLowerCase().contains('ipad');
} But this behavior is not ideal... |
I am facing the same issues too. The share sheet refuses to pop up on iPad, but works fine on iPhone. |
Have you used the workaround? |
Yes I have used the workaround and now the Share sheet shows up on the iPad, however, it's not an ideal long term solution. |
Hi @saeedjassani |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
When using the Share plugin on iPad, I am getting the following error:
Sharing functionality is working fine in Android as well as iPhones. Getting the above error in iPad only.
Flutter doctor output:
Any help will be greatly appreciated, thanks!
The text was updated successfully, but these errors were encountered: