зеркало из https://github.com/DeGsoft/maui-linux.git
[iOS] allow mailto: uri (#2646)
* [iOS] allow mailto: uri same as #1311 but for mailto: - fixes #2628 * Add mailto test
This commit is contained in:
Родитель
305261dccc
Коммит
501e54cb53
|
@ -18,7 +18,8 @@ namespace Xamarin.Forms.Controls.Issues
|
||||||
Content = new StackLayout
|
Content = new StackLayout
|
||||||
{
|
{
|
||||||
Children = {
|
Children = {
|
||||||
new Button { Text = "Call 123 4567", AutomationId = "tel", Command = new Command(() => Device.OpenUri(new System.Uri("tel:123 4567"))) }
|
new Button { Text = "Call 123 4567", AutomationId = "tel", Command = new Command(() => Device.OpenUri(new System.Uri("tel:123 4567"))) },
|
||||||
|
new Button { Text = "Mail support@xamarin.com", AutomationId = "mailto", Command = new Command(() => Device.OpenUri(new System.Uri("mailto:support@xamarin.com"))) }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,7 @@ namespace Xamarin.Forms
|
||||||
{
|
{
|
||||||
NSUrl url;
|
NSUrl url;
|
||||||
|
|
||||||
if (uri.Scheme == "tel")
|
if (uri.Scheme == "tel" || uri.Scheme == "mailto")
|
||||||
url = new NSUrl(uri.AbsoluteUri);
|
url = new NSUrl(uri.AbsoluteUri);
|
||||||
else
|
else
|
||||||
url = NSUrl.FromString(uri.OriginalString) ?? new NSUrl(uri.Scheme, uri.Host, uri.PathAndQuery);
|
url = NSUrl.FromString(uri.OriginalString) ?? new NSUrl(uri.Scheme, uri.Host, uri.PathAndQuery);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче