[Bug] Share.RequestAsync does not open a share sheet on iPad iOS 13.3
Description
The sharing works fine on iPhone and even on iPad iOS10, but not on iPad's with iOS13.3 No share sheet appears.
Steps to Reproduce
- Just call a Share.RequestAsync, optionally on the main thread. await Share.RequestAsync(new ShareTextRequest { Uri = "http://myurl", Title = "My Title" }); I supplied an example forms project.
Expected Behavior
a share sheet should appear
Actual Behavior
nothing appears
Basic Information
- Version with issue: Xamarin.Essentials 1.3.1
- Last known good version: none
- IDE: Visual Studio for Mac 8.4 build 2637
- Platform Target Frameworks:
- iOS: 11.3
- Nuget Packages: Xamarin.Essentials 1.3.1
- Affected Devices: iPad
Reproduction Link
Duplicate of #942
I think the problem is addressed in #1002 and will be available in the 1.4.0 release.
@jamesmontemagno Is #942 the same issue? That appears to be related to the title and URL not appearing in reminders, this bug is related to the share sheet not appearing at all.
FYI I am also having the issue, I will have to rollback to a version without this bug for now.
@jamesmontemagno I think it's more a duplicate of #979
Ah yea, looks like duplicate of https://github.com/xamarin/Essentials/pull/1002 and #979
@Ruddy2007 are you saying that a previous version works but a new version does not? I would like to know the version numbers so I can go through and look at code changes.
@jamesmontemagno I was wrong, I tested the previous plugin versions assuming it would be an update that causes the bug. Turns out it is, in fact, iOS 13.2+ that causes the issue, not a code change.
@jamesmontemagno This issue is back.
with file have I issue too. await Share.RequestAsync(new ShareFileRequest { Title = Title, File = new ShareFile(filepath) });
Was fixed in 1.5.3.2: https://github.com/xamarin/Essentials/issues/1247 also has best practice on how to handle on iPad to set the rect.
It appears to be back in 1.7.0 for iOS 13.2+.
I have it again on iPad iOS 15.2 & Xamarin.Essentials 1.7.0
I still have this issue with Xamarin.Essentials 1.7.3 on iOS platform.
To overcome this bug you should pass View instance as Command parameter. And make sure that there are no additional views appear in time between you clicked on the Command and the "Share" window has appeared. I.e no confirmation popups, etc. Otherwise View parameter will be null or incorrect.
For more information check Xamarin.Essentials samples, "Share" sample in "Sharing file" part.