// When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    private void Start()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
            {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }



        //Set up brainCloud
        _bc = gameObject.AddComponent <BrainCloudWrapper>();
        _bc.Init();

        _bc.AlwaysAllowProfileSwitch = true;
    }
Beispiel #2
0
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    void Start()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    // This should never happen if we're only using Firebase Analytics.
                    // It does not rely on any external dependencies.
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }

        EventManager.StartListening <BasicEvent> (Constants.ON_SEND_DATA_TO_DATABASE, OnSendDataToDatabase);
    }
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    void Start()
    {
        // ObjectSpawner spawner = GetComponent<ObjectSpawner>();

        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }
        loadDatabaseUniqueGameObjectsOnce();
    }
    void Start()
    {
        ArialFont = (Font)Resources.GetBuiltinResource(typeof(Font), "Arial.ttf");

        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
            {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }
    }
Beispiel #5
0
 void Start()
 {
     ScreenController.Instance.StartLoadingScreen(delegate() {
         dependencyStatus = FirebaseApp.CheckDependencies();
         if (dependencyStatus != DependencyStatus.Available)
         {
             FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                 dependencyStatus = FirebaseApp.CheckDependencies();
                 if (dependencyStatus == DependencyStatus.Available)
                 {
                     InitializeFirebase();
                 }
                 else
                 {
                     ScreenController.Instance.StopLoadingScreen();
                     Debug.LogError(
                         "Could not resolve all Firebase dependencies: " + dependencyStatus);
                 }
             });
         }
         else
         {
             InitializeFirebase();
         }
     });
 }
Beispiel #6
0
 // When the app starts, check to make sure that we have
 // the required dependencies to use Firebase, and if not,
 // add them if possible.
 void Start()
 {
     dependencyStatus = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 InitializeFirebase();
             }
             else
             {
                 // This should never happen if we're only using Firebase Analytics.
                 // It does not rely on any external dependencies.
                 Debug.LogError(
                     "Could not resolve all Firebase dependencies: " + dependencyStatus);
             }
         });
     }
     else
     {
         InitializeFirebase();
     }
 }
Beispiel #7
0
    private void InitializeFirebase()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();

        if (dependencyStatus != DependencyStatus.Available)
        {
            Log("Firebase dependencies not ready.. asynchronously fixing..");

            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();

                if (dependencyStatus != DependencyStatus.Available)
                {
                    Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
                else
                {
                    OnInitializationComplete();
                }
            });
        }
        else
        {
            OnInitializationComplete();
        }
    }
Beispiel #8
0
 // Use this for initialization
 void Start()
 {
     if (PlayerPrefs.GetInt(Constants.IsLogin) == 0)
     {
         PlayerPrefs.SetInt(Constants.IsLogin, 1);
         PlayerPrefs.SetString(Constants.IsLoginEmailorPhone, Constants.ParentEmail);
         PlayerPrefs.SetString(Constants.IsLoginpassword, Constants.ParentPassword);
     }
     else
     {
         Constants.ParentEmail    = PlayerPrefs.GetString(Constants.IsLoginEmailorPhone);
         Constants.ParentPassword = PlayerPrefs.GetString(Constants.IsLoginpassword);
     }
     dependencyStatus = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 InitializeFirebase();
             }
             else
             {
                 Debug.LogError(
                     "Could not resolve all Firebase dependencies: " + dependencyStatus);
             }
         });
     }
     else
     {
         InitializeFirebase();
     }
 }
