using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CarouselView.FormsPlugin.iOS;
using FFImageLoading;
using FFImageLoading.Forms.Platform;
using Foundation;
using Serena.Data;
using Syncfusion.ListView.XForms.iOS;
using Syncfusion.SfBusyIndicator.XForms.iOS;
using UIKit;
namespace Serena.iOS
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// 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)
{
//syncfusion key
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MjgxNzQyQDMxMzgyZTMyMmUzMG9tSFhmYjVqak9DNzlyQnZpNjBVVHJkT1FXdURDdlhsMTIyQVQ4Rk1CQU09");
global::Xamarin.Forms.Forms.Init();
global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
Xamarin.FormsMaps.Init();
//NuGet Initializations for carousel view
//CarouselViewRenderer.Init();
//CachedImageRenderer.Init();
//var config = new FFImageLoading.Config.Configuration()
//{
// MaxMemoryCacheSize = (int)(NSProcessInfo.ProcessInfo.PhysicalMemory * 0.0001d),
// ClearMemoryCacheOnOutOfMemory = true,
// DiskCacheDuration = TimeSpan.FromSeconds(2)
//};
//ImageService.Instance.Initialize(config);
#region syncfusion tools
new Syncfusion.SfAutoComplete.XForms.iOS.SfAutoCompleteRenderer();
new SfBusyIndicatorRenderer();
SfListViewRenderer.Init();
new Syncfusion.SfNavigationDrawer.XForms.iOS.SfNavigationDrawerRenderer();
Syncfusion.XForms.iOS.PopupLayout.SfPopupLayoutRenderer.Init();
Syncfusion.XForms.iOS.TabView.SfTabViewRenderer.Init();
Syncfusion.XForms.iOS.Buttons.SfButtonRenderer.Init();
new Syncfusion.XForms.iOS.ComboBox.SfComboBoxRenderer();
Syncfusion.XForms.iOS.Border.SfBorderRenderer.Init();
#endregion
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options)
{
// Convert NSUrl to Uri
var uri = new Uri(url.AbsoluteString);
// Load redirectUrl page
AuthenticationState.Authenticator.OnPageLoading(uri);
return true;
}
}
}