Esempio n. 1
0
 public void LaunchUri(string uri, Dictionary <string, object> options = null)
 {
     if (uri.StartsWith("http://") || uri.StartsWith("https://"))
     {
         Browser.OpenAsync(uri, BrowserLaunchMode.External);
     }
     else
     {
         var launched = false;
         if (GetDevice() == Core.Enums.DeviceType.Android && uri.StartsWith("androidapp://"))
         {
             launched = _deviceActionService.LaunchApp(uri);
         }
         if (!launched && (options?.ContainsKey("page") ?? false))
         {
             (options["page"] as Page).DisplayAlert(null, "", ""); // TODO
         }
     }
 }
 public void LaunchUri(string uri, Dictionary <string, object> options = null)
 {
     if ((uri.StartsWith("http://") || uri.StartsWith("https://")) &&
         Uri.TryCreate(uri, UriKind.Absolute, out var parsedUri))
     {
         try
         {
             Browser.OpenAsync(uri, BrowserLaunchMode.External);
         }
         catch (FeatureNotSupportedException) { }
     }
     else
     {
         var launched = false;
         if (GetDevice() == Core.Enums.DeviceType.Android && uri.StartsWith("androidapp://"))
         {
             launched = _deviceActionService.LaunchApp(uri);
         }
         if (!launched && (options?.ContainsKey("page") ?? false))
         {
             (options["page"] as Page).DisplayAlert(null, "", ""); // TODO
         }
     }
 }