public void HandleInterstitialFailedToLoad(object sender, AdFailedToLoadEventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleInterstitialFailedToLoad event received with message: " + args.Message);
            Crashlytics.Log($"[ADMOB] HandleInterstitialFailedToLoad event received, sender: {sender.ToString()}, message: {args.Message}");

            RefetchInterstitial();
        }
        public void HandleInterstitialOpened(object sender, EventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleInterstitialOpened event received");
            Crashlytics.Log($"[ADMOB] HandleInterstitialOpened event received, sender: {sender.ToString()}, message: {args.ToString()}");

            InvokeAndLog(interstitialStartedCallback, nameof(interstitialStartedCallback));
        }
        public void HandleRewardBasedVideoOpened(object sender, EventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleRewardBasedVideo Opened");
            Crashlytics.Log($"[ADMOB] HandleRewardBasedVideo Opened event received, sender: {sender.ToString()}, message: {args.ToString()}");

            InvokeAndLog(rewardBasedVideoStartedCallback, nameof(rewardBasedVideoStartedCallback));
        }
        public void HandleInterstitialLoaded(object sender, EventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleInterstitialLoaded event received");
            Crashlytics.Log($"[ADMOB] HandleInterstitialLoaded event received, sender: {sender.ToString()}, message: {args.ToString()}");

            refetchInterstitialCoroutine = null;
        }
        private void RequestInterstitial()
        {
            Debug.Log("[ADS] [ADMOB] request interstitial");
            Crashlytics.Log($"[ADMOB] Request interstitial");

            // These ad units are configured to always serve test ads.
#if UNITY_EDITOR
            string adUnitId = "unused";
#elif UNITY_ANDROID
            string adUnitId = QuixelInterstitialIDAndroid;
#elif UNITY_IPHONE
            string adUnitId = QuixelInterstitialIDiOS;
#else
            string adUnitId = "unexpected_platform";
#endif

            // Clean up interstitial ad before creating a new one.
            if (this.interstitial != null)
            {
                DestroyInterstitial();
            }

            // Create an interstitial.
            this.interstitial = new InterstitialAd(adUnitId);

            // Register for ad events.
            this.interstitial.OnAdLoaded             += this.HandleInterstitialLoaded;          // loaded - nothing
            this.interstitial.OnAdFailedToLoad       += this.HandleInterstitialFailedToLoad;    // failed to load - TODO: fetch again?
            this.interstitial.OnAdOpening            += this.HandleInterstitialOpened;          // opened
            this.interstitial.OnAdClosed             += this.HandleInterstitialClosed;          // closed
            this.interstitial.OnAdLeavingApplication += this.HandleInterstitialLeftApplication; // leaving app

            // Load an interstitial ad.
            this.interstitial.LoadAd(this.CreateAdRequest());
        }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     updatesBeforeException = 0;
     SGFirebase.Setup();
     Crashlytics.SetCustomKey("chave", "valor");
     Crashlytics.Log("Log de erros aparece aqui");
 }
        private void OnApplicationPause(bool isPaused)
        {
            if (isPaused)
            {
                // App going to background

                DebugLog($"[NOTIFICATION] app going into background now");
                Crashlytics.Log($"App going into background (Game Controller)");

                // clear previously scheduled alerts
                notificationController.ClearAllNotifications();

                double timeUntilFull = GetSecondsUntilFilmIsFull();
                if (timeUntilFull > 0)
                {
                    notificationController.ScheduleFilmReplenishmentNotification(timeUntilFull);
                }

                // updates miss you alert
                if (!ftueController.ShouldShowOneDayNotification)
                {
                    notificationController.ScheduleOneDayNotification();
                }
            }
            else
            {
                // App is restoring
                Crashlytics.Log($"App restoring from background (Game Controller)");
            }
        }
