コード例 #1
0
        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;
        }
コード例 #2
0
    public void Start()
    {
        ///Login in will set profile type
        try
        {
            EmotivDeviceManager.Setup();
        }
        catch (NullEmotivDeviceException e)
        {
            LoginPanel.OnDismiss -= Start;
            LoginPanel.OnDismiss += Start;
            DisplayManager.Display(LoginPanel);

            Crashlytics.RecordCustomException("Emotiv Exception", "thrown exception", e.StackTrace);
            return;
        }


        ///Configure layout
        if (ApplyUserSettings)
        {
            MainConfig();
        }
        ///Start selecting
        SelectionManager.AllowSelection = true;
    }
コード例 #3
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)
        {
            global::Xamarin.Forms.Forms.Init();

            LoadApplication(new App());
            Firebase.Core.App.Configure();

            Crashlytics.Configure();
            Fabric.Fabric.SharedSdk.Debug = true;

            try
            {
                string division = "string";
                int    value    = Convert.ToInt32(division);
            }
            catch (Exception ex)
            {
                var crashInfo = new Dictionary <object, object>
                {
                    [NSError.LocalizedDescriptionKey] = ex.Message,
                    ["StackTrace"] = ex.StackTrace
                };

                var error = new NSError(new NSString(ex.GetType().FullName),
                                        -1,
                                        NSDictionary.FromObjectsAndKeys(crashInfo.Values.ToArray(), crashInfo.Keys.ToArray(), crashInfo.Count));


                Crashlytics.SharedInstance.RecordError(error);
                // var crashReporting = DependencyService.Get<ICrashReporting>();

                //crashReporting.CrashReportingInit();
            }
            return(base.FinishedLaunching(app, options));
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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;
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        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());
        }
コード例 #9
0
        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)");
            }
        }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     updatesBeforeException = 0;
     SGFirebase.Setup();
     Crashlytics.SetCustomKey("chave", "valor");
     Crashlytics.Log("Log de erros aparece aqui");
 }
コード例 #11
0
        private Player CreateDefaultPlayer(GlobalSettings settings)
        {
            print($"[PREFS] [PLAYER] CREATE NEW player");

            string levelProg = BlankLevelInfo(settings);

            settings.levelGroupingSettings[0].Locked = false;
            for (int i = 1; i < settings.levelGroupingSettings.Length; i++)
            {
                settings.levelGroupingSettings[i].Locked = true;
            }

            Player player = new Player
            {
                Name       = "New User",
                Guid       = Guid.NewGuid().ToString(),
                Coins      = settings.Coins.StartCoinCount,
                Hints      = settings.Hints.StartHintCount,
                Film       = settings.Film.StartFilmCount,
                IsNew      = true,
                GroupIndex = 0,
                CurrentLevelInGroupIndex = 0,
                MainPuzzleIndex          = 0,
                NewLocation        = false,
                FtuePassed         = false,
                LevelProgress      = levelProg,
                GameComplete       = false,
                ActiveGameSessions = 0,
                bonusSkus          = new List <string>()
            };

            Crashlytics.SetUserIdentifier(player.Guid);

            return(player);
        }
コード例 #12
0
 public static void LogException(Exception e)
 {
     Debug.LogException(e);
     #if STENCIL_FIREBASE
     Crashlytics.LogException(e);
     #endif
 }
コード例 #13
0
        public Player LoadPlayerData(GlobalSettings settings)
        {
            Player player = new Player();

            if (HasPlayerData)
            {
                try
                {
                    JsonUtility.FromJsonOverwrite(PlayerData, player);
                    player = LoadLevelProgress(player, settings);
                    Crashlytics.SetUserIdentifier(player.Guid);
                }
                catch (Exception e)
                {
                    Debug.LogException(e, this);

                    print($"[PREFS] [PLAYER] Exception caught, creating default player: {PlayerData}");
                    player = CreateDefaultPlayer(settings);
                }
            }
            else
            {
                print($"[PREFS] [PLAYER] No player data found, creating default player: {PlayerData}");
                player = CreateDefaultPlayer(settings);
                PersistPlayerProgress(player);
            }

            //print($"[PREFS] [PLAYER] Setting server game level: {PlayerData}");
            //player.MainPuzzleIndex = HasMainLevelIndexData ? MainGameLevelIndex : 0;
            return(player);
        }
コード例 #14
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.
            }
        });
    }
