示例#1
0
        static Task <bool> PlatformTryOpenAsync(Uri uri)
        {
            var nativeUrl = WebUtils.GetNativeUrl(uri);

            if (UIApplication.SharedApplication.CanOpenUrl(nativeUrl))
            {
                return(PlatformOpenAsync(nativeUrl));
            }

            return(Task.FromResult(false));
        }
示例#2
0
        static Task <bool> PlatformTryOpenAsync(Uri uri)
        {
            var nativeUrl = WebUtils.GetNativeUrl(uri);
            var canOpen   = NSWorkspace.SharedWorkspace.UrlForApplication(nativeUrl) != null;

            if (canOpen)
            {
                return(Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(nativeUrl)));
            }

            return(Task.FromResult(canOpen));
        }
示例#3
0
 static Task PlatformOpenAsync(Uri uri) =>
 PlatformOpenAsync(WebUtils.GetNativeUrl(uri));
示例#4
0
 static Task <bool> PlatformCanOpenAsync(Uri uri) =>
 Task.FromResult(UIApplication.SharedApplication.CanOpenUrl(WebUtils.GetNativeUrl(uri)));
示例#5
0
 internal static Task PlatformOpenAsync(Uri uri) =>
 Task.FromResult(NSWorkspace.SharedWorkspace.OpenUrl(WebUtils.GetNativeUrl(uri)));
示例#6
0
 static Task <bool> PlatformCanOpenAsync(Uri uri) =>
 Task.FromResult(NSWorkspace.SharedWorkspace.UrlForApplication(WebUtils.GetNativeUrl(uri)) != null);