Beispiel #8
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.
            }
        });
    }
        public void HandleRewardBasedVideoLoaded(object sender, EventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleRewardBasedVideo Loaded");
            Crashlytics.Log($"[ADMOB] HandleRewardBasedVideo Loaded event received, sender: {sender.ToString()}, message: {args.ToString()}");

            refetchRewardedVideoCoroutine = null;
        }
        public void HandleRewardBasedVideoFailedToLoad(object sender, AdFailedToLoadEventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleRewardBasedVideo FailedToLoad with message: " + args.Message);
            Crashlytics.Log($"[ADMOB] HandleRewardBasedVideo FailedToLoad event received, sender: {sender.ToString()}, message: {args.ToString()}");

            RefetchRewardedVideo();
        }
        private void DestroyInterstitial()
        {
            Debug.Log("[ADS] [ADMOB] destroy current interstitial");
            Crashlytics.Log($"[ADMOB] Destroy current interstitial");

            this.interstitial.Destroy();
            interstitial = null;
        }
Beispiel #12
0
 static void HandleLog(string logString, string stackTrace, LogType type)
 {
     // only capture log from main thread, otherwise crashes
     if (Application.platform == RuntimePlatform.Android && Game.Get().mainThread.Equals(System.Threading.Thread.CurrentThread))
     {
         Crashlytics.Log(logString);
     }
 }
Beispiel #13
0
    public void OnTriggerCSharpCrash()
    {
        Crashlytics.Log("OnTriggerCSharpCrash");

        Debug.LogWarning("UnityCrashTest : OnTriggerCSharpCrash");

        throw new Exception("Test crash");
    }
Beispiel #14
0
 public static void Log(string message)
 {
     if (!setupReady)
     {
         return;
     }
     Crashlytics.Log(message);
 }
        public Player LoadLevelProgress(Player player, GlobalSettings settings)
        {
            Crashlytics.Log($"Loading level progress - {JsonUtility.ToJson(player)}");

            int mainIndex  = player.MainPuzzleIndex;
            int groupTally = 0;
            int group      = 0;
            int level      = 0;

            if (!player.GameComplete || player.MainPuzzleIndex < settings.LevelOrderSettings.RuleSettings.Length)
            {
                for (int k = 0; k < settings.levelGroupingSettings.Length; k++)
                {
                    settings.levelGroupingSettings[k].Locked = true;
                }

                for (int l = 0; l < settings.levelGroupingSettings.Length; l++)
                {
                    for (int m = 0; m < settings.levelGroupingSettings[l].Levels.Count; m++)
                    {
                        if (level >= mainIndex)
                        {
                            player.GroupIndex = l;
                            player.CurrentLevelInGroupIndex = groupTally;
                            settings.levelGroupingSettings[group].Locked = false;

                            player.GameComplete    = false;
                            player.MainPuzzleIndex = level;
                            player.LevelProgress   = BuildLevelProgress(player, settings);

                            print("BUILDER  " + player.LevelProgress);

                            PersistPlayerProgress(player);

                            print($"[PREFS] [PLAYER] LOADED player: {PlayerData}");
                            return(player);
                        }

                        groupTally += 1;
                        level      += 1;
                    }

                    settings.levelGroupingSettings[group].Locked = false;
                    group     += 1;
                    groupTally = 0;
                    level     += settings.levelGroupingSettings[l].GoldLevels.Count;
                }

                return(player);
            }
            else
            {
                player.LevelProgress = BuildLevelProgress(player, settings);
                PersistPlayerProgress(player);
                print($"[PREFS] [PLAYER] LOADED player (game complete): {PlayerData}");
                return(player);
            }
        }
    /// <summary>
    /// Method that generates log entries and crashes on Android, which are logged on Fabric.io (using Crashlytics)
    /// </summary>
    public void CrashMe()
    {
        StackFrame fr = new StackFrame(1, true);
        StackTrace st = new StackTrace(fr);

        Crashlytics.ThrowNonFatal();
        Crashlytics.RecordCustomException("NotSoGood Exception", "I have no clue what just happened", st);
        Crashlytics.Log("Non Fatal Just Happened");
    }
        private void CleanUpRewardedActions()
        {
            Debug.Log("[ADMOB] Clean up rewarded actions");
            Crashlytics.Log($"[ADMOB] Clean up rewarded actions");

            rewardBasedVideoErrorCallback     = null;
            rewardBasedVideoStartedCallback   = null;
            rewardBasedVideoFinishedCallback  = null;
            rewardBasedVideoCancelledCallback = null;
        }
        public void HandleRewardBasedVideoClosed(object sender, EventArgs args)
        {
            Debug.Log("[ADS] [ADMOB] HandleRewardBasedVideo Closed");
            Crashlytics.Log($"[ADMOB] HandleRewardBasedVideo Closed event received, sender: {sender.ToString()}, message: {args.ToString()}");

            InvokeAndLog(rewardBasedVideoCancelledCallback, nameof(rewardBasedVideoCancelledCallback));
            CleanUpRewardedActions();

            Fetch(AdType.RewardedVideo);
        }
        public void HandleInterstitialClosed(object sender, EventArgs args)
        {
            Debug.Log($"[ADS] [ADMOB] HandleInterstitialClosed event received {args.ToString()}");
            Crashlytics.Log($"[ADMOB] HandleInterstitialClosed event received, sender: {sender.ToString()}, message: {args.ToString()}");

            InvokeAndLog(interstitialFinishedCallback, nameof(interstitialFinishedCallback));
            CleanUpInterstitialActions();

            Fetch(AdType.Interstitial);
        }
