Пример #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            this.SetStatusBarColor(Xamarin.Forms.Color.FromHex("1b242c").ToAndroid());


            var options = new FirebaseOptions.Builder()
                          .SetApplicationId("fir-database-aff8d")
                          .SetApiKey("AIzaSyAAz_2uNo58Qzq8T7J1t6_-3dNMXfBOFrI")
                          .SetStorageBucket("fir-database-aff8d.appspot.com")
                          .Build();

            if (FirebaseApp.GetApps(Application.Context).Count == 0)
            {
                FirebaseApp.InitializeApp(Application.Context, options);
            }


            //FirebaseApp.InitializeApp(Application.Context, options);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
            LoadApplication(new App());
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

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

            FirebaseOptions options = new FirebaseOptions.Builder()
                                      .SetApplicationId("1:1063764371053:android:20f3fc5a11498166")
                                      .SetApiKey("AIzaSyB3QHD5XSUZenzjaJLBeULbgOItts1IUK0")
                                      .SetGcmSenderId("1063764371053")
                                      .Build();

            bool hasBeenInitialized          = false;
            IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(Application.Context);

            foreach (FirebaseApp app in firebaseApps)
            {
                if (app.Name.Equals(FirebaseApp.DefaultAppName))
                {
                    hasBeenInitialized = true;
                    FirebaseApp firebaseApp = app;
                }
            }

            if (!hasBeenInitialized)
            {
                FirebaseApp firebaseApp = FirebaseApp.InitializeApp(Application.Context, options);
            }

            LoadApplication(new App());
        }
Пример #3
0
        private void InitFriebase()
        {
            var options = new Firebase.FirebaseOptions.Builder()
                          .SetApiKey("AIzaSyAvDZA3xwVepEniUr0Jr3-vcGuIWs4MV64")
                          .SetApplicationId("project-706ea")
                          .Build();

            bool hasBeenInitialised          = false;
            IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(this);

            FirebaseApp.GetApps(this);
            foreach (FirebaseApp tempapp in firebaseApps)
            {
                if (tempapp.Name.Equals(FirebaseApp.DefaultAppName))
                {
                    hasBeenInitialised = true;
                    app = tempapp;
                }
            }

            if (!hasBeenInitialised)
            {
                app = FirebaseApp.InitializeApp(this, options);
            }
            auth = FirebaseAuth.GetInstance(app);
        }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            var platformConfig = new PlatformConfig
            {
                BitmapDescriptorFactory = new AccessNativeBitmapConfig()
            };

            global::Xamarin.Forms.Forms.SetFlags("CarouselView_Experimental");

            Xamarin.FormsGoogleMaps.Init(this, savedInstanceState, platformConfig);
            await CrossMedia.Current.Initialize();

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

            CachedImageRenderer.Init(true);
            var ignore = typeof(SvgCachedImage);

            Delegate.SetLocalNightMode(AppCompatDelegate.ModeNightNo);
            FirebaseOptions options = new FirebaseOptions.Builder()
                                      .SetApplicationId("1:497356794783:android:f50ef84b369d3a3e696baa")
                                      .SetApiKey("AIzaSyBCZCjGqk3f0SdH7prNkEEQT-SI29-vxG0")
                                      .SetGcmSenderId("497356794783")
                                      .Build();

            bool hasBeenInitialized          = false;
            IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(Application.Context);

            foreach (FirebaseApp app in firebaseApps)
            {
                if (app.Name.Equals(FirebaseApp.DefaultAppName))
                {
                    hasBeenInitialized = true;
                    FirebaseApp firebaseApp = app;
                }
            }

            if (!hasBeenInitialized)
            {
                FirebaseApp firebaseApp = FirebaseApp.InitializeApp(Application.Context, options);
            }

            //SetContentView(Resource.Layout.MasterPage);
            IsPlayServicesAvailable(); //You can use this method to check if play services are available.
            CreateNotificationChannel();

            LoadApplication(new App());
            FirebasePushNotificationManager.ProcessIntent(this, Intent);
        }
Пример #5
0
        public static void GetDatabase(Android.Content.Context context)
        {
            var options = new FirebaseOptions.Builder()
                          .SetProjectId("spacecafe-284f8")
                          .SetApplicationId("spacecafe-284f8")
                          .SetApiKey("AIzaSyCSS7zqkDXlLpvD5ezA85PsGTFMdnKT_BU")
                          .SetDatabaseUrl("https://spacecafe-284f8.firebaseio.com")
                          .SetStorageBucket("spacecafe-284f8.appspot.com")
                          .Build();

            if (FirebaseApp.GetApps(context).Count < 1)
            {
                App = FirebaseApp.InitializeApp(context, options);
            }

            Auth = FirebaseAuth.Instance;
        }
Пример #6
0
        void Init()
        {
            if (FirebaseApp.GetApps(this).Count > 0)
            {
                return;
            }
            var options = new FirebaseOptions.Builder()
                          .SetApplicationId("junction-x")
                          .SetApiKey(FirebaseMessaging.FirebaseServerId)
                          .SetGcmSenderId(FirebaseMessaging.FirebaseSenderId)
                          //.SetStorageBucket("irt-payment.appspot.com")
                          .Build();

            FirebaseApp.InitializeApp(this, options);

            FirebaseMessaging.RefreshToken();
        }
Пример #7
0
        private void InitEmailPasswordFirebaseAuth()
        {
            //GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DefaultSignIn)
            //     .RequestIdToken("171840076765-iac9hhn5c00j89r0iajs85no078v16if.apps.googleusercontent.com")
            //     .RequestEmail()
            //     .Build();

            try
            {
                var options = new FirebaseOptions.Builder()
                              .SetApplicationId("1:998282876744:android: faa6ee6196128554")
                              .SetApiKey("AIzaSyD09cd2YsnqlhZUBvenBgCAwxJqluN0dc8")
                              .Build();

                if (firebaseApp == null)
                {
                    IList <FirebaseApp> firebaseApps = FirebaseApp.GetApps(this);
                    if (firebaseApps != null && !(firebaseApps.Count == 0))
                    {
                        foreach (FirebaseApp app1 in firebaseApps)
                        {
                            if (app1.Name.Equals(FirebaseApp.DefaultAppName))
                            {
                                firebaseApp = app1;
                            }
                        }
                    }
                    else
                    {
                        firebaseApp = FirebaseApp.InitializeApp(this, options);
                    }
                    //app = FirebaseApp.InitializeApp(this, options);
                }
                auth = FirebaseAuth.GetInstance(firebaseApp);
            }
            catch (Exception ex)
            {
            }
        }
Пример #8
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //values are to be referred from downloaded google-services.json file
            var options = new FirebaseOptions.Builder()
                          .SetApplicationId("<client.client_info.mobilesdk_app_id>")
                          .SetApiKey("<api_key.current_key>")
                          .SetDatabaseUrl("<project_info.firebase_url>")
                          .SetGcmSenderId("<oauth_client.client_id>")
                          .SetStorageBucket("<project_info.storage_bucket>")
                          .Build();
            var apps = FirebaseApp.GetApps(this);

            if (apps.Count == 0)//to avoid exception
            {
                FirebaseApp.InitializeApp(this, options);
            }

            Xamarin.Forms.Forms.Init(this, bundle);
            AndroidAppLinks.Init(this);

            LoadApplication(new App());
        }