Ejemplo n.º 1
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            if (NotificationsSupported)
            {
                UNUserNotificationCenter.Current.RequestAuthorization(
                    UNAuthorizationOptions.Alert |
                    UNAuthorizationOptions.Badge |
                    UNAuthorizationOptions.Sound,
                    (approvalGranted, error) =>
                {
                    if (approvalGranted && error == null)
                    {
                        RegisterForRemoteNotifications();
                    }
                });
            }

            Bootstrap.Begin(() => new DeviceInstallationService(
                                () => _deviceToken,
                                () => NotificationsSupported,
                                () => GetNotificationsSupportError()));

            LoadApplication(new App());

            using (var userInfo = options?.ObjectForKey(
                       UIApplication.LaunchOptionsRemoteNotificationKey) as NSDictionary)
                ProcessNotificationActions(userInfo);

            return(base.FinishedLaunching(app, options));
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Bootstrap.Begin(() => new DeviceInstallationService());

            if (DeviceInstallationService.NotificationsSupported)
            {
                FirebaseInstanceId.GetInstance(Firebase.FirebaseApp.Instance)
                .GetInstanceId()
                .AddOnSuccessListener(this);
            }

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            Xamarin.Forms.Forms.Init(this, savedInstanceState);

            LoadApplication(new App());

            CreateNotificationChannel();

            if (!ShortcutBadger.IsBadgeCounterSupported(this))
            {
                Console.WriteLine("Pay attention: badge counter not supported");
            }
        }
Ejemplo n.º 3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            Bootstrap.Begin(() => new DeviceInstallationService());

            if (DeviceInstallationService.NotificationsSupported)
            {
                FirebaseInstanceId.GetInstance(Firebase.FirebaseApp.Instance)
                .GetInstanceId()
                .AddOnSuccessListener(this);
            }

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            CurrentPlatform.Init();

            string dbName     = "smartsub_db.sqlite";
            string folderPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath   = Path.Combine(folderPath, dbName);

            LoadApplication(new App(fullPath));
        }
Ejemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            if (PlayServicesAvailable)
            {
                FirebaseInstanceId.GetInstance(Firebase.FirebaseApp.Instance)
                .GetInstanceId()
                .AddOnSuccessListener(this);
            }

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            Bootstrap.Begin(() => new DeviceInstallationService(
                                () => PushNotificationFirebaseMessagingService.Token,
                                () => PlayServicesAvailable,
                                () => GetPlayServicesError()));

            LoadApplication(new App());

            ProcessNotificationActions(Intent);
        }
Ejemplo n.º 5
0
        //
        // 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)
        {
            Xamarin.Calabash.Start();
            global::Xamarin.Forms.Forms.SetFlags();
            global::Xamarin.Forms.Forms.Init();
            Bootstrap.Begin();
            global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 6
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            global::Xamarin.Forms.Forms.Init();

            Bootstrap.Begin(() => new LocationService(), () => new AlertService(), () =>
            {
                FileSystem.RegisterService(new FileSystemService());
            });

            LoadApplication(new App());

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
Ejemplo n.º 7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            global::Xamarin.Forms.Forms.SetFlags("CollectionView_Experimental");
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Bootstrap.Begin();
            global::Xamarin.Auth.Presenters.XamarinAndroid.AuthenticationConfiguration.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
Ejemplo n.º 8
0
        //
        // 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)
        {
            Xamarin.Calabash.Start();
            global::Xamarin.Forms.Forms.Init();
            CarouselViewRenderer.Init();

            Bootstrap.Begin(() =>
            {
                // Pending registratio nof placeform-specific dependencies
            });

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 9
0
        public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
        {
            if (isInitialized)
            {
                return;
            }
            isInitialized = true;
            var p = SQLite.SQLiteException.New(SQLite.SQLite3.Result.Row, "");

            Bootstrap.Begin(
                () => new LocationService(activity),
                () => new AlertService(activity),
                () => FileSystem.RegisterService(new FileSystemService())
                );
        }
Ejemplo n.º 10
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            Bootstrap.Begin(() => new LocationService(this), () => new AlertService(this), () =>
            {
                FileSystem.RegisterService(new FileSystemService());
            });

            global::Xamarin.Forms.Forms.Init(this, bundle);

            LoadApplication(new App());
        }
Ejemplo n.º 11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            AppCenter.Start("d1cb541a-e3d7-4bc3-af7f-65022c3254dc", typeof(Analytics), typeof(Crashes));

            base.OnCreate(savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            CarouselViewRenderer.Init();
            Bootstrap.Begin(() =>
            {
                // Pending registratio nof placeform-specific dependencies
            });
            LoadApplication(new App());
        }
Ejemplo n.º 12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            Bootstrap.Begin(() =>
            {
                ServiceContainer.Register <ILocalizationService>(new LocalizationService());
            });

            LoadApplication(new App());
        }
