コード例 #1
0
    void CheckFirebase()
    {
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                app = Firebase.FirebaseApp.DefaultInstance;
                FirebaseApp.LogLevel = LogLevel.Debug;

                // Set a flag here to indicate whether Firebase is ready to use by your app.

                LogFireBaseEvents();

                Crashlytics.SetCustomKey("Size", "5");
                Crashlytics.SetCustomKey("User", "Jack");
                Crashlytics.SetCustomKey("CurrentPage", "Main");
                Crashlytics.SetCustomKey("Memo", "500");
                Crashlytics.Log("Start");

                Crashlytics.Log("PageShow");
            }
            else
            {
                UnityEngine.Debug.LogError(System.String.Format(
                                               "Firebase : Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
            }
        });
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     updatesBeforeException = 0;
     SGFirebase.Setup();
     Crashlytics.SetCustomKey("chave", "valor");
     Crashlytics.Log("Log de erros aparece aqui");
 }
コード例 #3
0
 public static void SetCustomKey(string key, string value)
 {
     if (!setupReady)
     {
         return;
     }
     Crashlytics.SetCustomKey(key, value);
     FirebaseAnalytics.SetUserProperty(key, value);
 }
コード例 #4
0
 private static void ThrowRandomTextException(String message)
 {
     Crashlytics.SetCustomKey("guid", Guid.NewGuid().ToString());
     try {
         throw new RandomTextException(message);
     }
     catch (CrashlyticsCaughtException e) {
         Crashlytics.LogException(e);
     }
 }
コード例 #5
0
        public ITracker SetUserProperty(string name, object value)
        {
            if (!StencilFirebase.IsReady)
            {
                return(this);
            }
            FirebaseAnalytics.SetUserProperty(name, value?.ToString());
#if STENCIL_FIREBASE
            Crashlytics.Log($"Set Property {name} = {value}");
            Crashlytics.SetCustomKey(name, value?.ToString() ?? "");
#endif
            return(this);
        }
コード例 #6
0
 // Add custom key / value pair to Crashlytics session
 public void SetCustomKey(String key, String value)
 {
     DebugLog("Setting Crashlytics Custom Key: <" + key + " / " + value + ">");
     Crashlytics.SetCustomKey(key, value);
 }