private void InitInternal(string apiKey) { BugsnagApiKey = apiKey; NativeBugsnag.Register(BugsnagApiKey, TrackAppSessions || TrackAppSessionsStatic); if (BugsnagReleaseStageStatic != null) { Bugsnag.ReleaseStage = BugsnagReleaseStageStatic; } else if (Debug.isDebugBuild) { Bugsnag.ReleaseStage = "development"; } else { Bugsnag.ReleaseStage = "production"; } Bugsnag.Context = GetLevelName(); NativeBugsnag.SetAutoNotify(AutoNotify); NativeBugsnag.AddToTab("Unity", "unityException", "false"); NativeBugsnag.AddToTab("Unity", "unityVersion", Application.unityVersion.ToString()); NativeBugsnag.AddToTab("Unity", "platform", Application.platform.ToString()); NativeBugsnag.AddToTab("Unity", "osLanguage", Application.systemLanguage.ToString()); #if UNITY_5_OR_NEWER #if UNITY_5_6_OR_NEWER NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.identifier.ToString()); #else NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.bundleIdentifier.ToString()); #endif NativeBugsnag.AddToTab("Unity", "version", Application.version.ToString()); NativeBugsnag.AddToTab("Unity", "companyName", Application.companyName.ToString()); NativeBugsnag.AddToTab("Unity", "productName", Application.productName.ToString()); #endif }
void Awake() { DontDestroyOnLoad(this); NativeBugsnag.Register(BugsnagApiKey); if (Debug.isDebugBuild) { Bugsnag.ReleaseStage = "development"; } else { Bugsnag.ReleaseStage = "production"; } Bugsnag.Context = GetLevelName(); NativeBugsnag.SetAutoNotify(AutoNotify); NativeBugsnag.AddToTab("Unity", "unityVersion", Application.unityVersion.ToString()); NativeBugsnag.AddToTab("Unity", "platform", Application.platform.ToString()); NativeBugsnag.AddToTab("Unity", "osLanguage", Application.systemLanguage.ToString()); #if UNITY_5_OR_NEWER NativeBugsnag.AddToTab("Unity", "bundleIdentifier", Application.bundleIdentifier.ToString()); NativeBugsnag.AddToTab("Unity", "version", Application.version.ToString()); NativeBugsnag.AddToTab("Unity", "companyName", Application.companyName.ToString()); NativeBugsnag.AddToTab("Unity", "productName", Application.productName.ToString()); #endif }
public static void AddToTab(string tabName, string attributeName, string attributeValue) { if (tabName == null || attributeName == null) { return; } if (attributeValue == null) { attributeValue = "null"; } NativeBugsnag.AddToTab(tabName, attributeName, attributeValue); }