Beispiel #20
0
        /*---------------------------------------------*/
        /*---------------------------------------------*/

        private void LogModelToCrashlystic()
        {
            Debug.Log("Model sent to Crashlystic");

            if (!IsFirebaseInited)
            {
                return;
            }
            Crashlytics.Log("Week: " + JsonUtility.ToJson(Modeler.Week));
            Crashlytics.Log("Game: " + JsonUtility.ToJson(Modeler.Game));
        }
        public void HandleRewardBasedVideoRewarded(object sender, Reward args)
        {
            string type   = args.Type;
            double amount = args.Amount;

            Debug.Log("[ADS] [ADMOB] HandleRewardBasedVideo Rewarded for " + amount.ToString() + " " + type);
            Crashlytics.Log($"[ADMOB] HandleRewardBasedVideo Rewarded event received, sender: {sender.ToString()}, message: {args.ToString()}");

            InvokeAndLog(rewardBasedVideoFinishedCallback, nameof(rewardBasedVideoFinishedCallback));
            CleanUpRewardedActions();
        }
Beispiel #22
0
    public void OnTriggerJavaCrash()
    {
        Crashlytics.Log("OnTriggerJavaCrash");

        Debug.LogWarning("UnityCrashTest : OnTriggerJavaCrash");
        AndroidJavaClass  unity           = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject currentActivity = unity.GetStatic <AndroidJavaObject>("currentActivity");

        AndroidJavaClass intentClass = new AndroidJavaClass("android.content.res.Configuration");

        currentActivity.Call("onConfigurationChanged", null);
    }
Beispiel #23
0
    IEnumerator DownloadAndCache(string _url)
    {
        InProgress = true;
        Debug.Log("Start downloading " + _url);
        // Wait for the Caching system to be ready
        while (!Caching.ready)
        {
            yield return(null);
        }

        AppController.Instance.ShowLoadingScreen();
        // Load the AssetBundle file from Cache if it exists with the same version or download and store it in the cache
        //using (WWW www = WWW.LoadFromCacheOrDownload(_url, 0))
        //{
        //    yield return www;
        //    if (www.error != null)
        //        throw new Exception("WWW download had an error:" + www.error);
        //    Crashlytics.Log(www.error);
        //    AssetBundle bundle = www.assetBundle;

        //    Debug.Log("End downloading " + _url);
        //    if (callback != null)
        //        callback.Invoke(bundle, _url);

        //    // Unload the AssetBundles compressed contents to conserve memory
        //    //bundle.Unload(false);

        //} // memory is freed from the web stream (www.Dispose() gets called implicitly)

        UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle(_url);

        yield return(www.SendWebRequest());

        if (www.isNetworkError || www.isHttpError)
        {
            Debug.Log(www.error);
            Crashlytics.Log(www.error);
            controller.ShowPopup(null, "Подгрузка контента прервана! Причина : " + www.error, "Ок");
        }
        else
        {
            AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(www);

            Debug.Log("End downloading " + _url);
            InProgress = false;

            if (callback != null)
            {
                callback.Invoke(bundle, _url);
            }
        }
    }
        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);
        }
