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; }
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; }
// // 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)); }
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 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 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)); }
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()); }
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)"); } }
// Use this for initialization void Start() { updatesBeforeException = 0; SGFirebase.Setup(); Crashlytics.SetCustomKey("chave", "valor"); Crashlytics.Log("Log de erros aparece aqui"); }
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); }
public static void LogException(Exception e) { Debug.LogException(e); #if STENCIL_FIREBASE Crashlytics.LogException(e); #endif }
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); }
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 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); }
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(); }
public static void Log(string message) { if (!setupReady) { return; } Crashlytics.Log(message); }
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); } }
private void DestroyInterstitial() { Debug.Log("[ADS] [ADMOB] destroy current interstitial"); Crashlytics.Log($"[ADMOB] Destroy current interstitial"); this.interstitial.Destroy(); interstitial = null; }
public void OnTriggerCSharpCrash() { Crashlytics.Log("OnTriggerCSharpCrash"); Debug.LogWarning("UnityCrashTest : OnTriggerCSharpCrash"); throw new Exception("Test crash"); }
public static void LogException(System.Exception e) { if (!setupReady) { return; } Crashlytics.LogException(e); }
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); } }
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 }
private static void ThrowMenuMeltdown(String message) { try { throw new MenuMeltdownException(message); } catch (CrashlyticsCaughtException e) { Crashlytics.LogException(e); } }
private static void ThrowStatisticallyAsLikelyException(String message) { try { throw new StatisticallyAsLikelyException(message); } catch (CrashlyticsCaughtException e) { Crashlytics.LogException(e); } }
private static void ThrowIntentionallyObscureException() { try { throw new IntentionallyObscureException("An error occurred."); } catch (CrashlyticsCaughtException e) { Crashlytics.LogException(e); } }
private static void ThrowAnotherForcedException(String message) { try { throw new AnotherForcedException(message); } catch (CrashlyticsCaughtException e) { Crashlytics.LogException(e); } }
public static void SetCustomKey(string key, string value) { if (!setupReady) { return; } Crashlytics.SetCustomKey(key, value); FirebaseAnalytics.SetUserProperty(key, value); }
/// <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"); }
// 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); } }