xamarin / Essentials

Xamarin.Essentials is no longer supported. Migrate your apps to .NET MAUI, which includes Maui.Essentials.
https://aka.ms/xamarin-upgrade
Other
1.53k stars 506 forks source link

[Bug] Xamarin.Essentials Share not working on iOS #2096

Open LucioMSP opened 1 year ago

LucioMSP commented 1 year ago

Description

The share sheet does not show any icons of other apps on iOS 15.5 and iOS 15.7.6

Steps to Reproduce

  1. Create a Xamarin.Forms app to consume Xamarin.Essentials Share
  2. Click on that icon to show Share Sheet

Expected Behavior

Share Sheet with icons of other applications

Actual Behavior

Share Sheet is empty

Code Sample

if (Device.RuntimePlatform == Device.iOS) { await Share.RequestAsync(new ShareTextRequest { Title = "Name", Text = "", Subject = "", Uri = ViewModel.PersonalDetail.AccessUrl.ToString() }); }

Basic Information

It happens both on physical device and emulator.

Screenshots

Screenshot 2023-07-28 at 2 30 19 PM

Reproduction Link

If I leave the following code in the Uri it displays as follows:

await Share.RequestAsync(new ShareTextRequest { Title = "Name", Text = "", Subject = "", Uri = "htttps.google.com" });

Screenshot 2023-07-28 at 4 21 20 PM
jamesmontemagno commented 1 year ago

Seems like the url isn't valid to share... can you just hard code it in to see what happens?

Also you will want to test it on a real device for sure.

LucioMSP commented 1 year ago

If I have tried physical (real) phones, that's why I dared to create the Issue. With respect to putting it directly, if it works, the detail is when I pass the ViewModel values to it, if it worked before but it seems that in the new version of iOS it doesn't. The code works perfectly on Android.

In fact, in a Console, if the text that I want to share appears.

Screenshot 2023-07-28 at 6 20 08 PM Screenshot 2023-07-28 at 6 19 20 PM