protected override void OnAppearing() { base.OnAppearing(); //string dia1 = VariablesGlobales.FechaFin.Date.ToString().Substring(0, 10); //string dia2 = VariablesGlobales.FechaInicio.Date.ToString().Substring(0, 10); string Fecha2 = VariablesGlobales.FechaFin.Date.ToString("yyyy-MM-dd"); string Fecha1 = VariablesGlobales.FechaInicio.Date.ToString("yyyy-MM-dd"); int dias = (int)(VariablesGlobales.FechaFin.Date - VariablesGlobales.FechaInicio.Date).TotalDays; #if __ANDROID__ Browser.Source = "https://api.pxsol.com/search/insert?Pos=PullmanCityCenterRosario&ProductID=3176&Currency=ARS&Lng=es&Type=Hotel&Start=" + Fecha1 + "&End" + Fecha2 + "&Nights=" + dias + "&Groups=1&GroupsForm=1:" + VariablesGlobales.NumeroHuespedes + ",0,0&Device=Mobile&tag=developer"; //Browser.Source="https://api.pxsol.com/search/insert?Pos=PullmanCityCenterRosario&ProductID=3176&Currency=ARS&Lng=es&Type=Hotel&Start=2018-07-12&End=2018-07-12&Nights=0&Groups=1&GroupsForm=1:1,0,0&Device=Computer&tag=developer"; #endif #if __IOS__ var uri = new Uri("https://api.pxsol.com/search/insert?Pos=PullmanCityCenterRosario&ProductID=3176&Currency=ARS&Lng=es&Type=Hotel&Start=" + Fecha1 + "&End" + Fecha2 + "&Nights=" + dias + "&Groups=1&GroupsForm=1:" + VariablesGlobales.NumeroHuespedes + ",0,0&Device=Mobile&tag=developer"); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); Browser.Source = nsurl.AbsoluteUrl.ToString(); #endif }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); // This screen name value will remain set on the tracker and sent with // hits until it is set to a new value or to null. Gai.SharedInstance.DefaultTracker.Set(GaiConstants.ScreenName, "View Controller"); Gai.SharedInstance.DefaultTracker.Send(DictionaryBuilder.CreateAppView().Build()); var bundle = Foundation.NSBundle.MainBundle; //var resource = bundle.PathForResource("splashipad", "mp4"); //May need to comment... experimenting with performance cost of loading video var fileName = (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)? "globalairphone" : "globalairtablet"; var resource = bundle.PathForResource(fileName, "mov"); //// set the video VideoUrl = new Foundation.NSUrl(resource, false); FillMode = ScalingMode.ResizeAspectFill; this.PerformSegue("loginSegue", this); }
public override void ViewDidLoad() { base.ViewDidLoad(); var traslatenumber = string.Empty; traslatebutton.TouchUpInside += (object sender, EventArgs e) => { var traslator = new PhoneTranslator(); traslatenumber = traslator.ToNumber(phonenumbertext.Text); if (string.IsNullOrEmpty(traslatenumber)) { Callbutton.SetTitle("Llamar", UIControlState.Normal); Callbutton.Enabled = false; } else { Callbutton.SetTitle($"Llamar al {traslatenumber}", UIControlState.Normal); Callbutton.Enabled = true; } }; Callbutton.TouchUpInside += (object sender, EventArgs e) => { var URL = new Foundation.NSUrl($"tel:{traslatenumber}"); if (!UIApplication.SharedApplication.OpenUrl(URL)) { var alert = UIAlertController.Create("No Soportado", "El esquema 'tel:' no es soportado en este dispositivo", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(alert, true, null); } }; // Perform any additional setup after loading the view, typically from a nib. }
void Handle_Clicked_1(object sender, System.EventArgs e) { #if __IOS__ if (VariablesGlobales.TipoChat == "casino") { var uri = new Uri(Application.Current.Properties["RutaChatCasino"].ToString() + "/" + Mensajito.Text); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); WebViewChat1.Source = nsurl.ToString(); Mensajito.Text = string.Empty; } else if (VariablesGlobales.TipoChat == "hotel") { var uri = new Uri(Application.Current.Properties["RutaChatHotel"].ToString() + "/" + Mensajito.Text); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); WebViewChat1.Source = nsurl.ToString(); Mensajito.Text = string.Empty; } #endif }
public override void ViewDidLoad() { base.ViewDidLoad(); this.Title = Constants.__TITLE_ABOUT__; Foundation.NSUrl url = new Foundation.NSUrl("http://rcervantes.me/"); webView.LoadRequest(new Foundation.NSUrlRequest(url)); webView.ScalesPageToFit = true; }
private void CallNumber(string phoneNumber) { url = new Foundation.NSUrl("tel:" + phoneNumber); var alert = UIAlertController.Create("Alert", "Simulated call to " + phoneNumber, UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, MakeCallAction)); alert.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null)); PresentViewController(alert, true, null); }
/// <summary> /// Launchs for string. /// </summary> /// <returns><c>true</c>, if for string was launched, <c>false</c> otherwise.</returns> /// <param name="route">Route.</param> private bool LaunchForString(string route) { using (var url = new Foundation.NSUrl(route)) { if (UIApplication.SharedApplication.CanOpenUrl(url)) { UIApplication.SharedApplication.OpenUrl(url); return(true); } } return(false); }
public override bool OpenUrl(UIKit.UIApplication p_app, Foundation.NSUrl p_url, Foundation.NSDictionary p_options) { var doc = new UIKit.UIDocument(p_url); string path = doc.FileUrl?.Path; if (!string.IsNullOrEmpty(path)) { _ = Startup.Launch <Stub>(null, new ShareInfo(path)); } return(true); }
void ButtonLoginCustomTabsOAuth2_TouchUpInside(object sender, EventArgs e) { SetUpDataPublicNonSensitive(); SetUpDataPrivateSensitiveSecret(); Foundation.NSUrl nsurl = new Foundation.NSUrl(url); SafariServices.SFSafariViewController vc = null; vc = new SafariServices.SFSafariViewController(nsurl, true); PresentViewController(vc, true, null); return; }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. TranslateButton.TouchUpInside += (object sender, EventArgs e) => { var Translator = new PhoneTranslator(); TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text); if (string.IsNullOrWhiteSpace(TranslatedNumber)) { CallButton.SetTitle("Llamar", UIControlState.Normal); CallButton.Enabled = false; } else { CallButton.SetTitle($"Llamar al {TranslatedNumber}", UIControlState.Normal); CallButton.Enabled = true; } }; CallButton.TouchUpInside += (object sender, EventArgs e) => { phoneNumbers.Add(TranslatedNumber); var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}"); if (!UIApplication.SharedApplication.OpenUrl(URL)) { var alert = UIAlertController.Create("No Soportado.", "El esquema 'tel:' no es soportado por este dispositivo", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null)); PresentViewController(alert, true, null); } }; CallHistoryButton.TouchUpInside += (sender, e) => { if (this.Storyboard.InstantiateViewController("CallHistoryController") is CallHistoryController controller) { controller.PhoneNumbers = this.phoneNumbers; this.NavigationController.PushViewController(controller, true); } }; VerifyButton.TouchUpInside += (sender, e) => { if (this.Storyboard.InstantiateViewController("ValidateController") is ValidarActividadViewController validarController) { this.NavigationController.PushViewController(validarController, true); } }; }
public EmailAttachment(Foundation.NSUrl file) { File = file ?? throw new ArgumentNullException(nameof(file)); FilePath = file.Path; FileName = Foundation.NSFileManager.DefaultManager.DisplayName(file.Path); var id = MobileCoreServices.UTType.CreatePreferredIdentifier(MobileCoreServices.UTType.TagClassFilenameExtension, file.PathExtension, null); var mimeTypes = MobileCoreServices.UTType.CopyAllTags(id, MobileCoreServices.UTType.TagClassMIMEType); if (mimeTypes.Length > 0) { ContentType = mimeTypes[0]; } }
public static void OpenBrowser(string url) { #if iOS var nsUrl = new Foundation.NSUrl(url); UIKit.UIApplication.SharedApplication.OpenUrl(nsUrl); #elif ANDROID var uri = Android.Net.Uri.Parse(url); var intent = new Intent(Intent.ActionView, uri); ActivityDelegate.Instance.Activity.StartActivity(intent); #else System.Diagnostics.Process.Start(url); #endif }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var TranslatedNumber = string.Empty; TranslateButton.TouchUpInside += (object sender, EventArgs e) => { var Translator = new PhoneTranslator(); TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text); if (string.IsNullOrWhiteSpace(TranslatedNumber)) { CallButton.SetTitle("Llamar", UIControlState.Normal); CallButton.Enabled = false; } else { CallButton.SetTitle($"Llamar al {TranslatedNumber}", UIControlState.Normal); CallButton.Enabled = true; } }; CallButton.TouchUpInside += (object sender, EventArgs e) => { var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}"); if (!UIApplication.SharedApplication.OpenUrl(URL)) { var Alert = UIAlertController.Create("No soportado", "El esquema 'tel:' no es soportado en este dispositivo", UIAlertControllerStyle.Alert); Alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null)); PresentViewController(Alert, true, null); } }; Button0.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("0"); }; Button1.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("1"); }; Button2.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("2"); }; Button3.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("3"); }; Button4.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("4"); }; Button5.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("5"); }; Button6.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("6"); }; Button7.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("7"); }; Button8.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("8"); }; Button9.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("9"); }; ButtonAsterisc.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("*"); }; ButtonSharp.TouchUpInside += (object sender, EventArgs e) => { ShowDisplay("#"); }; }
public EmailAttachment(Foundation.NSUrl file) { if (file == null) { throw new ArgumentNullException(nameof(file)); } File = file; FilePath = file.Path; FileName = Foundation.NSFileManager.DefaultManager.DisplayName(file.Path); string id = MobileCoreServices.UTType.CreatePreferredIdentifier(MobileCoreServices.UTType.TagClassFilenameExtension, file.PathExtension, null); ContentType = MobileCoreServices.UTType.CopyAllTags(id, MobileCoreServices.UTType.TagClassMIMEType)[0]; }
public bool OpenApp(string appId) { var defaultUrl = new Foundation.NSUrl(appId + "://"); if (UIApplication.SharedApplication.CanOpenUrl(defaultUrl)) { UIApplication.SharedApplication.OpenUrl(defaultUrl); return(true); } UIApplication.SharedApplication.OpenUrl( new Foundation.NSUrl("https://www." + appId + ".com") ); return(false); }
private static void Initialize() { lock (__locker) { if (__updater == null) { __updater = new Sparkle.SUUpdater() { AutomaticallyChecksForUpdates = true, AutomaticallyDownloadsUpdates = false, UpdateCheckInterval = 60 * 60 * 12 // in seconds (12 hours) }; __originalFeedUrl = __updater.FeedURL; } } }
public bool RedirectToRatingPage() { if (!_settings.Data.Store.AppleLink.HasValue()) { return(false); } var appleStoreLink = new Foundation.NSUrl(_settings.Data.Store.AppleLink); UIApplication.SharedApplication.OpenUrl(appleStoreLink); appleStoreLink.Dispose(); appleStoreLink = null; return(true); }
public WebViewTienda() { InitializeComponent(); NavigationPage.SetTitleIcon(this, "*****@*****.**"); #if __ANDROID__ Browser.Source = "https://www.tienda.citycenter-rosario.com.ar/"; #endif #if __IOS__ var uri = new Uri("https://www.tienda.citycenter-rosario.com.ar/"); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); Browser.Source = nsurl.AbsoluteUrl.ToString(); #endif }
protected AuthenticateUIType GetPlatformUINative() { System.Uri uri_netfx = this.GetInitialUrlAsync().Result; Foundation.NSUrl url_ios = new Foundation.NSUrl(uri_netfx.AbsoluteUri); // SafariServices.SFSafariViewController AuthenticateUIType ui = null; global::SafariServices.SFSafariViewController sfvc = null; if ( // double check (trying to lookup class and check iOS version) ObjCRuntime.Class.GetHandle("SFSafariViewController") != IntPtr.Zero && UIKit.UIDevice.CurrentDevice.CheckSystemVersion(9, 0) ) { sfvc = new global::SafariServices.SFSafariViewController(url_ios, false); #if DEBUG this.Title = "Auth " + sfvc.GetType().ToString(); System.Diagnostics.Debug.WriteLine($"SFSafariViewController.Title = {this.Title}"); #endif sfvc.Delegate = new NativeAuthSafariViewControllerDelegate(this); sfvc.Title = this.Title; ui = sfvc; } else { // Fallback to Embedded WebView StringBuilder msg = new StringBuilder(); msg.AppendLine("SafariViewController not available!"); msg.AppendLine("Fallback to embbeded web view "); this.ShowErrorForNativeUIAlert(msg.ToString()); this.GetPlatformUIEmbeddedBrowser(); } return(ui); }
public WebViewTienda2() { InitializeComponent(); NavigationPage.SetTitleIcon(this, "*****@*****.**"); #if __ANDROID__ Browser.Source = VariablesGlobales.RutaTiendaGuardados; #endif #if __IOS__ var uri = new Uri(VariablesGlobales.RutaTiendaGuardados); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); Browser.Source = nsurl.AbsoluteUrl.ToString(); #endif //Browser.Source = VariablesGlobales.RutaTiendaGuardados; }
public override void ViewDidLoad() { base.ViewDidLoad(); var translatedNumber = string.Empty; translateButton.TouchUpInside += delegate { var translator = new PhoneTranslator(); translatedNumber = translator.ToNumber(phoneNumberText.Text); if (string.IsNullOrEmpty(translatedNumber)) { // No hay número a llamar callButton.SetTitle("Llamar", UIControlState.Normal); callButton.Enabled = false; } else { // Hay un posible número telefónico a llamar callButton.SetTitle($"Llamar a {translatedNumber}", UIControlState.Normal); callButton.Enabled = true; } }; callButton.TouchUpInside += delegate { var url = new Foundation.NSUrl($"tel:{translatedNumber}"); // Utilizar el manejador de URL con el prefijo tel: para invocar a la // aplicación Phone de Apple, de lo contrario mostrar un diálogo de alerta. if (!UIApplication.SharedApplication.OpenUrl(url)) { var alert = UIAlertController.Create("No soportado", "El esquema 'tel:' no es soportado en este dispositivo", UIAlertControllerStyle.Alert); alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(alert, true, null); } }; // Perform any additional setup after loading the view, typically from a nib. }
protected override void OnAppearing() { base.OnAppearing(); #if __ANDROID__ Browser.Source = VariablesGlobales.RutaCompraOnline; #endif #if __IOS__ var uri = new Uri(VariablesGlobales.RutaCompraOnline); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); Browser.Source = nsurl.AbsoluteUrl.ToString(); #endif //Browser.Source = VariablesGlobales.RutaCompraOnline; }
public void Play(string folder, string filename) { try { string file = System.IO.Path.Combine("Music", filename); Foundation.NSUrl Soundurl = Foundation.NSUrl.FromFilename(file); player = AVFoundation.AVAudioPlayer.FromUrl(Soundurl); player.CurrentTime = player.Duration * 2; player.NumberOfLoops = 1; player.Volume = 1.0f; player.FinishedPlaying += DidFinishPlaying; player.PrepareToPlay(); player.Play(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine("PlaySound: Error: " + e.Message, true); } }
public override void ViewDidLoad() { base.ViewDidLoad(); var TranslatedNumber = string.Empty; TranslateButton.TouchUpInside += (object sender, EventArgs e) => { var Translator = new PhoneTranslator(); TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text); if (string.IsNullOrWhiteSpace(TranslatedNumber)) { CallButton.SetTitle("Llamar", UIControlState.Normal); CallButton.Enabled = false; } else { CallButton.SetTitle($"Llamar al {TranslatedNumber}", UIControlState.Normal); CallButton.Enabled = true; } }; CallButton.TouchUpInside += (object sender, EventArgs e) => { var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}"); if (!UIApplication.SharedApplication.OpenUrl(URL)) { var Alert = UIAlertController.Create("No soportado", "El esquema 'tel:' no es soportado en este dispositivo", UIAlertControllerStyle.Alert); Alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); PresentViewController(Alert, true, null); } }; }
public override void ViewDidLoad() { base.ViewDidLoad(); var TranslatedNumber = string.Empty; // Perform any additional setup after loading the view, typically from a nib. TranslateButton.TouchUpInside += (object sender, EventArgs e) => { var Translator = new PhoneTranslator(); TranslatedNumber = Translator.ToNumber(PhoneNumberText.Text); if (string.IsNullOrWhiteSpace(TranslatedNumber)) { //No hay numero a llamar CallButton.SetTitle("Llamar", UIControlState.Normal); CallButton.Enabled = false; } else { //Hay un posible numero telefonico a llamar CallButton.SetTitle($"llamar al {TranslatedNumber}", UIControlState.Normal); CallButton.Enabled = true; } }; CallButton.TouchUpInside += (object sender, EventArgs e) => { var URL = new Foundation.NSUrl($"tel:{TranslatedNumber}"); //Utilizar el manejador de URL con el prefijo tel: para invocar //a la aplicacion Phone de Apple, de lo contrario mostrar un dialogo de alerta. if (!UIApplication.SharedApplication.OpenUrl(URL)) { var Alert = UIAlertController.Create("No soportado", "El esquema 'tel:' no es soportado en este dispositivo", UIAlertControllerStyle.Alert); Alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null)); PresentViewController(Alert, true, null); } }; }
public virtual void OpenUrl(Uri url) { if (url == null) { throw new ArgumentNullException(nameof(url)); } #if Android var mgr = new Android.Support.CustomTabs.CustomTabsActivityManager((Android.App.Activity)_context); mgr.CustomTabsServiceConnected += delegate { mgr.LaunchUrl(url.ToString()); }; mgr.BindService(); return; #elif iOS Foundation.NSUrl destination = Foundation.NSUrl.FromString(url.AbsoluteUri); using (SafariServices.SFSafariViewController sfViewController = new SafariServices.SFSafariViewController(destination)) { UIKit.UIWindow window = UIKit.UIApplication.SharedApplication.KeyWindow; UIKit.UIViewController controller = window.RootViewController; controller.PresentViewController(sfViewController, true, null); return; } #else if (_deviceService.RuntimePlatform == RuntimePlatform.Android || _deviceService.RuntimePlatform == RuntimePlatform.iOS) { throw new InvalidOperationException($"Register {nameof(DefaultBrowserService)} using platform specific {nameof(IPlatformInitializer)}"); } _deviceService.OpenUri(url); #endif }
protected AuthenticateUIType GetPlatformUINative() { System.Uri uri_netfx = this.GetInitialUrlAsync().Result; Foundation.NSUrl url_ios = new Foundation.NSUrl(uri_netfx.AbsoluteUri); // SafariServices.SFSafariViewController AuthenticateUIType ui = null; global::SafariServices.SFSafariViewController sfvc = null; sfvc = new global::SafariServices.SFSafariViewController(url_ios, false); #if DEBUG this.Title = "Auth " + sfvc.GetType().ToString(); System.Diagnostics.Debug.WriteLine($"SFSafariViewController.Title = {this.Title}"); #endif sfvc.Delegate = new NativeAuthSafariViewControllerDelegate(this); sfvc.Title = this.Title; ui = sfvc; return(ui); }
void Handle_Clicked(object sender, System.EventArgs e) { #if __IOS__ if (VariablesGlobales.TipoChat == "casino") { var uri = new Uri("https://citycenter-rosario.com.ar/chat/terminar_chat_app/" + Application.Current.Properties["VariableChatCasino"].ToString()); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); WebViewChat1.Source = nsurl.ToString(); Application.Current.Properties["RutaChatCasino"] = ""; //Application.Current.Properties["VariableChatCasino"] = ""; Application.Current.Properties["Casino"] = 1; } else if (VariablesGlobales.TipoChat == "hotel") { var uri = new Uri("https://citycenter-rosario.com.ar/chat/terminar_chat_app/" + Application.Current.Properties["VariableChatHotel"].ToString()); var nsurl = new Foundation.NSUrl(uri.GetComponents(UriComponents.HttpRequestUrl, UriFormat.UriEscaped)); WebViewChat1.Source = nsurl.ToString(); //Application.Current.Properties["VariableChatHotel"] = ""; Application.Current.Properties["RutaChatHotel"] = ""; Application.Current.Properties["Hotel"] = 1; } Application.Current.SavePropertiesAsync(); Task.Delay(1000); Navigation.PopAsync(); #endif }
public static bool OpenUrl(this IWebAuthenticator webAuthenticator, UIKit.UIApplication app, Foundation.NSUrl url, Foundation.NSDictionary options) => webAuthenticator.OpenUrl(new Uri(url.AbsoluteString));
public EmailMessageBuilder WithAttachment(Foundation.NSUrl file) { email.Attachments.Add(new EmailAttachment(file)); return(this); }