예제 #1
0
        public static void Initialize(
            Activity activity,
            Bundle savedInstanceState,
            CrossFirebaseSettings settings,
            FirebaseOptions firebaseOptions = null,
            string name = null)
        {
            if (firebaseOptions == null)
            {
                FirebaseApp.InitializeApp(activity);
            }
            else if (name == null)
            {
                FirebaseApp.InitializeApp(activity, firebaseOptions);
            }
            else
            {
                FirebaseApp.InitializeApp(activity, firebaseOptions, name);
            }

            if (settings.IsAnalyticsEnabled)
            {
                FirebaseAnalyticsImplementation.Initialize(activity);
            }

            if (settings.IsAuthEnabled)
            {
                FirebaseAuthImplementation.Initialize(activity, savedInstanceState, settings.GoogleRequestIdToken ?? "123-abc");
            }

            Console.WriteLine($"Plugin.Firebase initialized with the following settings:\n{settings}");
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            Platform.Init(this, savedInstanceState);
            FirebaseApp.InitializeApp(this);
            FirebaseAnalyticsImplementation.Initialize(this);
            FirebaseAuthImplementation.Initialize(this, savedInstanceState, "316652897245-lbddc4dc4v87nv3n19thi032n3dvrcvu.apps.googleusercontent.com");

            // tests can be inside the main assembly
            AddTestAssembly(Assembly.GetExecutingAssembly());

            AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);
            // or in any reference assemblies

            //AddTestAssembly(typeof(PortableTests).Assembly);
            // or in any assembly that you load (since JIT is available)
            AddTestAssembly(typeof(MustPassFixture).Assembly);

#if false
            // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
            Writer = new TcpTextWriter("10.0.1.2", 16384);
            // start running the test suites as soon as the application is loaded
            AutoStart = true;
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif
            // you cannot add more assemblies once calling base
            base.OnCreate(savedInstanceState);
        }
예제 #3
0
        public static void Initialize(
            UIApplication app,
            NSDictionary options,
            CrossFirebaseSettings settings,
            Options firebaseOptions = null,
            string name             = null)
        {
            if (firebaseOptions == null)
            {
                App.Configure();
            }
            else if (name == null)
            {
                App.Configure(firebaseOptions);
            }
            else
            {
                App.Configure(name, firebaseOptions);
            }

            if (settings.IsAnalyticsEnabled)
            {
                FirebaseAnalyticsImplementation.Initialize();
            }

            if (settings.IsAuthEnabled)
            {
                FirebaseAuthImplementation.Initialize(app, options, settings.FacebookId, settings.FacebookAppName);
            }

            if (settings.IsCloudMessagingEnabled)
            {
                FirebaseCloudMessagingImplementation.Initialize();
            }

            Console.WriteLine($"Plugin.Firebase initialized with the following settings:\n{settings}");
        }
예제 #4
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)
        {
            FirebaseApp.Configure();
            FirebaseAnalyticsImplementation.Initialize();

            // We need this to ensure the execution assembly is part of the app bundle
            AddExecutionAssembly(typeof(ExtensibilityPointFactory).Assembly);

            // tests can be inside the main assembly
            AddTestAssembly(Assembly.GetExecutingAssembly());
            // otherwise you need to ensure that the test assemblies will
            // become part of the app bundle
            AddTestAssembly(typeof(MustPassFixture).Assembly);

#if false
            // you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
            Writer = new TcpTextWriter("10.0.1.2", 16384);
            // start running the test suites as soon as the application is loaded
            AutoStart = true;
            // crash the application (to ensure it's ended) and return to springboard
            TerminateAfterExecution = true;
#endif
            return(base.FinishedLaunching(app, options));
        }