Beispiel #9
0
    void InitFireBase()
    {
        _dependencyStatus = FirebaseApp.CheckDependencies();
        if (_dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
            {
                _dependencyStatus = FirebaseApp.CheckDependencies();
                if (_dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError("Could not resolve all Firebase dependencies: " + _dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }

        FirebaseAnalytics.LogEvent(FirebaseAnalytics.EventLogin);
    }
Beispiel #10
0
 public void initFirebase(System.Action callbackWhenDone)
 {
     if (!initiated)
     {
         dependencyStatus = FirebaseApp.CheckDependencies();
         if (dependencyStatus != DependencyStatus.Available)
         {
             FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
             {
                 dependencyStatus = FirebaseApp.CheckDependencies();
                 if (dependencyStatus == DependencyStatus.Available)
                 {
                     initiated = true;
                     _initFirebase(callbackWhenDone);
                 }
                 else
                 {
                     // This should never happen if we're only using Firebase Analytics.
                     // It does not rely on any external dependencies.
                     Debug.LogError(
                         "Could --  not resolve all Firebase dependencies: " + dependencyStatus);
                 }
             });
         }
         else
         {
             _initFirebase(callbackWhenDone);
         }
     }
     else
     {
         callbackWhenDone();
     }
 }
Beispiel #11
0
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    void Start()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus != DependencyStatus.Available)
                {
                    // This should never happen if we're only using Firebase Analytics.
                    // It does not rely on any external dependencies.
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }

        var appBucket = FirebaseApp.DefaultInstance.Options.StorageBucket;

        if (!String.IsNullOrEmpty(appBucket))
        {
            MyStorageBucket = String.Format("gs://{0}/", appBucket);
        }

        // Set Remote storage pathfile
        firebaseStorageLocation = MyStorageBucket + '/' + Constants.JSON_FILE;
        // Wait to get data from Remote storage (FireBase)
        Invoke("DownloadRemoteData", .3f);
    }
Beispiel #12
0
 void Start()
 {
     PlayerPrefs.SetString("SchoolLogin", "false");
     TouchScreenKeyboard.hideInput = true;
     IsGalleryFrom = false;
     if (PlayerPrefs.GetInt(Constants.IsLogin) == 0)
     {
         PlayerPrefs.SetInt(Constants.IsLogin, 1);
         PlayerPrefs.SetString(Constants.IsLoginEmailorPhone, Constants.ParentEmail);
         PlayerPrefs.SetString(Constants.IsLoginpassword, Constants.ParentPassword);
     }
     else
     {
         Constants.ParentEmail    = PlayerPrefs.GetString(Constants.IsLoginEmailorPhone);
         Constants.ParentPassword = PlayerPrefs.GetString(Constants.IsLoginpassword);
     }
     parentEmailInput.text    = Constants.ParentEmail;
     parentPasswordInput.text = Constants.ParentPassword;
     SAGAndroidPlugin.getInstance().imageDelegate += imageHandle;
     parentEmailInput.enabled    = false;
     parentPasswordInput.enabled = false;
     parentPhoneInput.enabled    = false;
     dependencyStatus            = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 InitializeFirebase();
             }
             else
             {
                 Debug.LogError(
                     "Could not resolve all Firebase dependencies: " + dependencyStatus);
             }
         });
     }
     else
     {
         InitializeFirebase();
     }
 }
Beispiel #13
0
	private void StartFirebase()
	{
		//Task<DependencyStatus> dependencyStatusTask = FirebaseApp.CheckDependenciesAsync();

		//dependencyStatus = dependencyStatusTask.Result;

		//FirebaseApp.CheckDependenciesAsync().ContinueWith(task =>
		//{
		dependencyStatus = FirebaseApp.CheckDependencies();

		if (dependencyStatus == DependencyStatus.Available)
		{
			StartCoroutine(InitializeDatabase());
			//Debug.Log("ilkinde oldu");
			//	ActionManager.Instance.LoadingPanelSelfDestruction(3f);
		}
		else if (dependencyStatus != DependencyStatus.Available)
		{
			FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
			{
				//dependencyStatusTask = FirebaseApp.CheckDependenciesAsync();

				//dependencyStatus = dependencyStatusTask.Result;
				Debug.Log("ilkinde olmadı, buraya geldi");
				dependencyStatus = FirebaseApp.CheckDependencies();

				if (dependencyStatus == DependencyStatus.Available)
				{
					Debug.Log("Gelmiyor");
					StartCoroutine(InitializeDatabase());
					// ActionManager.Instance.LoadingPanelSelfDestruction(3f);
				}
				else
				{
					Debug.LogError("Database`e ulaşılamadı");
				}
			});
		}
		//});
	}