Beispiel #25
0
        public static void Log(string message, Severity severity = Severity.Info)
        {
            switch (severity)
            {
            case Severity.Info:     Debug.Log(message);         break;

            case Severity.Error:    Debug.LogError(message);    break;

            case Severity.Warning:  Debug.LogWarning(message);  break;
            }

            Crashlytics.Log(severity.ToString() + ": " + message);
        }
 public DeliveryPage(string zipCode)
 {
     try
     {
         InitializeComponent();
         this.BindingContext = DeliveryPageModel.GetSingleton();
         this.Appearing     += DeliveryPage_Appearing;
         (this.BindingContext as DeliveryPageModel).Initialize(this.Navigation, zipCode);
     }
     catch (Exception e)
     {
         Crashlytics.Log(e);
     }
 }
        private void ShowInterstitial()
        {
            if (this.interstitial != null && this.interstitial.IsLoaded())
            {
                this.interstitial.Show();
            }
            else
            {
                Debug.Log("[ADS] [ADMOB] Interstitial is not ready yet");
                Crashlytics.Log($"[ADMOB] Interstitial is not ready yet");

                InvokeAndLog(interstitialErrorCallback, nameof(interstitialErrorCallback));
                CleanUpInterstitialActions(); // ?
            }
        }
        public void TryShowInterstitial(Action started = null, Action finished = null, Action error = null)
        {
            Debug.Log("[ADS] [ADMOB] try show interstitial");
            Crashlytics.Log($"[ADMOB] Try show interstitial");

            interstitialStartedCallback  = started;
            interstitialFinishedCallback = finished;
            interstitialErrorCallback    = error;
#if !UNITY_EDITOR
            ShowInterstitial();
#elif UNITY_EDITOR
            InvokeAndLog(interstitialFinishedCallback, nameof(interstitialFinishedCallback));
            CleanUpInterstitialActions();
#endif
        }
        private void ShowRewardBasedVideo()
        {
            if (this.rewardBasedVideo != null && this.rewardBasedVideo.IsLoaded())
            {
                this.rewardBasedVideo.Show();
            }
            else
            {
                Debug.Log("[ADS] [ADMOB] Reward based video ad is not ready yet");
                Crashlytics.Log($"[ADMOB] Rewarded video is not ready yet");

                InvokeAndLog(rewardBasedVideoErrorCallback, nameof(rewardBasedVideoErrorCallback));
                CleanUpRewardedActions(); // ?
            }
        }
        public void TryShowIncentivised(Action started = null, Action finished = null, Action error = null, Action cancelled = null)
        {
            Debug.Log("[ADS] [ADMOB] try show rewarded video");
            Crashlytics.Log($"[ADMOB] Try show rewarded video");

            rewardBasedVideoStartedCallback   = started;
            rewardBasedVideoFinishedCallback  = finished;
            rewardBasedVideoErrorCallback     = error;
            rewardBasedVideoCancelledCallback = cancelled;
#if !UNITY_EDITOR
            ShowRewardBasedVideo();
#elif UNITY_EDITOR
            InvokeAndLog(rewardBasedVideoFinishedCallback, nameof(rewardBasedVideoFinishedCallback));
            CleanUpRewardedActions();
#endif
        }