Ejemplo n.º 13
0
        //
        // 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();

#if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
#endif

            Bootstrap.Begin(() =>
            {
                ServiceContainer.Register <ILocalizationService>(new LocalizationService());
            });

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 14
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var p = SQLite.SQLiteException.New(SQLite.SQLite3.Result.Row, "");

            Bootstrap.Begin(
                () => new LocationService(),
                () => new AlertService(),
                () => FileSystem.RegisterService(new FileSystemService())
                );

            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            var listViewController = new WeatherListViewController();

            Window.RootViewController = new UINavigationController(listViewController);
            Window.MakeKeyAndVisible();

            return(true);
        }
Ejemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;
            base.Window.RequestFeature(WindowFeatures.ActionBar);
            base.SetTheme(Resource.Style.MainTheme);

            base.OnCreate(savedInstanceState);

            Bootstrap.Begin(() => new DeviceInstallationService());
            if (DeviceInstallationService.NotificationsSupported)
            {
                FirebaseInstanceId.GetInstance(Firebase.FirebaseApp.Instance)
                .GetInstanceId()
                .AddOnSuccessListener(this);
            }

            if (Intent.Extras != null)
            {
                foreach (var key in Intent.Extras.KeySet())
                {
                    if (key != null)
                    {
                        var value = Intent.Extras.GetString(key);
                        Log.Debug(TAG, "Key: {0} Value: {1}", key, value);
                    }
                }
            }

            IsPlayServicesAvailable();
            CreateNotificationChannel();

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.FormsMaps.Init(this, savedInstanceState);

            LoadApplication(new App());

            ProcessNotificationActions(Intent);
        }
Ejemplo n.º 16
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            if (NotificationsSupported)
            {
                RequestRemoteNotifications();
            }

            Bootstrap.Begin(() => new DeviceInstallationService(
                                () => _deviceToken,
                                () => NotificationsSupported,
                                () => GetNotificationsSupportError()));

            LoadApplication(new App());

            using (var userInfo = options?.ObjectForKey(
                       UIApplication.LaunchOptionsRemoteNotificationKey) as NSDictionary)
                ProcessNotificationActions(userInfo);

            return(base.FinishedLaunching(app, options));
        }
Ejemplo n.º 17
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            var p = SQLite.SQLiteException.New(SQLite.SQLite3.Result.Row, "");

            global::Xamarin.Forms.Forms.Init();

            Bootstrap.Begin(
                () => new LocationService(),
                () => new AlertService(),
                () => FileSystem.RegisterService(new FileSystemService()),
                false
                );

            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            var listPage = new WeatherListPage();

            listPage.WeatherSelected += OnWeatherSelected;

            var listViewController = listPage.CreateViewController();

            listViewController.NavigationItem.SetRightBarButtonItem(
                new UIBarButtonItem(
                    "Add",
                    UIBarButtonItemStyle.Plain,
                    (sender, args) =>
            {
                listPage.ViewModel.AddFavoriteCommand.Execute(null);
            }),
                true);

            _navigation = new UINavigationController(listViewController);

            Window.RootViewController = _navigation;
            Window.MakeKeyAndVisible();

            return(true);
        }