public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method MapServices.ProvideAPIKey("AIzaSyAZQBaY-ugQuwCWr4NkD-bybK7urElvNyY"); PlacesClient.ProvideApiKey("AIzaSyAZQBaY-ugQuwCWr4NkD-bybK7urElvNyY"); Firebase.Core.App.Configure(); Firebase.Database.Database.DefaultInstance.PersistenceEnabled = false; // Decide First Screen Window = new UIWindow(UIScreen.MainScreen.Bounds); var storyBoard = UIStoryboard.FromName("Main", null); if (Auth.DefaultInstance.CurrentUser != null) { var mainViewController = storyBoard.InstantiateViewController("MainViewController") as MainViewController; this.SetWindow(Window); Window.RootViewController = mainViewController; } else { var loginViewController = storyBoard.InstantiateViewController("LoginViewController") as LoginViewController; this.SetWindow(Window); Window.RootViewController = loginViewController; } return(true); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method var splitViewController = UIStoryboard.FromName("Main", null).InstantiateViewController(nameof(UISplitViewController)) as UISplitViewController; splitViewController.Delegate = this; splitViewController.PreferredDisplayMode = UISplitViewControllerDisplayMode.PrimaryOverlay; Window = new UIWindow(UIScreen.MainScreen.Bounds) { RootViewController = splitViewController }; Window.MakeKeyAndVisible(); if (string.IsNullOrWhiteSpace(GoogleApiKey.Key)) { var message = $"Configure the Key property inside GoogleApiKey class for your bundle {NSBundle.MainBundle.BundleIdentifier}"; ShowMessage("Google API Key is missing...", message, Window.RootViewController); } else { // Provide the Places API with your API key. PlacesClient.ProvideApiKey(GoogleApiKey.Key); // Provide the Maps API with your API key. You may not need // this in your app, however we do need this for the demo // app as it uses Maps. MapServices.ProvideApiKey(GoogleApiKey.Key); } return(true); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { IsInDesignerView = false; PlacesClient.ProvideApiKey(ConfidentialData.mapsk); Google.Maps.MapServices.ProvideAPIKey(ConfidentialData.mapsk); UINavigationBar.Appearance.TintColor = AppUtils.AppAltColour; UINavigationBar.Appearance.BackgroundColor = AppUtils.AppMainColour;//.ColorWithAlpha(0.8f); UINavigationBar.Appearance.Translucent = true; Online = Reachability.RemoteHostStatus() != NetworkStatus.NotReachable; Reachability.ReachabilityChanged += delegate { Online = Reachability.RemoteHostStatus() != NetworkStatus.NotReachable; if (Online) { WhenOnline?.Invoke(); WhenOnline = null; } Console.WriteLine("Network change - Online: " + Online); }; // Start a new thread to check and see if the user has iCloud // enabled. new Thread(new ThreadStart(() => { // Inform caller that we are checking for iCloud CheckingForiCloud = true; // Checks to see if the user of this device has iCloud // enabled var uburl = NSFileManager.DefaultManager.GetUrlForUbiquityContainer(null); // Connected to iCloud? if (uburl == null) { // No, inform caller HasiCloud = false; iCloudUrl = null; Console.WriteLine("Unable to connect to iCloud"); } else { // Yes, inform caller and save location the the Application Container HasiCloud = true; iCloudUrl = uburl; Console.WriteLine("Connected to iCloud"); // If we have made the connection with iCloud, start looking for documents //InvokeOnMainThread(FindDocument); } // Inform caller that we are no longer looking for iCloud CheckingForiCloud = false; })).Start(); return(true); }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { var apikey = "YOUR-API-KEY-HERE"; PlacesClient.ProvideApiKey(apikey); MapServices.ProvideAPIKey(apikey); global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { var apikey = "AIzaSyC-HHfSqamKxBaPtm7Rk0FY1TRGiWHguBQ"; PlacesClient.ProvideApiKey(apikey); MapServices.ProvideAPIKey(apikey); Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init(); global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var config = new PlacePickerConfig(null); placePickerViewController = new PlacePickerViewController(config) { Delegate = this, ModalPresentationStyle = UIModalPresentationStyle.Popover }; placesClient = PlacesClient.SharedInstance; photosMetadata = new PlacePhotoMetadata [0]; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { NSDictionary dictionary = NSDictionary.FromObjectAndKey(NSObject.FromObject(userAgent), NSObject.FromObject("UserAgent")); NSUserDefaults.StandardUserDefaults.RegisterDefaults(dictionary); PlacesClient.ProvideApiKey("AIzaSyC0m0Td_wjHRWlS9uCOyFpZ_0kt6JYPRl8"); MapServices.ProvideAPIKey("AIzaSyC0m0Td_wjHRWlS9uCOyFpZ_0kt6JYPRl8"); global::Xamarin.Forms.Forms.Init(); CarouselViewRenderer.Init(); MobileAds.Configure("ca-app-pub-8565023384951297/2042844969"); FormsMaps.Init(); //Paypal initialization CrossPayPalManager.Init(new PayPalConfiguration( PayPalEnvironment.Sandbox, "APP-80W284485P519543T" ) { AcceptCreditCards = true, Language = "en_US", ShippingAddressOption = ShippingAddressOption.None } ); ImageCircleRenderer.Init(); FFImageLoading.Forms.Touch.CachedImageRenderer.Init(); PrepareRemoteNotification(); App.ScreenHeight = (double)UIScreen.MainScreen.Bounds.Height; App.ScreenWidth = (double)UIScreen.MainScreen.Bounds.Width; Xamarin.Auth.Presenters.OAuthLoginPresenter.PlatformLogin = (authenticator) => { var oAuthLogin = new OAuthLoginPresenter(); oAuthLogin.Login(authenticator); }; MessagingCenter.Subscribe <ImageSource>(this, "Share", IosMethods.Share, null); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); var apikey = "AIzaSyCXfHhoBNynUtBdSigDfO0lClJjJi2EKvo"; PlacesClient.ProvideApiKey(apikey); MapServices.ProvideAPIKey(apikey); CarouselViewRenderer.Init(); Xamarin.FormsMaps.Init(); LoadApplication(new App()); if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null ); app.RegisterUserNotificationSettings(notificationSettings); } if (options != null) { if (options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey)) { var localNotification = options[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification; if (localNotification != null) { UIAlertController okayAlertController = UIAlertController.Create(localNotification.AlertAction, localNotification.AlertBody, UIAlertControllerStyle.Alert); okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null)); app.KeyWindow.RootViewController.PresentViewController(okayAlertController, true, null); UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; } } } return(base.FinishedLaunching(app, options)); }
public BaseHttpClient(string baseUrl, string mediaType, string timeout, string authenticationScheme, string authenticationToken) { _placesClient = new PlacesClient(baseUrl, mediaType, timeout, authenticationScheme, authenticationToken); _eventsClient = new EventsClient(baseUrl, mediaType, timeout, authenticationScheme, authenticationToken); }