void Init()
        {
            _filter = new IntentFilter();
            _filter.AddAction("android.bluetooth.adapter.action.STATE_CHANGED");
            _filter.AddAction("android.location.PROVIDERS_CHANGED");

            AppDomain.CurrentDomain.UnhandledException  += LogUtils.OnUnhandledException;
            AndroidEnvironment.UnhandledExceptionRaiser += OnUnhandledAndroidException;

#if APPCENTER
            AppCenter.Start(
                Configuration.Conf.APPCENTER_DIAGNOSTICS_TOKEN,
                typeof(Analytics), typeof(Crashes));
#endif

            DroidDependencyInjectionConfig.Init();
            Xamarin.Essentials.Platform.Init(this);
            Current.Init(this);
            LocalesService.Initialize();

            new MigrationService().Migrate();

            _permissionsBroadcastReceiver            = new PermissionsBroadcastReceiver();
            _flightModeBroadcastReceiver             = new FlightModeHandlerBroadcastReceiver();
            _backgroundNotificationBroadcastReceiver = new BackgroundNotificationBroadcastReceiver();

            LogUtils.SendAllLogs();

            if (PlayServicesVersionUtils.PlayServicesVersionNumberIsLargeEnough(PackageManager))
            {
                BackgroundFetchScheduler.ScheduleBackgroundFetch();
            }
        }
        public bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
#if APPCENTER
            AppCenter.Start(
                Configuration.Conf.APPCENTER_DIAGNOSTICS_TOKEN,
                typeof(Analytics), typeof(Crashes));
#endif

            IOSDependencyInjectionConfig.Init();
            LocalesService.Initialize();
            UIApplication.SharedApplication.SetMinimumBackgroundFetchInterval(UIApplication.BackgroundFetchIntervalMinimum);

            new MigrationService().Migrate();

            LogUtils.SendAllLogs();
            AppDomain.CurrentDomain.UnhandledException += LogUtils.OnUnhandledException;

            SecureStorageImplementation.DefaultAccessible = Security.SecAccessible.AfterFirstUnlockThisDeviceOnly;

            HandleLocalNotifications();

            BackgroundServiceHandler.PlatformScheduleFetch();

            UIUserNotificationSettings notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
                UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null
                );
            application.RegisterUserNotificationSettings(notificationSettings);
            application.BeginBackgroundTask("showNotification", () => { });

            LayoutUtils.OnLayoutDirectionChange();

            return(true);
        }
Beispiel #3
0
 private void SetAppLanguageAndContinue(string appLanguage)
 {
     LocalPreferencesHelper.SetAppLanguage(appLanguage);
     LocalesService.Initialize();
     LayoutUtils.OnLayoutDirectionChange();
     NavigationHelper.GoToOnboardingPage(this);
 }
Beispiel #4
0
        private void LanguageButton_Click(object sender, EventArgs e)
        {
            Button senderButton = sender as Button;

            switch (senderButton.Id)
            {
            case Resource.Id.bokmal_button:
                LocalPreferencesHelper.SetAppLanguage("nb");
                break;

            case Resource.Id.nynorsk_button:
                LocalPreferencesHelper.SetAppLanguage("nn");
                break;

            case Resource.Id.english_button:
                LocalPreferencesHelper.SetAppLanguage("en");
                break;

            case Resource.Id.arabic_button:
                LocalPreferencesHelper.SetAppLanguage("ar");
                break;

            case Resource.Id.lithuanian_button:
                LocalPreferencesHelper.SetAppLanguage("lt");
                break;

            case Resource.Id.polish_button:
                LocalPreferencesHelper.SetAppLanguage("pl");
                break;

            case Resource.Id.somali_button:
                LocalPreferencesHelper.SetAppLanguage("so");
                break;

            case Resource.Id.tigrinya_button:
                LocalPreferencesHelper.SetAppLanguage("ti");
                break;

            case Resource.Id.urdu_button:
                LocalPreferencesHelper.SetAppLanguage("ur");
                break;
            }
            LocalesService.Initialize();
            NavigationHelper.GoToOnBoarding(this, true);
        }
 private void LauncherButtonNn_Click(object sender, EventArgs e)
 {
     LocalPreferencesHelper.SetAppLanguage("nn");
     LocalesService.Initialize();
     Continue();
 }
 private void LauncherButtonNb_Click(object sender, EventArgs e)
 {
     LocalPreferencesHelper.SetAppLanguage(Conf.DEFAULT_LANGUAGE);
     LocalesService.Initialize();
     Continue();
 }
 private void CountinueInEnButton_Click(object sender, EventArgs e)
 {
     LocalPreferencesHelper.SetAppLanguage("en");
     LocalesService.Initialize();
     Continue();
 }
 partial void StartButtonNN_TouchUpInside(UIButton sender)
 {
     LocalPreferencesHelper.SetAppLanguage("nn");
     LocalesService.Initialize();
     Continue();
 }
 void OnContinueInEnViewBtnTapped(UITapGestureRecognizer recognizer)
 {
     LocalPreferencesHelper.SetAppLanguage("en");
     LocalesService.Initialize();
     Continue();
 }
Beispiel #10
0
 partial void StartButton_TouchUpInside(UIButton sender)
 {
     LocalPreferencesHelper.SetAppLanguage(Conf.DEFAULT_LANGUAGE);
     LocalesService.Initialize();
     Continue();
 }