コード例 #15
0
ファイル: AppDelegate.cs プロジェクト: smohit1987/Adecco-CMS
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            Window.RootViewController = new RootViewController();


            var keys    = new object[] { "UserAgent" };
            var objects = new object[] { "Mozilla/5.0 (iPhone; CPU iPhone OS 9_3 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13E233" };

            var dictionnary = NSDictionary.FromObjectsAndKeys(objects, keys);

            NSUserDefaults.StandardUserDefaults.RegisterDefaults(dictionnary);


            // make the window visible
            Window.MakeKeyAndVisible();


            Setup.EnableCrashReporting(() =>
            {
                var crashlytics       = Crashlytics.SharedInstance;
                crashlytics.DebugMode = true;
                Crashlytics.StartWithAPIKey("bc21b872cc8e1a687fe564093d1618a4e165179d");
                Fabric.With(new NSObject[] { crashlytics });
                AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
                {
                    Setup.CaptureManagedInfo(e.ExceptionObject);
                    Setup.CaptureStackFrames(e.ExceptionObject);
                    Setup.ThrowExceptionAsNative(e.ExceptionObject);
                };
                TaskScheduler.UnobservedTaskException += (sender, e) =>
                {
                    Setup.CaptureManagedInfo(e.Exception);
                    Setup.CaptureStackFrames(e.Exception);
                    Setup.ThrowExceptionAsNative(e.Exception);
                };
            }, Path.GetFileNameWithoutExtension(typeof(AppDelegate).Module.Name));

            // We use NSUserDefaults to store a bool value if we are tracking the user or not
            var optionsDict = NSDictionary.FromObjectAndKey(new NSString("YES"), new NSString(AllowTrackingKey));

            NSUserDefaults.StandardUserDefaults.RegisterDefaults(optionsDict);

            // User must be able to opt out of tracking
            Gai.SharedInstance.OptOut = !NSUserDefaults.StandardUserDefaults.BoolForKey(AllowTrackingKey);

            // Initialize Google Analytics with a 5-second dispatch interval (Use a higher value when in production). There is a
            // tradeoff between battery usage and timely dispatch.
            Gai.SharedInstance.DispatchInterval        = 5;
            Gai.SharedInstance.TrackUncaughtExceptions = true;

            Tracker = Gai.SharedInstance.GetTracker("AdeccoNL", TrackingId);

            return(true);
        }
コード例 #16
0
        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();
        }
コード例 #17
0
 public static void Log(string message)
 {
     if (!setupReady)
     {
         return;
     }
     Crashlytics.Log(message);
 }
コード例 #18
0
ファイル: DebugManager.cs プロジェクト: rowlandg/valkyrie
 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);
     }
 }
コード例 #19
0
        private void DestroyInterstitial()
        {
            Debug.Log("[ADS] [ADMOB] destroy current interstitial");
            Crashlytics.Log($"[ADMOB] Destroy current interstitial");

            this.interstitial.Destroy();
            interstitial = null;
        }
コード例 #20
0
    public void OnTriggerCSharpCrash()
    {
        Crashlytics.Log("OnTriggerCSharpCrash");

        Debug.LogWarning("UnityCrashTest : OnTriggerCSharpCrash");

        throw new Exception("Test crash");
    }
コード例 #21
0
 public static void LogException(System.Exception e)
 {
     if (!setupReady)
     {
         return;
     }
     Crashlytics.LogException(e);
 }
コード例 #22
0
        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);
            }
        }
コード例 #23
0
    public static void LogError(string errorName, string errorDesc)
    {
                #if analytics
        Crashlytics.RecordCustomException(errorName, errorDesc, "");
        //FirebaseAnalytics.LogEvent (FirebaseAnalytics., errorName, isFatal ? "fatal" : "not fatal");

        ProjectManager.Log("[Analytics Error] " + errorName + ", " + errorDesc);
                #endif
    }
コード例 #24
0
 private static void ThrowMenuMeltdown(String message)
 {
     try {
         throw new MenuMeltdownException(message);
     }
     catch (CrashlyticsCaughtException e) {
         Crashlytics.LogException(e);
     }
 }
コード例 #25
0
 private static void ThrowStatisticallyAsLikelyException(String message)
 {
     try {
         throw new StatisticallyAsLikelyException(message);
     }
     catch (CrashlyticsCaughtException e) {
         Crashlytics.LogException(e);
     }
 }
コード例 #26
0
 private static void ThrowIntentionallyObscureException()
 {
     try {
         throw new IntentionallyObscureException("An error occurred.");
     }
     catch (CrashlyticsCaughtException e) {
         Crashlytics.LogException(e);
     }
 }
コード例 #27
0
 private static void ThrowAnotherForcedException(String message)
 {
     try {
         throw new AnotherForcedException(message);
     }
     catch (CrashlyticsCaughtException e) {
         Crashlytics.LogException(e);
     }
 }
コード例 #28
0
 public static void SetCustomKey(string key, string value)
 {
     if (!setupReady)
     {
         return;
     }
     Crashlytics.SetCustomKey(key, value);
     FirebaseAnalytics.SetUserProperty(key, value);
 }
コード例 #29
0
    /// <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");
    }
コード例 #30
0
 // Log a caught exception.
 public void LogCaughtException()
 {
     DebugLog("Catching an logging an exception.");
     try
     {
         throw new InvalidOperationException("This exception should be caught");
     } catch (Exception ex) {
         Crashlytics.LogException(ex);
     }
 }