Beispiel #14
0
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    void Start()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus != DependencyStatus.Available)
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }

        var appBucket = FirebaseApp.DefaultInstance.Options.StorageBucket;

        if (!String.IsNullOrEmpty(appBucket))
        {
            MyStorageBucket = String.Format("gs://{0}/", appBucket);
        }
    }
 public void Init(Action completion)
 {
     dependencyStatus = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task =>
         {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 if (NumberOpens > 2)
                 {
                     Firebase.Messaging.FirebaseMessaging.TokenReceived   += OnTokenReceived;
                     Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
                 }
                 else
                 {
                     NumberOpens++;
                 }
                 if (completion != null)
                 {
                     completion.Invoke();
                 }
             }
             else
             {
                 Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
             }
         });
     }
     else
     {
         if (completion != null)
         {
             completion.Invoke();
         }
     }
 }
Beispiel #16
0
 // When the app starts, check to make sure that we have
 // the required dependencies to use Firebase, and if not,
 // add them if possible.
 void Start()
 {
     dependencyStatus = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 InitializeFirebase();
             }
             else
             {
                 Debug.LogError(
                     "Could not resolve all Firebase dependencies: " + dependencyStatus);
             }
         });
     }
     else
     {
         InitializeFirebase();
     }
 }
 public void init(Action <string> onFailInitializeFirebase, Action initializeFirebase)
 {
     dependencyStatus = FirebaseApp.CheckDependencies();
     if (dependencyStatus != DependencyStatus.Available)
     {
         FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
             dependencyStatus = FirebaseApp.CheckDependencies();
             if (dependencyStatus == DependencyStatus.Available)
             {
                 initializeFirebase();
             }
             else
             {
                 onFailInitializeFirebase("Could not resolve all Firebase dependencies: " +
                                          dependencyStatus);
             }
         });
     }
     else
     {
         initializeFirebase();
     }
 }
Beispiel #18
0
    // When the app starts, check to make sure that we have
    // the required dependencies to use Firebase, and if not,
    // add them if possible.
    void Start()
    {
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus != DependencyStatus.Available)
                {
                    // This should never happen if we're only using Firebase Analytics.
                    // It does not rely on any external dependencies.
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }

        var appBucket = FirebaseApp.DefaultInstance.Options.StorageBucket;

        if (!String.IsNullOrEmpty(appBucket))
        {
            MyStorageBucket = String.Format("gs://{0}/", appBucket);
        }
    }
                                       "u", "v", "w", "x", "y", "z" };//variables del codigo a asignar por aplicacion

    void Start()
    {
        if (PlayerPrefs.HasKey("Id"))//ver si existe la variable id guardada en el celular
        {
        }
        else
        {
            Code();//Generar codigo
        }
        dependencyStatus = FirebaseApp.CheckDependencies();
        if (dependencyStatus != DependencyStatus.Available)
        {
            FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
                dependencyStatus = FirebaseApp.CheckDependencies();
                if (dependencyStatus == DependencyStatus.Available)
                {
                    InitializeFirebase();
                }
                else
                {
                    Debug.LogError(
                        "Could not resolve all Firebase dependencies: " + dependencyStatus);
                }
            });
        }
        else
        {
            InitializeFirebase();
        }

        // Set these values before calling into the realtime database.
        FirebaseApp.DefaultInstance.SetEditorDatabaseUrl("https://directorio-5030a.firebaseio.com/");
        // Get the root reference location of the database.
        reference = FirebaseDatabase.DefaultInstance.RootReference;
        FirebaseAnalytics.LogEvent("begin_app", "percent", 1);
    }