protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); #region Initializing Packages UserDialogs.Init(this); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); CrossCurrentActivity.Current.Init(this, savedInstanceState); UserDialogs.Init(this); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); Plugin.InputKit.Platforms.Droid.Config.Init(this, savedInstanceState); CarouselViewRenderer.Init(); XamEffects.Droid.Effects.Init(); Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this; #endregion #region Status Bar //To set Status Bar Color : Window.AddFlags(WindowManagerFlags.Fullscreen); Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen); Window.SetStatusBarColor(Android.Graphics.Color.ParseColor("#025FA5")); #endregion #region Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("OTMyNDlAMzEzNzJlMzEyZTMwWVAxejJTOFhSaUswQm1MUGJoWC93K3pyRWpkdkNVM0oyemhkK1ZzY0pNbz0="); #endregion LoadApplication(new App()); }
// // 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) { Forms.Init(); CarouselViewRenderer.Init(); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(); Xamarin.FormsMaps.Init(); Rg.Plugins.Popup.Popup.Init(); TintedImageRenderer.Init(); UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(UIApplication.BackgroundFetchIntervalMinimum); Distribute.DontCheckForUpdatesInDebug(); //AppCenter.Start("{Your Xamarin iOS App Secret}", typeof(Distribute)); try { LoadApplication(new App(new IOSInitializer())); } catch (Exception ex) { Crashes.TrackError(ex); } WireUpLongRunningTask(); return(base.FinishedLaunching(app, options)); }
// // 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) { CarouselViewRenderer.Init(); global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Forms.Init(this, bundle); CarouselViewRenderer.Init(); UserDialogs.Init(this); Renderers.Calendar.Init(); Xamarin.FormsMaps.Init(this, bundle); InitMessageCenterSubscriptions(); RegisterPlatformDependencies(); LoadApplication(new App()); CrossCurrentActivity.Current.Init(this, bundle); App.AuthenticationClient.PlatformParameters = new PlatformParameters(Forms.Context as Activity); MakeStatusBarTranslucent(false); InitNFCService(); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); RendererInitializer.Init(); XfxControls.Init(); //global::Xamarin.Forms.Forms.SetFlags("FastRenderers_Experimental"); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); UserDialogs.Init(this); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true); ImageCircleRenderer.Init(); CarouselViewRenderer.Init(); AnimationViewRenderer.Init(); #pragma warning disable CS0618 // Type or member is obsolete Push.SetSenderId("157557116902"); #pragma warning restore CS0618 // Type or member is obsolete Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); HtmlLabelRenderer.Initialize(); CrossCurrentActivity.Current.Init(this, savedInstanceState); CrossCurrentActivity.Current.Init(this, savedInstanceState); if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop) { Window.ClearFlags(WindowManagerFlags.TranslucentStatus); Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); Window.SetStatusBarColor(Android.Graphics.Color.ParseColor("#088502")); } //This forces the custom renderers to be used //Android.Glide.Forms.Init(); LoadApplication(new App()); FirebasePushNotificationManager.ProcessIntent(this, Intent); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); Forms.Init(this, bundle); CarouselViewRenderer.Init(); Renderers.Calendar.Init(); Xamarin.FormsMaps.Init(this, bundle); Xamarin.Essentials.Platform.Init(this, bundle); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(false); Popup.Init(this, bundle); Acr.UserDialogs.UserDialogs.Init(this); InitMessageCenterSubscriptions(); RegisterPlatformDependencies(); LoadApplication(new App()); App.AuthenticationClient.PlatformParameters = new PlatformParameters(this); MakeStatusBarTranslucent(false); InitNFCService(); }
// This is the main entry point of the application. static void Main(string[] args) { // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); CarouselViewRenderer.Init(); }
// // 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) { // Required on iOS for Entity Framework Core. SQLitePCL.Batteries_V2.Init(); global::Xamarin.Forms.Forms.Init(); AnimationViewRenderer.Init(); CarouselViewRenderer.Init(); // Enforced by Apple var libPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "..", "Library", "data"); if (!Directory.Exists(libPath)) { Directory.CreateDirectory(libPath); } var dbPath = Path.Combine(libPath, "database.sqlite"); LoadApplication(new App(dbPath)); return(base.FinishedLaunching(app, options)); }
private void InitGlobalLibraries() { CrossPushNotification.Initialize <CrossPushNotificationListener>(); CrossPushNotification.Current.Register(); CarouselViewRenderer.Init(); CachedImageRenderer.Init(); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); FacebookSdk.SdkInitialize(this); CarouselViewRenderer.Init(); CrossCurrentActivity.Current.Init(this, bundle); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true); global::Xamarin.Forms.Forms.Init(this, bundle); LoadApplication(new App()); //NEDS for get correct debug keyhash PackageInfo info = this.PackageManager.GetPackageInfo("com.impressolabs.Impresso", PackageInfoFlags.Signatures); foreach (Android.Content.PM.Signature signature in info.Signatures) { MessageDigest md = MessageDigest.GetInstance("SHA"); md.Update(signature.ToByteArray()); string keyhash = Convert.ToBase64String(md.Digest()); Console.WriteLine("KeyHash:", keyhash); } }
protected override void OnCreate(Bundle bundle) { //MessagingCenter.Subscribe<object>(this, CustomNavigationView.ON_CUSTOM_NAVIGATION_VIEW_APPEARING, (param) => { // MessagingCenter.Unsubscribe<object>(this, CustomNavigationView.ON_CUSTOM_NAVIGATION_VIEW_APPEARING); // Window.SetBackgroundDrawableResource(Resource.Drawable.common_window_background_layer_list_drawable); //}); TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); RegisterActivityLifecycleCallbacks(this); CarouselViewRenderer.Init(); UserDialogs.Init(this); ImageCircleRenderer.Init(); CachedImageRenderer.Init(true); LoadApplication(new App()); Self = this; //string secureString = Secure.GetString(BaseContext.ContentResolver, Secure.AndroidId); }
protected override void OnCreate(Bundle savedInstanceState) { _iocConfig = new AndroidIoCConfig(this); TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; var pixelWidth = (double)Resources.DisplayMetrics.WidthPixels; var pixelHeight = (double)Resources.DisplayMetrics.HeightPixels; var density = (double)Resources.DisplayMetrics.Density; App.MainPageScreenWidth = (double)((pixelWidth - 0.5f) / density); App.MainPageScreenHeight = (double)((pixelHeight - 0.5f) / density); App.Locator = new ViewModelLocator(_iocConfig); base.SetTheme(Resource.Style.MainTheme); base.OnCreate(savedInstanceState); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); Forms.SetFlags("IndicatorView_Experimental"); Forms.SetFlags("CollectionView_Experimental"); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); CarouselViewRenderer.Init(); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: false); ImageCircleRenderer.Init(); UserDialogs.Init(this); FormsVideoPlayer.Init(); XF.Material.Droid.Material.Init(this, savedInstanceState); CrossCurrentActivity.Current.Init(this, savedInstanceState); LoadApplication(new App()); }
// // 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) { global::Xamarin.Forms.Forms.SetFlags(new string[] { "CollectionView_Experimental", "Brush_Experimental", "SwipeView_Experimental", "CarouseView_Experimental", "IndicatorView_Experimental" }); global::Xamarin.Forms.Forms.Init(); Rg.Plugins.Popup.Popup.Init(); Core.Init(); SfButtonRenderer.Init(); Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer.Init(); SfTextInputLayoutRenderer.Init(); SfGradientViewRenderer.Init(); CarouselViewRenderer.Init(); Syncfusion.SfChart.XForms.iOS.Renderers.SfChartRenderer.Init(); Syncfusion.XForms.iOS.BadgeView.SfBadgeViewRenderer.Init(); LoadApplication(new App()); //FirebasePushNotificationManager.Initialize(options, true); ZXing.Net.Mobile.Forms.iOS.Platform.Init(); RequestPushPermissionsAsync(); _launchoptions = options; UIApplication.SharedApplication.RegisterForRemoteNotifications(); //Firebase.CloudMessaging.Messaging.SharedInstance.Delegate = this; return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); DependencyService.Register <ToastNotification>(); ToastNotification.Init(this, new PlatformOptions() { SmallIconDrawable = Android.Resource.Drawable.IcDialogInfo }); XamForms.Controls.Droid.Calendar.Init(); CarouselViewRenderer.Init(); new SfChartRenderer(); SegmentedControlRenderer.Init(); SendAnyPreviousCrash(); //read log file and send crash report if available app = new App(); MessagingCenter.Subscribe <App, string>(app, AppConstant.ErrorEvent, (s, error) => { app.MainPage.DisplayAlert("Error", AppConstant.ErrorText, "Close"); SendErrorEmail(error); }); LoadApplication(app); }
// // 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) { global::Xamarin.Forms.Forms.Init(); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(); CarouselViewRenderer.Init(); Renderers.Calendar.Init(); Xamarin.FormsMaps.Init(); InitXamanimation(); Rg.Plugins.Popup.Popup.Init(); RegisterPlatformDependencies(); LoadApplication(new XFStarterKit.Core.App()); base.FinishedLaunching(app, options); UINavigationBar.Appearance.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); UINavigationBar.Appearance.ShadowImage = new UIImage(); UINavigationBar.Appearance.BackgroundColor = UIColor.Clear; UINavigationBar.Appearance.TintColor = UIColor.White; UINavigationBar.Appearance.BarTintColor = UIColor.Clear; UINavigationBar.Appearance.Translucent = true; return(true); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); #region Initializing Packages UserDialogs.Init(this); CarouselViewRenderer.Init(); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); CrossCurrentActivity.Current.Init(this, savedInstanceState); UserDialogs.Init(this); Rg.Plugins.Popup.Popup.Init(this, savedInstanceState); Plugin.InputKit.Platforms.Droid.Config.Init(this, savedInstanceState); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true); Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity = this; CardsViewRenderer.Preserve(); #endregion #region //To set Status Bar Color : Window.AddFlags(WindowManagerFlags.Fullscreen); Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen); Window.SetStatusBarColor(Android.Graphics.Color.ParseColor("#0984e3")); #endregion LoadApplication(new App()); }
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { Forms.Init(); CarouselViewRenderer.Init(); AnimationViewRenderer.Init(); CachedImageRenderer.Init(); // TODO dummy to prevent the dll being trashed by the linker. // Should be a better solution... var foo = new FFImageLoading.Svg.Forms.SvgCachedImage(); UIApplication.SharedApplication.SetStatusBarHidden(false, false); LoadApplication(new BeenPwnedApp()); UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); #if !DEBUG // Periodically let the app ask for a review if (UIDevice.CurrentDevice.CheckSystemVersion(10, 3)) { SKStoreReviewController.RequestReview(); } #endif return(base.FinishedLaunching(uiApplication, launchOptions)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(true); Rg.Plugins.Popup.Popup.Init(this, bundle); Xamarin.Essentials.Platform.Init(this, bundle); var config = new FFImageLoading.Config.Configuration { VerboseLogging = false, VerbosePerformanceLogging = false, VerboseMemoryCacheLogging = false, VerboseLoadingCancelledLogging = false, }; ImageService.Instance.Initialize(config); global::Xamarin.Forms.Forms.Init(this, bundle); CarouselViewRenderer.Init(); SharpnadoInitializer.Initialize(); LoadApplication(new TestApp.App()); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); //CrossCurrentActivity.Current.Activity.Init(this, bundle); Xamarin.Essentials.Platform.Init(this, bundle); // add this line to your code //... global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, bundle); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(enableFastRenderer: true); Plugin.InputKit.Platforms.Droid.Config.Init(this, bundle); Rg.Plugins.Popup.Popup.Init(this, bundle); global::Xamarin.Forms.Forms.Init(this, bundle); CarouselViewRenderer.Init(); //var ignore = typeof(SvgCachedImage); FlowListView.Init(); Acr.UserDialogs.UserDialogs.Init(this); ImageCircleRenderer.Init(); //google analytics GoogleAnalytics.Current.Config.TrackingId = "UA-XXXXXXXX-2"; GoogleAnalytics.Current.Config.AppId = "GASample"; GoogleAnalytics.Current.Config.AppName = "Google Analytics Sample"; GoogleAnalytics.Current.Config.AppVersion = "1.0.0.0"; GoogleAnalytics.Current.InitTracker(); LoadApplication(new App()); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); Acr.UserDialogs.UserDialogs.Init(this); //initializing carousel view CarouselViewRenderer.Init(); CachedImageRenderer.Init(true); //Initializing ffimage loading control //CrossBadge.Current.SetBadge(10); IsPlayServicesAvailable(); string memID = Intent.GetStringExtra("memID"); string _type = Intent.GetStringExtra("type"); Console.WriteLine("______________________" + memID + " " + _type); if (string.IsNullOrEmpty(memID)) { LoadApplication(new App(false)); } else { LoadApplication(new App(true, memID, _type)); } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { AuthenticationProviders = new List <MobileServiceAuthenticationProvider> { MobileServiceAuthenticationProvider.Facebook, //MobileServiceAuthenticationProvider.MicrosoftAccount, //MobileServiceAuthenticationProvider.Google, //MobileServiceAuthenticationProvider.Twitter }; UITabBar.Appearance.SelectedImageTintColor = UIColor.FromRGB(250, 168, 25); // Initialize Xamarin.Forms and its Plugins global::Xamarin.Forms.Forms.Init(); CachedImageRenderer.Init(); var ignore = typeof(CropTransformation); AnimationViewRenderer.Init(); CarouselViewRenderer.Init(); // Initialize Azure Mobile App Client for the current platform CurrentPlatform.Init(); // Code for starting up the Xamarin Test Cloud Agent Xamarin.Calabash.Start(); // Disable Visual Studio App Center updates when in Debug Mode Distribute.DontCheckForUpdatesInDebug(); LoadApplication(new App(this)); return(base.FinishedLaunching(app, options)); }
public void InitializeRenderers(Bundle bundle) { CachedImageRenderer.Init(false); CarouselViewRenderer.Init(); CrossCurrentActivity.Current.Init(this, bundle); Rg.Plugins.Popup.Popup.Init(this, bundle); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); //CrossCurrentActivity.Current.Init(this, bundle); CachedImageRenderer.Init(false); AnimationViewRenderer.Init(); FormsMaps.Init(this, bundle); CarouselViewRenderer.Init(); Xamarin.Essentials.Platform.Init(this, bundle); // Configure App Center Push Push.SetSenderId("597659151602"); // Initialize App Indexing and Deep Links FirebaseApp.InitializeApp(this); AndroidAppLinks.Init(this); // Configure Authentication AuthenticationService.UIParent = new UIParent(this); LoadApplication(new App()); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { Popup.Init(); ImageCircleRenderer.Init(); Devicehelper.iOSDevice = UIDevice.CurrentDevice; AnimationViewRenderer.Init(); CarouselViewRenderer.Init(); var manager = BITHockeyManager.SharedHockeyManager; manager.Configure(appID); manager.StartManager(); manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend; manager.Authenticator.AuthenticateInstallation(); var container = new SimpleContainer(); container.Register <IDevice>(t => AppleDevice.CurrentDevice); container.Register <IDisplay>(t => t.Resolve <IDevice>().Display); container.Register <INetwork>(t => t.Resolve <IDevice>().Network); Resolver.SetResolver(container.GetResolver()); FFImageLoading.Forms.Platform.CachedImageRenderer.Init(); UIRefreshControl.Appearance.TintColor = UIColor.Black; global::Xamarin.Forms.Forms.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); //AnimationViewRenderer.Init(); FormsMaps.Init(); CachedImageRenderer.Init(); CarouselViewRenderer.Init(); // Configure App Center Distribute.DontCheckForUpdatesInDebug(); //HACK to get the linker to behave var ignore = new CircleTransformation(); #if ENABLE_TEST_CLOUD // Code for starting up the Xamarin Test Cloud Agent Xamarin.Calabash.Start(); #endif var formsApp = new App(); UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false); UITabBar.Appearance.BarTintColor = ((Color)formsApp.Resources["BackgroundColor"]).ToUIColor();; UITabBar.Appearance.TintColor = ((Color)formsApp.Resources["AccentColor"]).ToUIColor(); LoadApplication(formsApp); return(base.FinishedLaunching(app, options)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); //initializing carousel view CarouselViewRenderer.Init(); //Initializing ffimage loading control FFImageLoading.Forms.Touch.CachedImageRenderer.Init(); // check for a notification if (options != null) { // check for a remote notification if (options.ContainsKey(UIApplication.LaunchOptionsRemoteNotificationKey)) { NSDictionary remoteNotification = options[UIApplication.LaunchOptionsRemoteNotificationKey] as NSDictionary; if (remoteNotification != null) { //new UIAlertView(remoteNotification.AlertAction, remoteNotification.AlertBody, null, "OK", null).Show(); } } } PrepareRemoteNotification(); LoadApplication(new App(false)); return(base.FinishedLaunching(app, options)); }
// // 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) { CachedImageRenderer.Init(); var dummy = new CachedImageRenderer(); var config = new FFImageLoading.Config.Configuration() { VerboseLogging = true, VerbosePerformanceLogging = true, VerboseMemoryCacheLogging = true, VerboseLoadingCancelledLogging = true, Logger = new ImageLogger(), }; ImageService.Instance.Initialize(config); Corcav.Behaviors.Infrastructure.Init(); RegisterDependencies(); global::Xamarin.Forms.Forms.Init(); CarouselViewRenderer.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0)) { // Ask the user for permission to get notifications on iOS 10.0+ UNUserNotificationCenter.Current.RequestAuthorization( UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, (approved, error) => { }); } else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { // Ask the user for permission to get notifications on iOS 8.0+ var settings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet()); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings); } global::Xamarin.Forms.Forms.Init(); CarouselViewRenderer.Init(); TintedImageRenderer.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
// // 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 libPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "..", "Library", "data"); if (!Directory.Exists(libPath)) { Directory.CreateDirectory(libPath); } var dbPath = Path.Combine(libPath, Common.Constants.Paths.DbName); if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0)) { // Ask the user for permission to get notifications on iOS 10.0+ UNUserNotificationCenter.Current.RequestAuthorization( UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound, (approved, error) => { }); } else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { // Ask the user for permission to get notifications on iOS 8.0+ var settings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet()); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings); } CarouselViewRenderer.Init(); global::Xamarin.Forms.Forms.Init(); LoadApplication(new App(new iOSInitializer(dbPath))); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(bundle); global::Xamarin.Forms.Forms.Init(this, bundle); CarouselViewRenderer.Init(); FlowListView.Init(); CachedImageRenderer.Init(); UserDialogs.Init(this); //AndroidAppLinks.Init(this); MobileAds.Initialize(ApplicationContext, "ca-app-pub-XXXXXXXXXXX"); FileAccessHelper.GetLocalFilePath("Data.sqlite"); LoadApplication(new App()); //var x = typeof(Xamarin.Forms.Themes.DarkThemeResources); //x = typeof(Xamarin.Forms.Themes.LightThemeResources); //x = typeof(Xamarin.Forms.Themes.Android.UnderlineEffect); }