From 85555648ca87a863dfa789392acc55bbc043882b Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 19:03:03 +0500 Subject: [PATCH 01/13] docs(unity): move 6.x to v6, add 7.x page stubs, sidebar and redirects Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: If4ce1dfe61b63cc4269ad3fbdaf2d7afee543f89 --- docs/index.md | 16 +- docs/sdk/unity/appearance.mdx | 12 + docs/sdk/unity/breadcrumbs.mdx | 12 + docs/sdk/unity/build-setup/android.mdx | 12 + docs/sdk/unity/build-setup/ios.mdx | 12 + docs/sdk/unity/configuration.mdx | 12 + docs/sdk/unity/events-and-traces.mdx | 12 + docs/sdk/unity/faq.md | 12 + docs/sdk/unity/feedback.mdx | 12 + docs/sdk/unity/installation.mdx | 12 + .../crash-report-extension.mdx | 12 + docs/sdk/unity/issue-detection/overview.mdx | 12 + docs/sdk/unity/lifecycle.mdx | 12 + docs/sdk/unity/logs.mdx | 12 + docs/sdk/unity/manual/bug-reporting.mdx | 12 + .../unity/manual/crash-error-reporting.mdx | 12 + docs/sdk/unity/migration.mdx | 12 + docs/sdk/unity/network.mdx | 12 + docs/sdk/unity/notification-relay.md | 12 + docs/sdk/unity/overview.mdx | 12 + docs/sdk/unity/performance.mdx | 12 + docs/sdk/unity/privacy/breadcrumbs.md | 12 + docs/sdk/unity/privacy/cleanup.md | 12 + docs/sdk/unity/privacy/logs.md | 15 +- docs/sdk/unity/privacy/network.md | 10 - docs/sdk/unity/privacy/network.mdx | 12 + docs/sdk/unity/privacy/overview.md | 17 +- docs/sdk/unity/privacy/report.md | 12 + docs/sdk/unity/privacy/video.mdx | 12 + docs/sdk/unity/release-notes.md | 201 +---------------- docs/sdk/unity/report-handler.mdx | 12 + docs/sdk/unity/symbolication/android.mdx | 12 + .../symbolication/environment-variables.md | 12 + docs/sdk/unity/symbolication/ios.mdx | 12 + docs/sdk/unity/symbolication/managed-code.mdx | 12 + docs/sdk/unity/symbolication/overview.mdx | 12 + docs/sdk/unity/user-session-data.mdx | 12 + docs/sdk/unity/{ => v6}/add-component.png | Bin docs/sdk/unity/{ => v6}/appearance.md | 8 +- docs/sdk/unity/{ => v6}/configuration.md | 8 +- docs/sdk/unity/{ => v6}/crashes.md | 8 +- docs/sdk/unity/{ => v6}/create-object.png | Bin docs/sdk/unity/{ => v6}/custom.md | 6 +- docs/sdk/unity/{ => v6}/feedback.md | 6 +- docs/sdk/unity/{ => v6}/fill-token.png | Bin docs/sdk/unity/{ => v6}/installation.md | 8 +- docs/sdk/unity/{ => v6}/lifecycle.md | 6 +- docs/sdk/unity/{ => v6}/logs.md | 6 +- docs/sdk/unity/{ => v6}/manual.md | 6 +- docs/sdk/unity/v6/privacy/logs.md | 17 ++ docs/sdk/unity/v6/privacy/network.md | 14 ++ docs/sdk/unity/v6/privacy/overview.md | 21 ++ docs/sdk/unity/{ => v6}/privacy/video.md | 8 +- docs/sdk/unity/v6/release-notes.md | 205 ++++++++++++++++++ docs/sdk/unity/{ => v6}/script-debugging.png | Bin docs/sdk/unity/{ => v6}/slow-safe.png | Bin docs/sdk/unity/{ => v6}/versions.md | 6 +- docs/sdk/unity/video-capture.mdx | 12 + docs/sdk/unity/view-hierarchy.mdx | 12 + docusaurus.config.ts | 12 +- sidebars.ts | 117 ++++++++-- 61 files changed, 863 insertions(+), 266 deletions(-) create mode 100644 docs/sdk/unity/appearance.mdx create mode 100644 docs/sdk/unity/breadcrumbs.mdx create mode 100644 docs/sdk/unity/build-setup/android.mdx create mode 100644 docs/sdk/unity/build-setup/ios.mdx create mode 100644 docs/sdk/unity/configuration.mdx create mode 100644 docs/sdk/unity/events-and-traces.mdx create mode 100644 docs/sdk/unity/faq.md create mode 100644 docs/sdk/unity/feedback.mdx create mode 100644 docs/sdk/unity/installation.mdx create mode 100644 docs/sdk/unity/issue-detection/crash-report-extension.mdx create mode 100644 docs/sdk/unity/issue-detection/overview.mdx create mode 100644 docs/sdk/unity/lifecycle.mdx create mode 100644 docs/sdk/unity/logs.mdx create mode 100644 docs/sdk/unity/manual/bug-reporting.mdx create mode 100644 docs/sdk/unity/manual/crash-error-reporting.mdx create mode 100644 docs/sdk/unity/migration.mdx create mode 100644 docs/sdk/unity/network.mdx create mode 100644 docs/sdk/unity/notification-relay.md create mode 100644 docs/sdk/unity/overview.mdx create mode 100644 docs/sdk/unity/performance.mdx create mode 100644 docs/sdk/unity/privacy/breadcrumbs.md create mode 100644 docs/sdk/unity/privacy/cleanup.md delete mode 100644 docs/sdk/unity/privacy/network.md create mode 100644 docs/sdk/unity/privacy/network.mdx create mode 100644 docs/sdk/unity/privacy/report.md create mode 100644 docs/sdk/unity/privacy/video.mdx create mode 100644 docs/sdk/unity/report-handler.mdx create mode 100644 docs/sdk/unity/symbolication/android.mdx create mode 100644 docs/sdk/unity/symbolication/environment-variables.md create mode 100644 docs/sdk/unity/symbolication/ios.mdx create mode 100644 docs/sdk/unity/symbolication/managed-code.mdx create mode 100644 docs/sdk/unity/symbolication/overview.mdx create mode 100644 docs/sdk/unity/user-session-data.mdx rename docs/sdk/unity/{ => v6}/add-component.png (100%) rename docs/sdk/unity/{ => v6}/appearance.md (92%) rename docs/sdk/unity/{ => v6}/configuration.md (91%) rename docs/sdk/unity/{ => v6}/crashes.md (82%) rename docs/sdk/unity/{ => v6}/create-object.png (100%) rename docs/sdk/unity/{ => v6}/custom.md (91%) rename docs/sdk/unity/{ => v6}/feedback.md (69%) rename docs/sdk/unity/{ => v6}/fill-token.png (100%) rename docs/sdk/unity/{ => v6}/installation.md (86%) rename docs/sdk/unity/{ => v6}/lifecycle.md (87%) rename docs/sdk/unity/{ => v6}/logs.md (73%) rename docs/sdk/unity/{ => v6}/manual.md (79%) create mode 100644 docs/sdk/unity/v6/privacy/logs.md create mode 100644 docs/sdk/unity/v6/privacy/network.md create mode 100644 docs/sdk/unity/v6/privacy/overview.md rename docs/sdk/unity/{ => v6}/privacy/video.md (75%) create mode 100644 docs/sdk/unity/v6/release-notes.md rename docs/sdk/unity/{ => v6}/script-debugging.png (100%) rename docs/sdk/unity/{ => v6}/slow-safe.png (100%) rename docs/sdk/unity/{ => v6}/versions.md (93%) create mode 100644 docs/sdk/unity/video-capture.mdx create mode 100644 docs/sdk/unity/view-hierarchy.mdx diff --git a/docs/index.md b/docs/index.md index 688672a1..78cb2434 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,7 +14,7 @@ Using Bugsee on mobile devices requires installation of Bugsee lightweight SDK: * [Installing Cordova SDK](/sdk/cordova/installation/) * [Installing React Native SDK](/sdk/react_native/v6/installation/) * [Installing Flutter SDK](/sdk/flutter/installation/) -* [Installing Unity SDK](/sdk/unity/installation/) +* [Installing Unity SDK](/sdk/unity/v6/installation/) * [Installing KMP SDK (Beta)](/sdk/kmp/installation/) * [Installing Xamarin SDK](/sdk/xamarin/installation/) — **deprecated**, use the [.NET SDK](/sdk/dotnet/installation/) for new projects @@ -137,7 +137,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View @@ -148,7 +148,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View - View + View View @@ -159,7 +159,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View @@ -170,7 +170,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View @@ -181,7 +181,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View @@ -192,7 +192,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View @@ -203,7 +203,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve View View View - View + View View View diff --git a/docs/sdk/unity/appearance.mdx b/docs/sdk/unity/appearance.mdx new file mode 100644 index 00000000..7c3b62b3 --- /dev/null +++ b/docs/sdk/unity/appearance.mdx @@ -0,0 +1,12 @@ +--- +title: "Appearance" +description: "TODO(writer-B): Appearance for the Bugsee Unity SDK 7.x." +sidebar_position: 20 +slug: "/sdk/unity/appearance" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/breadcrumbs.mdx b/docs/sdk/unity/breadcrumbs.mdx new file mode 100644 index 00000000..e0141844 --- /dev/null +++ b/docs/sdk/unity/breadcrumbs.mdx @@ -0,0 +1,12 @@ +--- +title: "Breadcrumbs" +description: "TODO(writer-C): Breadcrumbs for the Bugsee Unity SDK 7.x." +sidebar_position: 9 +slug: "/sdk/unity/breadcrumbs" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/build-setup/android.mdx b/docs/sdk/unity/build-setup/android.mdx new file mode 100644 index 00000000..1bd61f41 --- /dev/null +++ b/docs/sdk/unity/build-setup/android.mdx @@ -0,0 +1,12 @@ +--- +title: "Android build setup" +description: "TODO(writer-A): Android build setup for the Bugsee Unity SDK 7.x." +sidebar_position: 2 +slug: "/sdk/unity/build-setup/android" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/build-setup/ios.mdx b/docs/sdk/unity/build-setup/ios.mdx new file mode 100644 index 00000000..f4e5783d --- /dev/null +++ b/docs/sdk/unity/build-setup/ios.mdx @@ -0,0 +1,12 @@ +--- +title: "iOS build setup" +description: "TODO(writer-A): iOS build setup for the Bugsee Unity SDK 7.x." +sidebar_position: 3 +slug: "/sdk/unity/build-setup/ios" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx new file mode 100644 index 00000000..c3d8d3e6 --- /dev/null +++ b/docs/sdk/unity/configuration.mdx @@ -0,0 +1,12 @@ +--- +title: "Configuration" +description: "TODO(writer-A): Configuration for the Bugsee Unity SDK 7.x." +sidebar_position: 4 +slug: "/sdk/unity/configuration" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/events-and-traces.mdx b/docs/sdk/unity/events-and-traces.mdx new file mode 100644 index 00000000..57f4b775 --- /dev/null +++ b/docs/sdk/unity/events-and-traces.mdx @@ -0,0 +1,12 @@ +--- +title: "Custom events & traces" +description: "TODO(writer-C): Custom events & traces for the Bugsee Unity SDK 7.x." +sidebar_position: 10 +slug: "/sdk/unity/events-and-traces" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/faq.md b/docs/sdk/unity/faq.md new file mode 100644 index 00000000..d90e1775 --- /dev/null +++ b/docs/sdk/unity/faq.md @@ -0,0 +1,12 @@ +--- +title: "FAQ" +description: "TODO(writer-F): FAQ for the Bugsee Unity SDK 7.x." +sidebar_position: 24 +slug: "/sdk/unity/faq" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-F) diff --git a/docs/sdk/unity/feedback.mdx b/docs/sdk/unity/feedback.mdx new file mode 100644 index 00000000..e439198a --- /dev/null +++ b/docs/sdk/unity/feedback.mdx @@ -0,0 +1,12 @@ +--- +title: "Feedback" +description: "TODO(writer-B): Feedback for the Bugsee Unity SDK 7.x." +sidebar_position: 18 +slug: "/sdk/unity/feedback" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/installation.mdx b/docs/sdk/unity/installation.mdx new file mode 100644 index 00000000..de930c4d --- /dev/null +++ b/docs/sdk/unity/installation.mdx @@ -0,0 +1,12 @@ +--- +title: "Installation" +description: "TODO(writer-A): Installation for the Bugsee Unity SDK 7.x." +sidebar_position: 1 +slug: "/sdk/unity/installation" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/issue-detection/crash-report-extension.mdx b/docs/sdk/unity/issue-detection/crash-report-extension.mdx new file mode 100644 index 00000000..9d0cf3cd --- /dev/null +++ b/docs/sdk/unity/issue-detection/crash-report-extension.mdx @@ -0,0 +1,12 @@ +--- +title: "Crash Report Extension (iOS)" +description: "TODO(writer-B): Crash Report Extension (iOS) for the Bugsee Unity SDK 7.x." +sidebar_position: 2 +slug: "/sdk/unity/issue-detection/crash-report-extension" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/issue-detection/overview.mdx b/docs/sdk/unity/issue-detection/overview.mdx new file mode 100644 index 00000000..a5db49c6 --- /dev/null +++ b/docs/sdk/unity/issue-detection/overview.mdx @@ -0,0 +1,12 @@ +--- +title: "Issue detection: Overview" +description: "TODO(writer-B): Issue detection: Overview for the Bugsee Unity SDK 7.x." +sidebar_position: 1 +slug: "/sdk/unity/issue-detection/overview" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/lifecycle.mdx b/docs/sdk/unity/lifecycle.mdx new file mode 100644 index 00000000..3412171c --- /dev/null +++ b/docs/sdk/unity/lifecycle.mdx @@ -0,0 +1,12 @@ +--- +title: "Lifecycle & status" +description: "TODO(writer-A): Lifecycle & status for the Bugsee Unity SDK 7.x." +sidebar_position: 5 +slug: "/sdk/unity/lifecycle" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/logs.mdx b/docs/sdk/unity/logs.mdx new file mode 100644 index 00000000..2731ae73 --- /dev/null +++ b/docs/sdk/unity/logs.mdx @@ -0,0 +1,12 @@ +--- +title: "Console logs" +description: "TODO(writer-C): Console logs for the Bugsee Unity SDK 7.x." +sidebar_position: 8 +slug: "/sdk/unity/logs" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/manual/bug-reporting.mdx b/docs/sdk/unity/manual/bug-reporting.mdx new file mode 100644 index 00000000..b78ddc59 --- /dev/null +++ b/docs/sdk/unity/manual/bug-reporting.mdx @@ -0,0 +1,12 @@ +--- +title: "Bug reporting" +description: "TODO(writer-B): Bug reporting for the Bugsee Unity SDK 7.x." +sidebar_position: 1 +slug: "/sdk/unity/manual/bug-reporting" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/manual/crash-error-reporting.mdx b/docs/sdk/unity/manual/crash-error-reporting.mdx new file mode 100644 index 00000000..b976403e --- /dev/null +++ b/docs/sdk/unity/manual/crash-error-reporting.mdx @@ -0,0 +1,12 @@ +--- +title: "Crash & error reporting" +description: "TODO(writer-B): Crash & error reporting for the Bugsee Unity SDK 7.x." +sidebar_position: 2 +slug: "/sdk/unity/manual/crash-error-reporting" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/migration.mdx b/docs/sdk/unity/migration.mdx new file mode 100644 index 00000000..a99d7077 --- /dev/null +++ b/docs/sdk/unity/migration.mdx @@ -0,0 +1,12 @@ +--- +title: "Migrating from 6.x to 7.x" +description: "TODO(writer-F): Migrating from 6.x to 7.x for the Bugsee Unity SDK 7.x." +sidebar_position: 25 +slug: "/sdk/unity/migration" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). +::: + +TODO(writer-F) diff --git a/docs/sdk/unity/network.mdx b/docs/sdk/unity/network.mdx new file mode 100644 index 00000000..3b314737 --- /dev/null +++ b/docs/sdk/unity/network.mdx @@ -0,0 +1,12 @@ +--- +title: "Network events" +description: "TODO(writer-C): Network events for the Bugsee Unity SDK 7.x." +sidebar_position: 7 +slug: "/sdk/unity/network" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/notification-relay.md b/docs/sdk/unity/notification-relay.md new file mode 100644 index 00000000..f3b4fdee --- /dev/null +++ b/docs/sdk/unity/notification-relay.md @@ -0,0 +1,12 @@ +--- +title: "Notification relay" +description: "TODO(writer-B): Notification relay for the Bugsee Unity SDK 7.x." +sidebar_position: 19 +slug: "/sdk/unity/notification-relay" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/overview.mdx b/docs/sdk/unity/overview.mdx new file mode 100644 index 00000000..171f4717 --- /dev/null +++ b/docs/sdk/unity/overview.mdx @@ -0,0 +1,12 @@ +--- +title: "Overview" +description: "TODO(writer-A): Overview for the Bugsee Unity SDK 7.x." +sidebar_position: 0 +slug: "/sdk/unity/overview" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-A) diff --git a/docs/sdk/unity/performance.mdx b/docs/sdk/unity/performance.mdx new file mode 100644 index 00000000..bb34a58a --- /dev/null +++ b/docs/sdk/unity/performance.mdx @@ -0,0 +1,12 @@ +--- +title: "Performance monitoring" +description: "TODO(writer-C): Performance monitoring for the Bugsee Unity SDK 7.x." +sidebar_position: 21 +slug: "/sdk/unity/performance" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/privacy/breadcrumbs.md b/docs/sdk/unity/privacy/breadcrumbs.md new file mode 100644 index 00000000..2b65239d --- /dev/null +++ b/docs/sdk/unity/privacy/breadcrumbs.md @@ -0,0 +1,12 @@ +--- +title: "Privacy: Breadcrumbs" +description: "TODO(writer-D): Privacy: Breadcrumbs for the Bugsee Unity SDK 7.x." +sidebar_position: 5 +slug: "/sdk/unity/privacy/breadcrumbs" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/cleanup.md b/docs/sdk/unity/privacy/cleanup.md new file mode 100644 index 00000000..c97c2b8a --- /dev/null +++ b/docs/sdk/unity/privacy/cleanup.md @@ -0,0 +1,12 @@ +--- +title: "Privacy: Cleanup" +description: "TODO(writer-D): Privacy: Cleanup for the Bugsee Unity SDK 7.x." +sidebar_position: 7 +slug: "/sdk/unity/privacy/cleanup" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/logs.md b/docs/sdk/unity/privacy/logs.md index 8d9c4929..3dc7acea 100644 --- a/docs/sdk/unity/privacy/logs.md +++ b/docs/sdk/unity/privacy/logs.md @@ -1,13 +1,12 @@ --- -title: "Privacy and console logs" -description: "Disable console log collection in the Bugsee Unity SDK using the CaptureLogs launch option to protect sensitive information." -sidebar_position: 2 +title: "Privacy: Console logs" +description: "TODO(writer-D): Privacy: Console logs for the Bugsee Unity SDK 7.x." +sidebar_position: 3 slug: "/sdk/unity/privacy/logs" --- -Bugsee automatically captures all standard application console logs. If those logs may contain PII data, the feature -can be completely disabled. +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: -## Disabling log collection - -Console log collection can be disabled completely using **CaptureLogs** launch option. See [configuration](/sdk/unity/configuration/) for more info. \ No newline at end of file +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/network.md b/docs/sdk/unity/privacy/network.md deleted file mode 100644 index 977a94fc..00000000 --- a/docs/sdk/unity/privacy/network.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Privacy and Network traffic" -description: "Disable network traffic collection in the Bugsee Unity SDK using the MonitorNetwork launch option to prevent capturing sensitive data." -sidebar_position: 3 -slug: "/sdk/unity/privacy/network" ---- - -## Disabling network traffic collection - -Network traffic collection can be disabled completely using **MonitorNetwork** launch option. See [configuration](/sdk/unity/configuration/) for more info. \ No newline at end of file diff --git a/docs/sdk/unity/privacy/network.mdx b/docs/sdk/unity/privacy/network.mdx new file mode 100644 index 00000000..cedc5c71 --- /dev/null +++ b/docs/sdk/unity/privacy/network.mdx @@ -0,0 +1,12 @@ +--- +title: "Privacy: Network" +description: "TODO(writer-D): Privacy: Network for the Bugsee Unity SDK 7.x." +sidebar_position: 4 +slug: "/sdk/unity/privacy/network" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index d688f508..fe127d4f 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -1,17 +1,12 @@ --- title: "Privacy overview" -description: "Overview of privacy considerations for Bugsee in Unity and links to controls for video, console logs, and network data collection." -sidebar_position: 0 +description: "TODO(writer-D): Privacy overview for the Bugsee Unity SDK 7.x." +sidebar_position: 1 slug: "/sdk/unity/privacy/overview" --- -Bugsee SDK does not continuously stream any personal data. The reports are stored locally on the phone in a cyclical buffer. Reports are being sent only when triggered by a crash, through a bug reporting UI or from an application's code. -Data sent along with the reports may include video recording of screen, network and console logs. These may potentially contain personal data (usernames, passwords, emails, etc). +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: -It is the sole responsibility of the application developers to remove any such data from the reports before it leaves the users’ device. - -Bugsee provides the tools and means to either prevent some data from being collected or clean the data during the collection process: - -* [Video and Touch](/sdk/unity/privacy/video/) -* [Console logs](/sdk/unity/privacy/logs/) -* [Network logs](/sdk/unity/privacy/network/) \ No newline at end of file +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md new file mode 100644 index 00000000..c7e0be01 --- /dev/null +++ b/docs/sdk/unity/privacy/report.md @@ -0,0 +1,12 @@ +--- +title: "Privacy: Report" +description: "TODO(writer-D): Privacy: Report for the Bugsee Unity SDK 7.x." +sidebar_position: 6 +slug: "/sdk/unity/privacy/report" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-D) diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx new file mode 100644 index 00000000..77447a26 --- /dev/null +++ b/docs/sdk/unity/privacy/video.mdx @@ -0,0 +1,12 @@ +--- +title: "Privacy: Video" +description: "TODO(writer-D): Privacy: Video for the Bugsee Unity SDK 7.x." +sidebar_position: 2 +slug: "/sdk/unity/privacy/video" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-D) diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index bd1ac4ee..b4811ee5 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -1,201 +1,12 @@ --- title: "Release notes" -description: "Changelog for the Bugsee Unity SDK, listing all version updates, new features, bug fixes, and breaking changes." -sidebar_position: 10 +description: "TODO(writer-F): Release notes for the Bugsee Unity SDK 7.x." +sidebar_position: 23 slug: "/sdk/unity/release-notes" --- -## 6.0.2 (March 20 2026) -- Feat: Updated native SDKs to their latest versions (Android: [6.0.2](/sdk/android/v6/release-notes/#602-march-11-2026), iOS: [6.1.2](/sdk/ios/v6/release-notes/#612-march-4-2026)) +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: -## 6.0.0 (March 6 2026) -- Feat: Updated native SDKs to their latest versions (Android: [6.0.0](/sdk/android/v6/release-notes/#600-december-9-2025), iOS: [6.1.2](/sdk/ios/v6/release-notes/#612-march-4-2026)) -- Breaking: \[iOS\] Minimum deployment target is iOS 12.0 -- Breaking: \[Android\] Bugsee SDK is now built with Android SDK version 35, hence requires compileSDKVersion 35 -- Breaking: \[Android\] AGP 8.6.0 or newer is now required - -## 5.3.9 (December 5 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.9.3](/sdk/android/v6/release-notes/#593-december-4-2025), iOS: [5.5.9](/sdk/ios/v6/release-notes/#559-november-17-2025)) - -## 5.3.8 (November 18 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.9.1](/sdk/android/v6/release-notes/#591-september-29-2025), iOS: [5.5.9](/sdk/ios/v6/release-notes/#559-november-17-2025)) - -## 5.3.7 (August 21 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.8.4](/sdk/android/v6/release-notes/#584-august-21-2025), iOS: [5.5.8](/sdk/ios/v6/release-notes/#558-august-21-2025)) - -## 5.3.6 (July 10 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.7.6](/sdk/android/v6/release-notes/#576-june-19-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) -- Fix: \[iOS\] In some configurations, build may fail with "Undefined symbols" error - -## 5.3.5 (June 8 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.7.5](/sdk/android/v6/release-notes/#575-june-8-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) -- Fix: \[Android\] In some configurations, application may crash on device with 16KB memory pages - -## 5.3.4 (May 6 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.7.3](/sdk/android/v6/release-notes/#573-may-5-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) - -## 5.3.3 (April 22 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.7.2](/sdk/android/v6/release-notes/#572-march-17-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) - -## 5.3.2 (February 4 2025) -- Feat: Updated native SDKs to their latest versions (Android: [5.6.5](/sdk/android/v6/release-notes/#565-february-3-2025), iOS: [5.5.4](/sdk/ios/v6/release-notes/#554-january-27-2025)) -- Fix: \[Android\] Built-in UI shifts upwards in some scenarios on Android 15 (specifically, when hosting application itself is targeting Android 15, i.e. target SDK version is 35) - -## 5.3.1 (September 12 2024) -- Feat: Updated native SDKs to their latest versions (Android: 5.4.2, iOS: 5.3.2) -- Fix: \[Android\] Crash when bug is sent from built-in reporting UI after removing screenshot - -## 5.3.0 (September 9 2024) -- Feat: Updated native SDKs to their latest versions (Android: 5.4.1, iOS: 5.3.2) -- Feat: \[Android\] 16KB memory pages support - -## 5.2.0 (April 23 2024) -- Fix: \[Android\] In some cases, video before FG->BG->FG transitions may be absent -- Note: \[Android\] compileSdkVersion 34 and up is now required - -## 5.1.0 (April 11 2024) -- Feat: Updated native SDKs to their latest versions (Android: 4.2.4, iOS: 5.0.2) - -## 5.0.0 (January 10 2024) -- Feat: Updated native SDKs to their latest versions (Android: 4.2.1, iOS: 5.0.0) -- Breaking: \[iOS\] Bitcode is not present in the resulting binaries any more - -## 4.0.0 (October 2 2023) -- Feat: Updated native SDKs to their latest versions (Android: [4.0.1](/sdk/android/v6/release-notes/#401-september-30-2023), iOS: [4.0.1](/sdk/ios/v6/release-notes/#401-september-30-2023)) -- Breaking: Changes for the underlying SDKs: [Android](/sdk/android/v6/release-notes/#401-september-30-2023) and [iOS](/sdk/ios/v6/release-notes/#401-september-30-2023). - -## 3.3.0 (September 4 2023) -- Feat: Updated native SDKs to their latest versions (Android: 3.10.0, iOS: 3.8.0) -- Feat: Add new API to manually trigger view hierarchy capturing. Multiple view hierarchies support. - -## 3.2.0 (April 12 2023) -- Feature: Add Appearance API support \[[Learn more](/sdk/unity/appearance/)\] - -## 3.1.0 (April 6 2023) -- Feature: Update native SDKs to the latest versions (Android: 3.6.0, iOS: 3.5.0) - -## 3.0.5 (March 3 2023) -- Feature: Update native SDKs to the latest versions (Android: 3.4.0, iOS: 3.3.3) - -## 3.0.4 (January 31 2023) -- Feature: Update native SDKs to the latest versions (Android: 3.4.0, iOS: 3.3.2) - -## 3.0.3 (November 25 2022) -- Feature: Update native SDKs to the latest versions (Android: 3.1.0, iOS: 3.3.2) -- Feature: On iOS, captured video is now brighter than before and should be aligned (in brightness) with actual picture on real device - -## 3.0.2 (November 25 2022) -- Feature: Update native SDKs to the latest versions (Android: 3.0.2, iOS: 3.2.1) - -## 3.0.1 (October 25 2022) -- Feature: Update native SDKs to the latest versions (Android: 3.0.0, iOS: 3.1.1) -- Fix: "OSLog.framework" is not mandatory now - -## 3.0.0 (September 2 2022) -- Feature: Update native SDKs to the latest versions (Android: 3.0.0, iOS: 3.0.0) -- Note: Please refer to the underlying SDKs release notes to get the detailed list of changes: [Android](/sdk/android/v6/release-notes/#300-august-19-2022) / [iOS](/sdk/ios/v6/release-notes/#300-september-1-2022) -- Note: On iOS, “OSLog.framework” needs to be added to your project with Bugsee in Xcode into “Frameworks, Libraries and Embedded Content” to fix this. This is required as now Bugsee is able to intercept OSLog-based logged data. - - -## 2.0.3 (August 16 2022) -- Feature: Updated native Android SDKs to their latest version. Improvements for Unity as a Library scenario - -## 2.0.2 (June 1 2022) -- Feature: Updated native Android SDKs to their latest version. Several race conditions are fixed - -## 2.0.1 (May 11 2022) -- Feature: Update native SDKs to the latest versions (Android: 2.1.2, iOS: 2.1.7) - -## 2.0.0 (Mar 23 2022) -- Feature: Update native SDKs to the latest versions (Android: 2.0.7, iOS: 2.1.1) -- Breaking change: Underlying Bugsee SDK was built with the iOS SDK 15.0 -- Breaking change: Underlying Bugsee Android SDK is now completely AndroidX-based - -## 1.8.0 (Dec 22 2021) -- Feature: Update native Android SDK to the latest version - -## 1.7.6 (Aug 9 2021) -- Feature: Update native Android SDK to the latest version - -## 1.7.5 (Dec 11 2020) -- Fix: Broken AddSecureRect API on Android -- Fix: Missing ClearAllAttributes API on Android -- Feature: Update native iOS SDK to the latest version - -## 1.7.4 (Aug 31 2020) -- Feature: Update native SDKs to the latest versions - -## 1.7.3 (Jun 15 2020) -- Fix: Build failure for Unity 2019+ - -## 1.7.2 (Jun 9 2020) -- Feature: Update native SDKs to their latest versions (Android: 1.18.0, iOS: 1.25.6) - -## 1.7.1 (April 7 2020) -- Fix: Update native SDK, to disable on-device symbolication by default to prevent application crash \[iOS\] - -## 1.7.0 (March 27 2020) -- Feature: Improve backward compatibility with older versions of Unity and .NET -- Feature: Update native SDKs to their latest versions (Android: 1.17.3, iOS: 1.25.3) - -## 1.6.2 (December 12 2019) -- Fix: Completely strip all the references to UIWebView \[iOS\] - -## 1.6.1 (December 8 2019) -- Fix: Do not report errors logged with Debug.LogError() -- Fix: Degrade syntax to make code backward compatible with previous Unity versions - -## 1.6.0 (Nov 28 2019) -- Feature: Native SDKs are updated to their latest versions -- Fix: inconsistency in handled/unhandled report state propagation for iOS/Android - -## 1.5.0 (Sep 27 2019) -- Fix: Make input fields in reporting UI always accessible \[iOS\] -- Fix: Do not skip WebView requests \[Android\] -- Feature: Add support for Android 10 \[Android\] -- Feature: Improve crashes and errors -- Native SDKs are updated to their latest versions - -## 1.4.3 (Sep 16 2019) -- Fix: Crashes in video rendering pipeline -- Native SDKs are updated to their latest versions - -## 1.4.2 (Jul 17 2019) -- Native SDKs are updated to their latest versions - -## 1.4.1 (Jun 27 2019) -- Native SDKs are updated to their latest versions - -## 1.4.0 (Jun 12 2019) -- Feature: lifecycle events are now supported -- Native SDKs are updated to their latest versions - -## 1.3.1 (Dec 12 2018) -- Maintenance update - -## 1.3.0 (Dec 11 2018) -- Update: Native SDKs are updated to their latest versions (contains fixes for known issues) - -## 1.2.10 (Oct 26 2018) -- Feature: attachments are supported now both on iOS and Android platforms [read more](/sdk/unity/custom/) -- Fix: handle exceptions, thrown from worker threads, properly - -## 1.2.9 (Sep 24 2018) -- Update iOS to 1.18.15 to fix iOS12 crash when collecting extended crash data - -## 1.2.8 (Aug 28 2018) -- Feature: Add getDeviceID() method -- Bug fixes: various stability fixes -- Use iOS SDK 1.18.11 and Android SDK 1.12.9 - -## 1.2.7 (Apr 10 2018) -- Feature: Hide screen regions from video [read more](/sdk/unity/privacy/video/) -- Feature: SDK can now be stopped and relaunched [read more](/sdk/unity/configuration/) -- Feature: Video on Android is now disabled by default -- Updated native SDK: iOS 1.18.0 and Android SDK 1.11.8 -- Minor bug fixes - -## 1.2.6 (Mar 9 2018) -- Updated native SDK: iOS 1.17.20 -- Feature: VideoScale option [read more](/sdk/unity/configuration/) -- Minor bug fixes \ No newline at end of file +TODO(writer-F) diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx new file mode 100644 index 00000000..cd13d7ab --- /dev/null +++ b/docs/sdk/unity/report-handler.mdx @@ -0,0 +1,12 @@ +--- +title: "Report handler" +description: "TODO(writer-B): Report handler for the Bugsee Unity SDK 7.x." +sidebar_position: 6 +slug: "/sdk/unity/report-handler" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-B) diff --git a/docs/sdk/unity/symbolication/android.mdx b/docs/sdk/unity/symbolication/android.mdx new file mode 100644 index 00000000..af059d00 --- /dev/null +++ b/docs/sdk/unity/symbolication/android.mdx @@ -0,0 +1,12 @@ +--- +title: "Symbolication: Android" +description: "TODO(writer-E): Symbolication: Android for the Bugsee Unity SDK 7.x." +sidebar_position: 2 +slug: "/sdk/unity/symbolication/android" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-E) diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md new file mode 100644 index 00000000..0335cebe --- /dev/null +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -0,0 +1,12 @@ +--- +title: "Build environment variables" +description: "TODO(writer-E): Build environment variables for the Bugsee Unity SDK 7.x." +sidebar_position: 5 +slug: "/sdk/unity/symbolication/environment-variables" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-E) diff --git a/docs/sdk/unity/symbolication/ios.mdx b/docs/sdk/unity/symbolication/ios.mdx new file mode 100644 index 00000000..aced9a0c --- /dev/null +++ b/docs/sdk/unity/symbolication/ios.mdx @@ -0,0 +1,12 @@ +--- +title: "Symbolication: iOS" +description: "TODO(writer-E): Symbolication: iOS for the Bugsee Unity SDK 7.x." +sidebar_position: 3 +slug: "/sdk/unity/symbolication/ios" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-E) diff --git a/docs/sdk/unity/symbolication/managed-code.mdx b/docs/sdk/unity/symbolication/managed-code.mdx new file mode 100644 index 00000000..119acb70 --- /dev/null +++ b/docs/sdk/unity/symbolication/managed-code.mdx @@ -0,0 +1,12 @@ +--- +title: "Symbolication: C# code" +description: "TODO(writer-E): Symbolication: C# code for the Bugsee Unity SDK 7.x." +sidebar_position: 4 +slug: "/sdk/unity/symbolication/managed-code" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-E) diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx new file mode 100644 index 00000000..332b993e --- /dev/null +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -0,0 +1,12 @@ +--- +title: "Symbolication overview" +description: "TODO(writer-E): Symbolication overview for the Bugsee Unity SDK 7.x." +sidebar_position: 1 +slug: "/sdk/unity/symbolication/overview" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-E) diff --git a/docs/sdk/unity/user-session-data.mdx b/docs/sdk/unity/user-session-data.mdx new file mode 100644 index 00000000..34961f2f --- /dev/null +++ b/docs/sdk/unity/user-session-data.mdx @@ -0,0 +1,12 @@ +--- +title: "User & session data" +description: "TODO(writer-C): User & session data for the Bugsee Unity SDK 7.x." +sidebar_position: 11 +slug: "/sdk/unity/user-session-data" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/add-component.png b/docs/sdk/unity/v6/add-component.png similarity index 100% rename from docs/sdk/unity/add-component.png rename to docs/sdk/unity/v6/add-component.png diff --git a/docs/sdk/unity/appearance.md b/docs/sdk/unity/v6/appearance.md similarity index 92% rename from docs/sdk/unity/appearance.md rename to docs/sdk/unity/v6/appearance.md index 6bb7acd5..56715765 100644 --- a/docs/sdk/unity/appearance.md +++ b/docs/sdk/unity/v6/appearance.md @@ -2,10 +2,14 @@ title: "Appearance" description: "Customize colors and placeholder text for the Bugsee report and feedback UI in Unity on both iOS and Android." sidebar_position: 7 -slug: "/sdk/unity/appearance" +slug: "/sdk/unity/v6/appearance" --- -You can always change colors of the [Report](/sdk/unity/manual/) and [Feedback](/sdk/unity/feedback/) UI. +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + +You can always change colors of the [Report](/sdk/unity/v6/manual/) and [Feedback](/sdk/unity/v6/feedback/) UI. ```csharp // For example diff --git a/docs/sdk/unity/configuration.md b/docs/sdk/unity/v6/configuration.md similarity index 91% rename from docs/sdk/unity/configuration.md rename to docs/sdk/unity/v6/configuration.md index 936ee22f..800f7820 100644 --- a/docs/sdk/unity/configuration.md +++ b/docs/sdk/unity/v6/configuration.md @@ -2,9 +2,13 @@ title: "Configuration" description: "Reference for all Bugsee Unity SDK launch options for iOS and Android, including video modes, crash reporting, and network monitoring." sidebar_position: 1 -slug: "/sdk/unity/configuration" +slug: "/sdk/unity/v6/configuration" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## Launching with options Bugsee behavior is very customizable, if default configuration is not satisfying your needs you can launch the SDK with additional parameters. You'll need to create partial class ```BugseeLauncher``` within namespace ```BugseePlugin``` in a separate file. Use instance of ```IOSLaunchOptions``` or ```AndroidLaunchOptions``` for corresponding platform to change Bugsee behavior. @@ -152,4 +156,4 @@ If you want to use V2 mode, your application will have to declare these permissi **\*\*\*\*VideoMode.V4**: VideoMode.V4 (experimental) gives client code an ability to decide when to add frames to a video, calling Bugsee.Snapshot() method. If frames are added rarely, additional CPU and GPU load is relatively small, but the resulting video looks more like a slide show. And vice versa, in case of frequent calls to Bugsee.Snapshot() performance can be influenced essentially, but the resulting video looks better. By default frame is added to a video only on the start of recording and on exception. -Note that it is necessary to enable "Allow unsafe code" option in Player Settings and to execute an additional step, described in "Gather GPU info on Android" section of [Installation guide](/sdk/unity/installation/) to make VideoMode.V4 work. Also, note that starting with Bugsee Unity SDK 1.7.0 V4 is disabled and unavailable by default. You need to define ```BUGSEE_VIDEO_V4``` to enable VideoMode.V4. The reason for this, as stated above, is that V4 requires unsafe option to be set for the project, which is not usually desired. You can find out how to supply your own ```#define``` directives in Platform dependent compilation section of Unity documentation. \ No newline at end of file +Note that it is necessary to enable "Allow unsafe code" option in Player Settings and to execute an additional step, described in "Gather GPU info on Android" section of [Installation guide](/sdk/unity/v6/installation/) to make VideoMode.V4 work. Also, note that starting with Bugsee Unity SDK 1.7.0 V4 is disabled and unavailable by default. You need to define ```BUGSEE_VIDEO_V4``` to enable VideoMode.V4. The reason for this, as stated above, is that V4 requires unsafe option to be set for the project, which is not usually desired. You can find out how to supply your own ```#define``` directives in Platform dependent compilation section of Unity documentation. \ No newline at end of file diff --git a/docs/sdk/unity/crashes.md b/docs/sdk/unity/v6/crashes.md similarity index 82% rename from docs/sdk/unity/crashes.md rename to docs/sdk/unity/v6/crashes.md index 52d23f88..2772e0ea 100644 --- a/docs/sdk/unity/crashes.md +++ b/docs/sdk/unity/v6/crashes.md @@ -2,9 +2,13 @@ title: "Crash reports" description: "Configure Unity project settings for managed C# exception capture and native crash symbolication with Bugsee." sidebar_position: 8 -slug: "/sdk/unity/crashes" +slug: "/sdk/unity/v6/crashes" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## Managed C# code crashes In order for Bugsee to be able to receive unhandled exceptions from managed C# code, the **Script Call Optimization** must be set to **Slow and Safe**. @@ -42,5 +46,5 @@ were stripped afterwards. See [Unity Mono](/cli/debug-files/#unity-mono). Unity does not by default enable dSYM creation for its builds. Bugsee does not modify the build to enable it, it has to be done manually on the resulting Xcode project. It will not work, however, if **Script Debugging** is enabled, dSYM generation fails in this case. -See iOS crash reporting [instructions](/sdk/ios/symbolication/) for information on setting dSYM auto uploading. +See iOS crash reporting [instructions](/sdk/ios/v6/symbolication/) for information on setting dSYM auto uploading. diff --git a/docs/sdk/unity/create-object.png b/docs/sdk/unity/v6/create-object.png similarity index 100% rename from docs/sdk/unity/create-object.png rename to docs/sdk/unity/v6/create-object.png diff --git a/docs/sdk/unity/custom.md b/docs/sdk/unity/v6/custom.md similarity index 91% rename from docs/sdk/unity/custom.md rename to docs/sdk/unity/v6/custom.md index 4258151c..336bff8f 100644 --- a/docs/sdk/unity/custom.md +++ b/docs/sdk/unity/v6/custom.md @@ -2,9 +2,13 @@ title: "Adding custom data" description: "Attach user email, session attributes, custom events, traces, and file attachments to Bugsee reports in Unity." sidebar_position: 3 -slug: "/sdk/unity/custom" +slug: "/sdk/unity/v6/custom" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## User email When you already have your users identified within your app, you might want to automatically attach their email to the bug report. Bugsee provides APIs for setting, getting, and clearing the email. diff --git a/docs/sdk/unity/feedback.md b/docs/sdk/unity/v6/feedback.md similarity index 69% rename from docs/sdk/unity/feedback.md rename to docs/sdk/unity/v6/feedback.md index 26afd701..3a33cf2f 100644 --- a/docs/sdk/unity/feedback.md +++ b/docs/sdk/unity/v6/feedback.md @@ -2,9 +2,13 @@ title: "Feedback" description: "Enable in-app user-to-support messaging in Unity by launching Bugsee's built-in feedback UI and setting a default greeting message." sidebar_position: 6 -slug: "/sdk/unity/feedback" +slug: "/sdk/unity/v6/feedback" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + Bugsee implements a built-in single-threaded messenger to allow your users to communicate with your support and developers. ## Feedback controller diff --git a/docs/sdk/unity/fill-token.png b/docs/sdk/unity/v6/fill-token.png similarity index 100% rename from docs/sdk/unity/fill-token.png rename to docs/sdk/unity/v6/fill-token.png diff --git a/docs/sdk/unity/installation.md b/docs/sdk/unity/v6/installation.md similarity index 86% rename from docs/sdk/unity/installation.md rename to docs/sdk/unity/v6/installation.md index afc6978e..3fc80942 100644 --- a/docs/sdk/unity/installation.md +++ b/docs/sdk/unity/v6/installation.md @@ -2,9 +2,13 @@ title: "Installation" description: "Install the Bugsee Unity package, configure app tokens for iOS and Android, and set up the required scene GameObject." sidebar_position: 0 -slug: "/sdk/unity/installation" +slug: "/sdk/unity/v6/installation" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + :::info[Agent-Assisted Setup] Ask your AI coding assistant: @@ -17,7 +21,7 @@ Works with Claude Code, Cursor, Copilot, Codex, and more. [Learn more](/ai/agent ## Plugin Installation -Download and install the latest [Bugsee.unitypackage](https://download.bugsee.com/sdk/unity/BugseeUnity-stable.unitypackage) (or see all available versions [here](/sdk/unity/versions/)) package and install it in your project. Note, that if an older version of Bugsee package was installed in your project, it is necessary to remove "Plugins\Bugsee" folder first. +Download and install the latest [Bugsee.unitypackage](https://download.bugsee.com/sdk/unity/BugseeUnity-stable.unitypackage) (or see all available versions [here](/sdk/unity/v6/versions/)) package and install it in your project. Note, that if an older version of Bugsee package was installed in your project, it is necessary to remove "Plugins\Bugsee" folder first. This should install all the necessary files in the Assets folder of your project. Make sure the files were indeed added to your project and create a new empty object within a scene: diff --git a/docs/sdk/unity/lifecycle.md b/docs/sdk/unity/v6/lifecycle.md similarity index 87% rename from docs/sdk/unity/lifecycle.md rename to docs/sdk/unity/v6/lifecycle.md index 77833047..2a819cd0 100644 --- a/docs/sdk/unity/lifecycle.md +++ b/docs/sdk/unity/v6/lifecycle.md @@ -2,9 +2,13 @@ title: "Lifecycle events" description: "Subscribe to Bugsee SDK lifecycle events in Unity to be notified when the SDK starts, stops, pauses, or uploads reports." sidebar_position: 9 -slug: "/sdk/unity/lifecycle" +slug: "/sdk/unity/v6/lifecycle" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + Bugsee SDK silently works within your app, recording everything to assist you in debugging when something unexpected happens. Our SDK is designed as a black box, but there may be cases when you want to be notified about changes/events within Bugsee itself. Lifecycle events are designed exactly for that. Whenever internal state changes or some important event is raised, a lifecycle event is dispatched to the user code. ## Implementing callback diff --git a/docs/sdk/unity/logs.md b/docs/sdk/unity/v6/logs.md similarity index 73% rename from docs/sdk/unity/logs.md rename to docs/sdk/unity/v6/logs.md index e017d985..8da4e6b7 100644 --- a/docs/sdk/unity/logs.md +++ b/docs/sdk/unity/v6/logs.md @@ -2,9 +2,13 @@ title: "Logging" description: "Send custom log messages with explicit severity levels directly to Bugsee from Unity C# code without printing to the console." sidebar_position: 4 -slug: "/sdk/unity/logs" +slug: "/sdk/unity/v6/logs" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + Nothing needs to be done on your part if all you need is to retrieve standard logs, Bugsee will extract the logs for the relevant period of time and upload it as part of the report. We provide an additional API to push logs directly into Bugsee without printing them to console. diff --git a/docs/sdk/unity/manual.md b/docs/sdk/unity/v6/manual.md similarity index 79% rename from docs/sdk/unity/manual.md rename to docs/sdk/unity/v6/manual.md index db003e33..e9224998 100644 --- a/docs/sdk/unity/manual.md +++ b/docs/sdk/unity/v6/manual.md @@ -2,9 +2,13 @@ title: "Manual invocation" description: "Programmatically trigger the report dialog, silently upload issues, and log non-fatal exceptions from Unity C# code." sidebar_position: 2 -slug: "/sdk/unity/manual" +slug: "/sdk/unity/v6/manual" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## Report view In addition to detection of a shake gesture or launching with notification bar item, report view can be triggered programmatically: diff --git a/docs/sdk/unity/v6/privacy/logs.md b/docs/sdk/unity/v6/privacy/logs.md new file mode 100644 index 00000000..fdd5cb5b --- /dev/null +++ b/docs/sdk/unity/v6/privacy/logs.md @@ -0,0 +1,17 @@ +--- +title: "Privacy and console logs" +description: "Disable console log collection in the Bugsee Unity SDK using the CaptureLogs launch option to protect sensitive information." +sidebar_position: 2 +slug: "/sdk/unity/v6/privacy/logs" +--- + +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + +Bugsee automatically captures all standard application console logs. If those logs may contain PII data, the feature +can be completely disabled. + +## Disabling log collection + +Console log collection can be disabled completely using **CaptureLogs** launch option. See [configuration](/sdk/unity/v6/configuration/) for more info. \ No newline at end of file diff --git a/docs/sdk/unity/v6/privacy/network.md b/docs/sdk/unity/v6/privacy/network.md new file mode 100644 index 00000000..e216ab7e --- /dev/null +++ b/docs/sdk/unity/v6/privacy/network.md @@ -0,0 +1,14 @@ +--- +title: "Privacy and Network traffic" +description: "Disable network traffic collection in the Bugsee Unity SDK using the MonitorNetwork launch option to prevent capturing sensitive data." +sidebar_position: 3 +slug: "/sdk/unity/v6/privacy/network" +--- + +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + +## Disabling network traffic collection + +Network traffic collection can be disabled completely using **MonitorNetwork** launch option. See [configuration](/sdk/unity/v6/configuration/) for more info. \ No newline at end of file diff --git a/docs/sdk/unity/v6/privacy/overview.md b/docs/sdk/unity/v6/privacy/overview.md new file mode 100644 index 00000000..d347598c --- /dev/null +++ b/docs/sdk/unity/v6/privacy/overview.md @@ -0,0 +1,21 @@ +--- +title: "Privacy overview" +description: "Overview of privacy considerations for Bugsee in Unity and links to controls for video, console logs, and network data collection." +sidebar_position: 0 +slug: "/sdk/unity/v6/privacy/overview" +--- + +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + +Bugsee SDK does not continuously stream any personal data. The reports are stored locally on the phone in a cyclical buffer. Reports are being sent only when triggered by a crash, through a bug reporting UI or from an application's code. +Data sent along with the reports may include video recording of screen, network and console logs. These may potentially contain personal data (usernames, passwords, emails, etc). + +It is the sole responsibility of the application developers to remove any such data from the reports before it leaves the users’ device. + +Bugsee provides the tools and means to either prevent some data from being collected or clean the data during the collection process: + +* [Video and Touch](/sdk/unity/v6/privacy/video/) +* [Console logs](/sdk/unity/v6/privacy/logs/) +* [Network logs](/sdk/unity/v6/privacy/network/) \ No newline at end of file diff --git a/docs/sdk/unity/privacy/video.md b/docs/sdk/unity/v6/privacy/video.md similarity index 75% rename from docs/sdk/unity/privacy/video.md rename to docs/sdk/unity/v6/privacy/video.md index e6fb4970..8fd4052b 100644 --- a/docs/sdk/unity/privacy/video.md +++ b/docs/sdk/unity/v6/privacy/video.md @@ -2,12 +2,16 @@ title: "Privacy and video" description: "Disable video recording or hide sensitive screen regions in Unity using secure rectangles and pause/resume APIs." sidebar_position: 1 -slug: "/sdk/unity/privacy/video" +slug: "/sdk/unity/v6/privacy/video" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## Disabling video -Video recording can be disabled completely using **VideoEnabled** launch option. See [configuration](/sdk/unity/configuration/) for more info. +Video recording can be disabled completely using **VideoEnabled** launch option. See [configuration](/sdk/unity/v6/configuration/) for more info. ## Protecting by coordinates diff --git a/docs/sdk/unity/v6/release-notes.md b/docs/sdk/unity/v6/release-notes.md new file mode 100644 index 00000000..6fd372a2 --- /dev/null +++ b/docs/sdk/unity/v6/release-notes.md @@ -0,0 +1,205 @@ +--- +title: "Release notes" +description: "Changelog for the Bugsee Unity SDK, listing all version updates, new features, bug fixes, and breaking changes." +sidebar_position: 10 +slug: "/sdk/unity/v6/release-notes" +--- + +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + +## 6.0.2 (March 20 2026) +- Feat: Updated native SDKs to their latest versions (Android: [6.0.2](/sdk/android/v6/release-notes/#602-march-11-2026), iOS: [6.1.2](/sdk/ios/v6/release-notes/#612-march-4-2026)) + +## 6.0.0 (March 6 2026) +- Feat: Updated native SDKs to their latest versions (Android: [6.0.0](/sdk/android/v6/release-notes/#600-december-9-2025), iOS: [6.1.2](/sdk/ios/v6/release-notes/#612-march-4-2026)) +- Breaking: \[iOS\] Minimum deployment target is iOS 12.0 +- Breaking: \[Android\] Bugsee SDK is now built with Android SDK version 35, hence requires compileSDKVersion 35 +- Breaking: \[Android\] AGP 8.6.0 or newer is now required + +## 5.3.9 (December 5 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.9.3](/sdk/android/v6/release-notes/#593-december-4-2025), iOS: [5.5.9](/sdk/ios/v6/release-notes/#559-november-17-2025)) + +## 5.3.8 (November 18 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.9.1](/sdk/android/v6/release-notes/#591-september-29-2025), iOS: [5.5.9](/sdk/ios/v6/release-notes/#559-november-17-2025)) + +## 5.3.7 (August 21 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.8.4](/sdk/android/v6/release-notes/#584-august-21-2025), iOS: [5.5.8](/sdk/ios/v6/release-notes/#558-august-21-2025)) + +## 5.3.6 (July 10 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.7.6](/sdk/android/v6/release-notes/#576-june-19-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) +- Fix: \[iOS\] In some configurations, build may fail with "Undefined symbols" error + +## 5.3.5 (June 8 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.7.5](/sdk/android/v6/release-notes/#575-june-8-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) +- Fix: \[Android\] In some configurations, application may crash on device with 16KB memory pages + +## 5.3.4 (May 6 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.7.3](/sdk/android/v6/release-notes/#573-may-5-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) + +## 5.3.3 (April 22 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.7.2](/sdk/android/v6/release-notes/#572-march-17-2025), iOS: [5.5.6](/sdk/ios/v6/release-notes/#556-march-25-2025)) + +## 5.3.2 (February 4 2025) +- Feat: Updated native SDKs to their latest versions (Android: [5.6.5](/sdk/android/v6/release-notes/#565-february-3-2025), iOS: [5.5.4](/sdk/ios/v6/release-notes/#554-january-27-2025)) +- Fix: \[Android\] Built-in UI shifts upwards in some scenarios on Android 15 (specifically, when hosting application itself is targeting Android 15, i.e. target SDK version is 35) + +## 5.3.1 (September 12 2024) +- Feat: Updated native SDKs to their latest versions (Android: 5.4.2, iOS: 5.3.2) +- Fix: \[Android\] Crash when bug is sent from built-in reporting UI after removing screenshot + +## 5.3.0 (September 9 2024) +- Feat: Updated native SDKs to their latest versions (Android: 5.4.1, iOS: 5.3.2) +- Feat: \[Android\] 16KB memory pages support + +## 5.2.0 (April 23 2024) +- Fix: \[Android\] In some cases, video before FG->BG->FG transitions may be absent +- Note: \[Android\] compileSdkVersion 34 and up is now required + +## 5.1.0 (April 11 2024) +- Feat: Updated native SDKs to their latest versions (Android: 4.2.4, iOS: 5.0.2) + +## 5.0.0 (January 10 2024) +- Feat: Updated native SDKs to their latest versions (Android: 4.2.1, iOS: 5.0.0) +- Breaking: \[iOS\] Bitcode is not present in the resulting binaries any more + +## 4.0.0 (October 2 2023) +- Feat: Updated native SDKs to their latest versions (Android: [4.0.1](/sdk/android/v6/release-notes/#401-september-30-2023), iOS: [4.0.1](/sdk/ios/v6/release-notes/#401-september-30-2023)) +- Breaking: Changes for the underlying SDKs: [Android](/sdk/android/v6/release-notes/#401-september-30-2023) and [iOS](/sdk/ios/v6/release-notes/#401-september-30-2023). + +## 3.3.0 (September 4 2023) +- Feat: Updated native SDKs to their latest versions (Android: 3.10.0, iOS: 3.8.0) +- Feat: Add new API to manually trigger view hierarchy capturing. Multiple view hierarchies support. + +## 3.2.0 (April 12 2023) +- Feature: Add Appearance API support \[[Learn more](/sdk/unity/v6/appearance/)\] + +## 3.1.0 (April 6 2023) +- Feature: Update native SDKs to the latest versions (Android: 3.6.0, iOS: 3.5.0) + +## 3.0.5 (March 3 2023) +- Feature: Update native SDKs to the latest versions (Android: 3.4.0, iOS: 3.3.3) + +## 3.0.4 (January 31 2023) +- Feature: Update native SDKs to the latest versions (Android: 3.4.0, iOS: 3.3.2) + +## 3.0.3 (November 25 2022) +- Feature: Update native SDKs to the latest versions (Android: 3.1.0, iOS: 3.3.2) +- Feature: On iOS, captured video is now brighter than before and should be aligned (in brightness) with actual picture on real device + +## 3.0.2 (November 25 2022) +- Feature: Update native SDKs to the latest versions (Android: 3.0.2, iOS: 3.2.1) + +## 3.0.1 (October 25 2022) +- Feature: Update native SDKs to the latest versions (Android: 3.0.0, iOS: 3.1.1) +- Fix: "OSLog.framework" is not mandatory now + +## 3.0.0 (September 2 2022) +- Feature: Update native SDKs to the latest versions (Android: 3.0.0, iOS: 3.0.0) +- Note: Please refer to the underlying SDKs release notes to get the detailed list of changes: [Android](/sdk/android/v6/release-notes/#300-august-19-2022) / [iOS](/sdk/ios/v6/release-notes/#300-september-1-2022) +- Note: On iOS, “OSLog.framework” needs to be added to your project with Bugsee in Xcode into “Frameworks, Libraries and Embedded Content” to fix this. This is required as now Bugsee is able to intercept OSLog-based logged data. + + +## 2.0.3 (August 16 2022) +- Feature: Updated native Android SDKs to their latest version. Improvements for Unity as a Library scenario + +## 2.0.2 (June 1 2022) +- Feature: Updated native Android SDKs to their latest version. Several race conditions are fixed + +## 2.0.1 (May 11 2022) +- Feature: Update native SDKs to the latest versions (Android: 2.1.2, iOS: 2.1.7) + +## 2.0.0 (Mar 23 2022) +- Feature: Update native SDKs to the latest versions (Android: 2.0.7, iOS: 2.1.1) +- Breaking change: Underlying Bugsee SDK was built with the iOS SDK 15.0 +- Breaking change: Underlying Bugsee Android SDK is now completely AndroidX-based + +## 1.8.0 (Dec 22 2021) +- Feature: Update native Android SDK to the latest version + +## 1.7.6 (Aug 9 2021) +- Feature: Update native Android SDK to the latest version + +## 1.7.5 (Dec 11 2020) +- Fix: Broken AddSecureRect API on Android +- Fix: Missing ClearAllAttributes API on Android +- Feature: Update native iOS SDK to the latest version + +## 1.7.4 (Aug 31 2020) +- Feature: Update native SDKs to the latest versions + +## 1.7.3 (Jun 15 2020) +- Fix: Build failure for Unity 2019+ + +## 1.7.2 (Jun 9 2020) +- Feature: Update native SDKs to their latest versions (Android: 1.18.0, iOS: 1.25.6) + +## 1.7.1 (April 7 2020) +- Fix: Update native SDK, to disable on-device symbolication by default to prevent application crash \[iOS\] + +## 1.7.0 (March 27 2020) +- Feature: Improve backward compatibility with older versions of Unity and .NET +- Feature: Update native SDKs to their latest versions (Android: 1.17.3, iOS: 1.25.3) + +## 1.6.2 (December 12 2019) +- Fix: Completely strip all the references to UIWebView \[iOS\] + +## 1.6.1 (December 8 2019) +- Fix: Do not report errors logged with Debug.LogError() +- Fix: Degrade syntax to make code backward compatible with previous Unity versions + +## 1.6.0 (Nov 28 2019) +- Feature: Native SDKs are updated to their latest versions +- Fix: inconsistency in handled/unhandled report state propagation for iOS/Android + +## 1.5.0 (Sep 27 2019) +- Fix: Make input fields in reporting UI always accessible \[iOS\] +- Fix: Do not skip WebView requests \[Android\] +- Feature: Add support for Android 10 \[Android\] +- Feature: Improve crashes and errors +- Native SDKs are updated to their latest versions + +## 1.4.3 (Sep 16 2019) +- Fix: Crashes in video rendering pipeline +- Native SDKs are updated to their latest versions + +## 1.4.2 (Jul 17 2019) +- Native SDKs are updated to their latest versions + +## 1.4.1 (Jun 27 2019) +- Native SDKs are updated to their latest versions + +## 1.4.0 (Jun 12 2019) +- Feature: lifecycle events are now supported +- Native SDKs are updated to their latest versions + +## 1.3.1 (Dec 12 2018) +- Maintenance update + +## 1.3.0 (Dec 11 2018) +- Update: Native SDKs are updated to their latest versions (contains fixes for known issues) + +## 1.2.10 (Oct 26 2018) +- Feature: attachments are supported now both on iOS and Android platforms [read more](/sdk/unity/v6/custom/) +- Fix: handle exceptions, thrown from worker threads, properly + +## 1.2.9 (Sep 24 2018) +- Update iOS to 1.18.15 to fix iOS12 crash when collecting extended crash data + +## 1.2.8 (Aug 28 2018) +- Feature: Add getDeviceID() method +- Bug fixes: various stability fixes +- Use iOS SDK 1.18.11 and Android SDK 1.12.9 + +## 1.2.7 (Apr 10 2018) +- Feature: Hide screen regions from video [read more](/sdk/unity/v6/privacy/video/) +- Feature: SDK can now be stopped and relaunched [read more](/sdk/unity/v6/configuration/) +- Feature: Video on Android is now disabled by default +- Updated native SDK: iOS 1.18.0 and Android SDK 1.11.8 +- Minor bug fixes + +## 1.2.6 (Mar 9 2018) +- Updated native SDK: iOS 1.17.20 +- Feature: VideoScale option [read more](/sdk/unity/v6/configuration/) +- Minor bug fixes \ No newline at end of file diff --git a/docs/sdk/unity/script-debugging.png b/docs/sdk/unity/v6/script-debugging.png similarity index 100% rename from docs/sdk/unity/script-debugging.png rename to docs/sdk/unity/v6/script-debugging.png diff --git a/docs/sdk/unity/slow-safe.png b/docs/sdk/unity/v6/slow-safe.png similarity index 100% rename from docs/sdk/unity/slow-safe.png rename to docs/sdk/unity/v6/slow-safe.png diff --git a/docs/sdk/unity/versions.md b/docs/sdk/unity/v6/versions.md similarity index 93% rename from docs/sdk/unity/versions.md rename to docs/sdk/unity/v6/versions.md index 64543682..af50024f 100644 --- a/docs/sdk/unity/versions.md +++ b/docs/sdk/unity/v6/versions.md @@ -2,9 +2,13 @@ title: "List of Bugsee Unity SDK releases" description: "Download links for all available Bugsee Unity SDK releases, including the latest stable version." sidebar_position: 11 -slug: "/sdk/unity/versions" +slug: "/sdk/unity/v6/versions" --- +:::caution[Previous version] +This page documents Bugsee Unity SDK **6.x**, the current stable release. The new **7.x** SDK is in beta: see [Migrating from 6.x to 7.x](/sdk/unity/migration) to evaluate it, or the [7.x overview](/sdk/unity/overview) to start a new integration. +::: + ## Latest stable [Latest stable (6.0.2)](https://download.bugsee.com/sdk/unity/BugseeUnity-stable.unitypackage?v=6.0.2) diff --git a/docs/sdk/unity/video-capture.mdx b/docs/sdk/unity/video-capture.mdx new file mode 100644 index 00000000..3d704c2e --- /dev/null +++ b/docs/sdk/unity/video-capture.mdx @@ -0,0 +1,12 @@ +--- +title: "Video capture" +description: "TODO(writer-C): Video capture for the Bugsee Unity SDK 7.x." +sidebar_position: 13 +slug: "/sdk/unity/video-capture" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docs/sdk/unity/view-hierarchy.mdx b/docs/sdk/unity/view-hierarchy.mdx new file mode 100644 index 00000000..ebada416 --- /dev/null +++ b/docs/sdk/unity/view-hierarchy.mdx @@ -0,0 +1,12 @@ +--- +title: "View hierarchy" +description: "TODO(writer-C): View hierarchy for the Bugsee Unity SDK 7.x." +sidebar_position: 12 +slug: "/sdk/unity/view-hierarchy" +--- + +:::warning[Beta] +This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). +::: + +TODO(writer-C) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 004d22e4..20c2e32a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -3,7 +3,7 @@ import type { Config } from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; // Wrapper SDKs share one layout: an installation page and a privacy section. -const wrapperSdks = ['cordova', 'dotnet', 'flutter', 'kmp', 'react_native', 'unity', 'xamarin']; +const wrapperSdks = ['cordova', 'dotnet', 'flutter', 'kmp', 'react_native', 'xamarin']; const config: Config = { title: 'Bugsee', @@ -123,6 +123,16 @@ const config: Config = { { from: '/sdk/react-native/v6/privacy', to: '/sdk/react_native/v6/privacy/overview/' }, { from: '/sdk/react_native/v6', to: '/sdk/react_native/v6/installation/' }, { from: '/sdk/react_native/v6/privacy', to: '/sdk/react_native/v6/privacy/overview/' }, + // Unity 7.x has an Overview page; 6.x moved under /sdk/unity/v6/. + { from: '/sdk/unity', to: '/sdk/unity/overview/' }, + { from: '/sdk/unity/privacy', to: '/sdk/unity/privacy/overview/' }, + { from: '/sdk/unity/v6', to: '/sdk/unity/v6/installation/' }, + { from: '/sdk/unity/v6/privacy', to: '/sdk/unity/v6/privacy/overview/' }, + // Unity 6.x routes with no 7.x page at the same address keep their 6.x content during the beta. + { from: '/sdk/unity/manual', to: '/sdk/unity/v6/manual/' }, + { from: '/sdk/unity/custom', to: '/sdk/unity/v6/custom/' }, + { from: '/sdk/unity/crashes', to: '/sdk/unity/v6/crashes/' }, + { from: '/sdk/unity/versions', to: '/sdk/unity/v6/versions/' }, ], // Android 7.x and iOS 7.x lived under /sdk//v7/ until they became the // default; every current Android and iOS page keeps answering at its old v7 address. diff --git a/sidebars.ts b/sidebars.ts index d154fb65..f6049149 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -966,36 +966,119 @@ const sidebars: SidebarsConfig = { label: "Unity SDK", collapsed: true, items: [ - { type: "doc", id: "sdk/unity/installation", label: "Installation" }, + { + type: "link", + label: "Stable release (6.x) docs", + href: "/sdk/unity/v6/installation", + }, + { type: "doc", id: "sdk/unity/overview", label: "Overview" }, + { + type: "category", + label: "Installation & build setup", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/installation", label: "Installation" }, + { type: "doc", id: "sdk/unity/build-setup/android", label: "Android build setup" }, + { type: "doc", id: "sdk/unity/build-setup/ios", label: "iOS build setup" }, + ], + }, { type: "doc", id: "sdk/unity/configuration", label: "Configuration" }, - { type: "doc", id: "sdk/unity/manual", label: "Manual invocation" }, - { type: "doc", id: "sdk/unity/custom", label: "Custom data" }, - { type: "doc", id: "sdk/unity/logs", label: "Console logs" }, + { type: "doc", id: "sdk/unity/lifecycle", label: "Lifecycle & status" }, + { + type: "category", + label: "Manual reporting", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/manual/bug-reporting", label: "Bug reporting" }, + { type: "doc", id: "sdk/unity/manual/crash-error-reporting", label: "Crash & error reporting" }, + ], + }, + { type: "doc", id: "sdk/unity/report-handler", label: "Report handler" }, + { + type: "category", + label: "Data capture", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/network", label: "Network events" }, + { type: "doc", id: "sdk/unity/logs", label: "Console logs" }, + { type: "doc", id: "sdk/unity/breadcrumbs", label: "Breadcrumbs" }, + { type: "doc", id: "sdk/unity/events-and-traces", label: "Custom events & traces" }, + { type: "doc", id: "sdk/unity/user-session-data", label: "User & session data" }, + { type: "doc", id: "sdk/unity/view-hierarchy", label: "View hierarchy" }, + { type: "doc", id: "sdk/unity/video-capture", label: "Video capture" }, + ], + }, { type: "category", label: "Privacy", collapsed: true, items: [ - { - type: "doc", - id: "sdk/unity/privacy/overview", - label: "Overview", - }, + { type: "doc", id: "sdk/unity/privacy/overview", label: "Overview" }, { type: "doc", id: "sdk/unity/privacy/video", label: "Video" }, - { - type: "doc", - id: "sdk/unity/privacy/logs", - label: "Console logs", - }, + { type: "doc", id: "sdk/unity/privacy/logs", label: "Console logs" }, { type: "doc", id: "sdk/unity/privacy/network", label: "Network" }, + { type: "doc", id: "sdk/unity/privacy/breadcrumbs", label: "Breadcrumbs" }, + { type: "doc", id: "sdk/unity/privacy/report", label: "Report" }, + { type: "doc", id: "sdk/unity/privacy/cleanup", label: "Cleanup" }, ], }, { type: "doc", id: "sdk/unity/feedback", label: "Feedback" }, + { type: "doc", id: "sdk/unity/notification-relay", label: "Notification relay" }, { type: "doc", id: "sdk/unity/appearance", label: "Appearance" }, - { type: "doc", id: "sdk/unity/crashes", label: "Crash reports" }, - { type: "doc", id: "sdk/unity/lifecycle", label: "Lifecycle events" }, + { type: "doc", id: "sdk/unity/performance", label: "Performance monitoring" }, + { + type: "category", + label: "Issue detection", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/issue-detection/overview", label: "Overview" }, + { type: "doc", id: "sdk/unity/issue-detection/crash-report-extension", label: "Crash Report Extension (iOS)" }, + ], + }, + { + type: "category", + label: "Symbolication", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/symbolication/overview", label: "Overview" }, + { type: "doc", id: "sdk/unity/symbolication/android", label: "Android" }, + { type: "doc", id: "sdk/unity/symbolication/ios", label: "iOS" }, + { type: "doc", id: "sdk/unity/symbolication/managed-code", label: "C# code" }, + { type: "doc", id: "sdk/unity/symbolication/environment-variables", label: "Environment variables" }, + ], + }, { type: "doc", id: "sdk/unity/release-notes", label: "Release notes" }, - { type: "doc", id: "sdk/unity/versions", label: "Versions" }, + { type: "doc", id: "sdk/unity/faq", label: "FAQ" }, + { type: "doc", id: "sdk/unity/migration", label: "Migrating from 6.x" }, + { + type: "category", + label: "Previous versions", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/v6/installation", label: "Installation" }, + { type: "doc", id: "sdk/unity/v6/configuration", label: "Configuration" }, + { type: "doc", id: "sdk/unity/v6/manual", label: "Manual invocation" }, + { type: "doc", id: "sdk/unity/v6/custom", label: "Custom data" }, + { type: "doc", id: "sdk/unity/v6/logs", label: "Console logs" }, + { + type: "category", + label: "Privacy", + collapsed: true, + items: [ + { type: "doc", id: "sdk/unity/v6/privacy/overview", label: "Overview" }, + { type: "doc", id: "sdk/unity/v6/privacy/video", label: "Video" }, + { type: "doc", id: "sdk/unity/v6/privacy/logs", label: "Console logs" }, + { type: "doc", id: "sdk/unity/v6/privacy/network", label: "Network" }, + ], + }, + { type: "doc", id: "sdk/unity/v6/feedback", label: "Feedback" }, + { type: "doc", id: "sdk/unity/v6/appearance", label: "Appearance" }, + { type: "doc", id: "sdk/unity/v6/crashes", label: "Crash reports" }, + { type: "doc", id: "sdk/unity/v6/lifecycle", label: "Lifecycle events" }, + { type: "doc", id: "sdk/unity/v6/release-notes", label: "Release notes" }, + { type: "doc", id: "sdk/unity/v6/versions", label: "Versions" }, + ], + }, ], }, { From f792b9f2cb4012b2b14e0fd88966ab2ccf7c3c45 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 19:30:09 +0500 Subject: [PATCH 02/13] docs(unity): write the 7.x documentation Replace the placeholder pages with the 7.x content: overview, installation, build setup, configuration, lifecycle, reporting, data capture, privacy, issue detection, symbolication, migration, release notes and FAQ. C# snippets use the BugseeSdk alias for the Bugsee.Bugsee facade. Add the new words to cspell.json. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I949a33641f9ac82232a456d52312088037a21757 --- cspell.json | 16 +- docs/sdk/unity/appearance.mdx | 120 +++++- docs/sdk/unity/breadcrumbs.mdx | 99 ++++- docs/sdk/unity/build-setup/android.mdx | 142 +++++- docs/sdk/unity/build-setup/ios.mdx | 99 ++++- docs/sdk/unity/configuration.mdx | 307 ++++++++++++- docs/sdk/unity/events-and-traces.mdx | 103 ++++- docs/sdk/unity/faq.md | 129 +++++- docs/sdk/unity/feedback.mdx | 104 ++++- docs/sdk/unity/installation.mdx | 153 ++++++- .../crash-report-extension.mdx | 138 +++++- docs/sdk/unity/issue-detection/overview.mdx | 130 +++++- docs/sdk/unity/lifecycle.mdx | 186 +++++++- docs/sdk/unity/logs.mdx | 123 +++++- docs/sdk/unity/manual/bug-reporting.mdx | 188 +++++++- .../unity/manual/crash-error-reporting.mdx | 241 ++++++++++- docs/sdk/unity/migration.mdx | 407 +++++++++++++++++- docs/sdk/unity/network.mdx | 197 ++++++++- docs/sdk/unity/notification-relay.md | 112 ++++- docs/sdk/unity/overview.mdx | 86 +++- docs/sdk/unity/performance.mdx | 114 ++++- docs/sdk/unity/privacy/breadcrumbs.md | 107 ++++- docs/sdk/unity/privacy/cleanup.md | 113 ++++- docs/sdk/unity/privacy/logs.md | 139 +++++- docs/sdk/unity/privacy/network.mdx | 130 +++++- docs/sdk/unity/privacy/overview.md | 84 +++- docs/sdk/unity/privacy/report.md | 141 +++++- docs/sdk/unity/privacy/video.mdx | 220 +++++++++- docs/sdk/unity/release-notes.md | 94 +++- docs/sdk/unity/report-handler.mdx | 190 +++++++- docs/sdk/unity/symbolication/android.mdx | 109 ++++- .../symbolication/environment-variables.md | 84 +++- docs/sdk/unity/symbolication/ios.mdx | 112 ++++- docs/sdk/unity/symbolication/managed-code.mdx | 106 ++++- docs/sdk/unity/symbolication/overview.mdx | 95 +++- docs/sdk/unity/user-session-data.mdx | 106 ++++- docs/sdk/unity/video-capture.mdx | 243 ++++++++++- docs/sdk/unity/view-hierarchy.mdx | 113 ++++- 38 files changed, 5305 insertions(+), 75 deletions(-) diff --git a/cspell.json b/cspell.json index e17ead58..e7fbe306 100644 --- a/cspell.json +++ b/cspell.json @@ -278,6 +278,20 @@ "RRGGBBAA", "Dalvik", "RSSI", - "Passpoint" + "Passpoint", + "elif", + "Mathf", + "screencapture", + "Readback", + "Dont", + "getenv", + "androidjni", + "jsonserialize", + "libunity", + "libmain", + "libmonobdwgc", + "libmono", + "dsymutil", + "readelf" ] } \ No newline at end of file diff --git a/docs/sdk/unity/appearance.mdx b/docs/sdk/unity/appearance.mdx index 7c3b62b3..d88b9668 100644 --- a/docs/sdk/unity/appearance.mdx +++ b/docs/sdk/unity/appearance.mdx @@ -1,6 +1,6 @@ --- title: "Appearance" -description: "TODO(writer-B): Appearance for the Bugsee Unity SDK 7.x." +description: "Change the colors and placeholder texts of the Bugsee report dialog and feedback chat in a Unity game with Bugsee.Appearance, and see which properties apply on Android and iOS." sidebar_position: 20 slug: "/sdk/unity/appearance" --- @@ -9,4 +9,120 @@ slug: "/sdk/unity/appearance" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +`Bugsee.Appearance` changes the look of the report dialog and the feedback chat, so that they match your game. It is one surface for both platforms: each property is a string key that you set with `SetColor` or `SetString`. + +In 6.x you wrote `Bugsee.Appearance.Report.BackgroundColor = BugseeColor.Red`. In 7.x you call `SetColor` with a key constant and a `Color32`. + +## Set colors and texts + +`Bugsee.Appearance` is an `IAppearance`: + +```csharp +IAppearance SetColor(string propertyName, Color32? color); +Color32? GetColor(string propertyName); +IAppearance SetString(string propertyName, string value); +string GetString(string propertyName); +IReadOnlyDictionary ToMap(); +``` + +The setters return the `IAppearance`, so you can chain them. Use the constants of `ReportAppearance` and `FeedbackAppearance` (namespace `Bugsee.Contracts.Appearance`) as keys, and do not type the strings by hand. + +```csharp +using Bugsee.Contracts.Appearance; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Appearance + .SetColor(ReportAppearance.BackgroundColor, new Color32(16, 24, 40, 255)) + .SetColor(ReportAppearance.TextColor, new Color32(255, 255, 255, 255)) + .SetColor(ReportAppearance.ActionBarColor, new Color32(29, 41, 57, 255)) + .SetString(ReportAppearance.SummaryPlaceholder, "What went wrong?"); +``` + +Set the colors in your startup code, before a report dialog can open. In the Unity Editor the setters do nothing. + +## Report colors and texts + +Keys of `ReportAppearance`. A key that has no iOS equivalent is skipped on iOS: it changes nothing, reads back `null`, and the SDK logs `Appearance property ... has no iOS equivalent; skipped.` once per key. + +| Key | Type | Android | iOS | What it changes | +| --- | --- | --- | --- | --- | +| `ActionBarColor` | color | Yes | Yes | The action bar (Android) or navigation bar (iOS) background. | +| `EditTextBackgroundColor` | color | Yes | Yes | The background of the input fields (Android) or table cells (iOS). | +| `VersionColor` | color | Yes | Yes | The Bugsee version label. | +| `TextColor` | color | Yes | Yes | The text color. | +| `HintColor` | color | Yes | Yes | The hint (placeholder) text of the input fields. | +| `BackgroundColor` | color | Yes | Yes | The dialog background. | +| `ActionBarTextColor` | color | Yes | No | The action bar button text. | +| `ActionBarButtonBackgroundClickedColor` | color | Yes | No | An action bar button while pressed. | +| `SeverityLabelActiveColor` | color | Yes | No | The selected severity label. | +| `SummaryPlaceholder` | string | Yes | Yes | The placeholder of the summary field. | +| `DescriptionPlaceholder` | string | Yes | Yes | The placeholder of the description field. | +| `LabelsPlaceholder` | string | Yes | Yes | The placeholder of the labels field. | +| `EmailPlaceholder` | string | Yes | Yes | The placeholder of the email field. | + +On iOS, the look of the report screen as a whole (`Light`, `Dusk`, `BasedOnStatusBar` or `System`, the default) is the launch option `ReportingUIStyle` on `IOSLaunchOptions`. See [Bug reporting](/sdk/unity/manual/bug-reporting#report-form-options). + +### Android notification title + +On Android, the title of the notification-bar trigger is the string key `Notification::Title`. The package has no constant for it, and iOS has no equivalent. The trigger itself is off by default: see [Bug reporting](/sdk/unity/manual/bug-reporting#built-in-report-triggers). + +```csharp +#if UNITY_ANDROID +BugseeSdk.Appearance.SetString("Notification::Title", "Report a problem"); +#endif +``` + +## Feedback colors + +Keys of `FeedbackAppearance`. They affect only a [feedback chat](/sdk/unity/feedback) that is present, and are independent of the add-on switch. + +| Key | Android | iOS | +| --- | --- | --- | +| `ActionBarColor` | Yes | Yes | +| `BackgroundColor` | Yes | Yes | +| `IncomingBubbleColor` | Yes | Yes | +| `OutgoingBubbleColor` | Yes | Yes | +| `IncomingTextColor` | Yes | Yes | +| `OutgoingTextColor` | Yes | Yes | +| `TitleTextColor` | Yes | Yes | +| `EmailSkipTextColor` | Yes | Yes | +| `EmailBackgroundColor` | Yes | Yes | +| `EmailContinueNotActiveColor` | Yes | Yes | +| `EmailContinueActiveColor` | Yes | Yes | +| `InputTextColor` | Yes | Yes | +| `ActionBarButtonBackgroundClickedColor` | Yes | No | +| `DateTextColor` | Yes | No | +| `EmailSkipBackgroundClickedColor` | Yes | No | +| `EmailContinueClickedColor` | Yes | No | +| `InputTextHintColor` | Yes | No | +| `BottomDelimiterColor` | Yes | No | +| `LoadingBarBackgroundColor` | Yes | No | +| `LoadingTextColor` | Yes | No | +| `ErrorTextColor` | Yes | No | +| `VersionChangedBackgroundColor` | Yes | No | +| `VersionChangedTextColor` | Yes | No | + +```csharp +BugseeSdk.Appearance + .SetColor(FeedbackAppearance.IncomingBubbleColor, new Color32(236, 239, 241, 255)) + .SetColor(FeedbackAppearance.OutgoingBubbleColor, new Color32(30, 136, 229, 255)) + .SetColor(FeedbackAppearance.OutgoingTextColor, new Color32(255, 255, 255, 255)); +``` + +## Read values back + +`GetColor` returns a `Color32?` and `GetString` a `string`. They return `null` when nothing applies: + +- On iOS, a key with no iOS equivalent returns `null`. Other color keys return the current value of the iOS theme, including its default. +- On Android, they return what the SDK holds for the key. + +`ToMap()` returns a read-only dictionary. On Android it holds what the SDK reports. On iOS it lists only the properties you set through the wrapper that the iOS theme applied. + +## Differences between platforms + +- On iOS, a `null` color is ignored: the theme colors cannot be reset to the default with `SetColor(key, null)`. On Android, `null` is passed to the SDK. +- On iOS, `SetString(key, null)` restores the SDK's default text. +- On iOS, a color key is applied by `SetColor` only, and a placeholder key by `SetString` only. The other call is ignored. + +For the native appearance APIs, see [Android appearance](/sdk/android/appearance) and [iOS appearance](/sdk/ios/appearance). diff --git a/docs/sdk/unity/breadcrumbs.mdx b/docs/sdk/unity/breadcrumbs.mdx index e0141844..6063a177 100644 --- a/docs/sdk/unity/breadcrumbs.mdx +++ b/docs/sdk/unity/breadcrumbs.mdx @@ -1,6 +1,6 @@ --- title: "Breadcrumbs" -description: "TODO(writer-C): Breadcrumbs for the Bugsee Unity SDK 7.x." +description: "Turn on breadcrumbs in the Bugsee Unity SDK 7.x, add your own with Bugsee.AddBreadcrumb, and filter them with SetBreadcrumbFilter." sidebar_position: 9 slug: "/sdk/unity/breadcrumbs" --- @@ -9,4 +9,99 @@ slug: "/sdk/unity/breadcrumbs" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Breadcrumbs are a compact trail of what happened before a report: the user opened a screen, a request failed, your code reached a checkpoint. The native SDKs collect system and user breadcrumbs for you once you turn them on, and you can add your own from C#. + +## Turn breadcrumbs on + +Breadcrumbs are **off by default** on both native SDKs. While they are off, `Bugsee.AddBreadcrumb` records nothing and the breadcrumb filter is never called. Set `CaptureBreadcrumbs = true` to use either. + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `CaptureBreadcrumbs` | Both | `bool` | `false` | Record breadcrumbs. | +| `CaptureBreadcrumbsExtras` | Both | `bool` | `false` | Attach extra data from system events to the automatic breadcrumbs that come from them. | + +The native SDKs decide which automatic breadcrumbs they record and how. See [Android breadcrumbs](/sdk/android/breadcrumbs) and [iOS breadcrumbs](/sdk/ios/breadcrumbs). + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions { CaptureBreadcrumbs = true }; +#elif UNITY_IOS +var options = new IOSLaunchOptions { CaptureBreadcrumbs = true }; +#endif + +BugseeSdk.Launch("", options); +``` + +In the Unity Editor, and on platforms other than Android and iOS, breadcrumb calls do nothing. + +## Add your own breadcrumbs + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.AddBreadcrumb("checkout", "Coupon applied", "info"); +``` + +`Bugsee.AddBreadcrumb(string category, string message, string levelName)` takes a category, a message and a level name. The level name is case-sensitive and must be one of these: + +| `levelName` | Notes | +| --- | --- | +| `"debug"` | | +| `"info"` | | +| `"warning"` | | +| `"error"` | | +| `"fatal"` | On iOS, `"fatal"` is recorded at the same level as `"error"`. | + +Any other value throws `ArgumentException`. + +On Android, the breadcrumb is created with the type `manual` and the current time. On iOS, a breadcrumb added before the launch completes is held and sent once it does. + +## Filter breadcrumbs + +`Bugsee.SetBreadcrumbFilter` installs a filter that sees each breadcrumb before it is recorded, both the ones you add and the automatic ones. Change the breadcrumb and return it to keep it, or return `null` to drop it. Pass `null` to remove the filter. + +```csharp +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.SetBreadcrumbFilter(crumb => +{ + // Drop one noisy category. + if (crumb.Category == "ui.scroll") return null; + + // Redact a value. + if (crumb.Message != null) crumb.Message = crumb.Message.Replace("secret", ""); + return crumb; +}); +``` + +`IBreadcrumb` has these properties, all settable: + +| Property | Type | +| --- | --- | +| `Timestamp` | `long` | +| `Category` | `string` | +| `Message` | `string` | +| `Type` | `string` | +| `Level` | `LogLevel?` | +| `Data` | `IDictionary` | + +Keep these rules in mind: + +- **The filter is called only while `CaptureBreadcrumbs` is `true`.** +- **Assign `Data` back.** On Android, `Data` returns a copy, so editing the returned dictionary in place does not change the breadcrumb. Assign the edited dictionary to `crumb.Data`. +- **Do not keep the breadcrumb.** It is valid only inside the callback. +- **A filter that throws drops the breadcrumb.** +- **The filter runs on the Unity main thread.** On Android the SDK calls it on its own threads and the package hands each call to the main thread, which processes its queue in `Update`. While the app is in the background Unity's loop is paused, so the call waits until the app resumes. +- **A filter that blocks forever blocks the main thread.** Keep it short. + +For privacy guidance, see [Privacy: breadcrumbs](/sdk/unity/privacy/breadcrumbs). + +## Related pages + +- [Console logs](/sdk/unity/logs) +- [Custom events & traces](/sdk/unity/events-and-traces) +- [Privacy: breadcrumbs](/sdk/unity/privacy/breadcrumbs) diff --git a/docs/sdk/unity/build-setup/android.mdx b/docs/sdk/unity/build-setup/android.mdx index 1bd61f41..891100bd 100644 --- a/docs/sdk/unity/build-setup/android.mdx +++ b/docs/sdk/unity/build-setup/android.mdx @@ -1,6 +1,6 @@ --- title: "Android build setup" -description: "TODO(writer-A): Android build setup for the Bugsee Unity SDK 7.x." +description: "What the Bugsee Unity SDK 7.x Editor package changes in your Android build: Gradle dependencies, the Gradle plugin, R8 rules, symbol settings and Export Project." sidebar_position: 2 slug: "/sdk/unity/build-setup/android" --- @@ -9,4 +9,142 @@ slug: "/sdk/unity/build-setup/android" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +You do not edit Gradle files to use Bugsee on Android. The package patches the Gradle project that Unity generates for each build. This page lists what it does, the Player Settings to check, what differs between Unity versions, and how an Export Project build behaves. + +## What the package does to an Android build + +The package runs when Unity generates the Gradle project. It never needs a custom template. + +| Step | What it does | +| --- | --- | +| Native SDK | Declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk`, both 7.6.0, in `unityLibrary/build.gradle`, between marker comments so a second run does not duplicate them. | +| Repositories | Adds `mavenCentral()` to the project repositories if Unity's layout lacks it. A project that sets `FAIL_ON_PROJECT_REPOS` is never given project-level repositories. | +| Manifest provider | Adds a content provider, `com.bugsee.unity.UnityWrapperProvider`, to the merged manifest. It registers the Bugsee extension modules that your app carries before `Application.onCreate`. | +| R8 keep rules | Appends rules to `unityLibrary/proguard-unity.txt` so a Minify build keeps the wrapper classes that C# reaches over JNI. See [Minify and R8](#minify-and-r8). | +| Gradle plugin | Applies the Bugsee Gradle plugin `4.1.1` when the generated project pins AGP 8.6 or later. See [Unity versions](#unity-versions). | +| Symbols | Warns when the symbol settings cannot give file and line information, and can switch to full symbols for one build. See [Native symbols](#native-symbols). | + +If the project already declares the Bugsee Android SDK itself, through the External Dependency Manager (EDM4U), a custom `mainTemplate.gradle` or a local AAR, that declaration is kept and nothing is added next to it. The build log warns when its version differs from the one this package pins, or when the NDK artifact is missing. + +If the package cannot add the dependencies, the build fails with a `[Bugsee]` message. The app would build but Bugsee could not start, so the package fails loudly. + +## Player Settings checklist + +1. **Scripting Backend: IL2CPP.** This is the supported configuration for fully symbolicated native crashes. With Mono, frames inside the Mono runtime stay unsymbolicated, and the build logs a warning once. See [Managed code symbolication](/sdk/unity/symbolication/managed-code) for how Mono and IL2CPP differ. +2. **Create symbols.zip** (native debug symbols) enabled, with a level that carries the information you need. See [Native symbols](#native-symbols). +3. **Minify** can be on for Release and Debug builds. No extra setup is needed. See [Minify and R8](#minify-and-r8). +4. **Custom Gradle templates are not needed.** If you have your own, see [Gradle file layouts](#gradle-file-layouts). +5. **Video mode** is an Android launch option. See [Video capture](/sdk/unity/video-capture) before you change it. + +## Unity versions + +The Bugsee Gradle plugin needs AGP 8.6 and Gradle 8.7 or later. The package reads the AGP version that the generated root build file pins, and decides from it. + +| Generated AGP | Typical Unity version | What the package applies | +| --- | --- | --- | +| 8.6 or later | Unity 6, for example 6000.0.84f1 with AGP 9.0.0 | The Gradle plugin `4.1.1` and `bugsee { ndk { enabled = true } }` in the launcher module. | +| 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.2, Gradle 7.5.1 in the releases checked) | No plugin. The package adds a small Gradle task to the launcher that writes the build id asset, and the Editor uploads symbols itself. | +| Older than 7.4, or unreadable | The first Unity 2021.3 patch releases ship AGP 4.0.1 | No plugin and no build id task. A warning explains why. | + +On the older AGPs, the plugin functions that the package recovers are these: + +| Plugin function | On AGP 8.6 and later | On older AGPs | +| --- | --- | --- | +| Declare `bugsee-android` and `bugsee-android-ndk` | The package. | The package. | +| `assets/bugsee_build_id.properties`, the id of the R8 mapping | The plugin. | The package's Gradle task, on AGP 7.4.x and 8.0 to 8.5. With R8 off, no asset is written and the SDK derives its own id. | +| Mapping and native symbol upload | The Editor uploads after Gradle runs. | The Editor uploads after Gradle runs. | +| Bytecode instrumentation of Java and Kotlin code, build info and size analysis | The plugin. | Not available. The plugin needs AGP 8.6 or later. | + +Because a Unity app's own Java and Kotlin code is a launcher stub, little is lost. A Java or Kotlin library of yours that uses OkHttp or `HttpEngine` is not captured automatically on these Unity versions. + +`BUGSEE_NO_GRADLE_BUILD_ID` (any value) stops the package from adding the build id task and removes an earlier one. The SDK then derives its own build id. + +## Gradle file layouts + +Unity 2021.3, 2022.3 and 6 generate Groovy files (`*.gradle`). A project that converts them to the Kotlin DSL in its own `IPostGenerateGradleAndroidProject` step gets patched in Kotlin syntax. Give that step a `callbackOrder` below 10 so the package patches the converted files. + +| File shape | Result | +| --- | --- | +| Unity's Groovy layout, also with custom base, launcher, settings or main templates that keep Unity's lines | The root file declares the plugin with `apply false`, and the launcher applies it after the AGP line. | +| Root declares AGP with a `buildscript { dependencies { classpath } }` block and no `plugins { }` block | The plugin becomes a root `classpath` entry. The package adds `mavenCentral()` to the buildscript repositories if missing. | +| Kotlin DSL files, with or without `gradle/libs.versions.toml` aliases | The launcher's `plugins { }` block gets the plugin id after the AGP entry. The AGP version is read through `gradle/libs.versions.toml` in its default location. | +| A plugin you declared yourself (`id`, `apply plugin`, `classpath`) | Kept as written. Nothing is added next to it. | +| A launcher that applies the Android plugin with `apply` and no `plugins { }` block, or a one-line `plugins { }` | Left alone. A warning on every build names the lines to add. | + +If the settings file's `pluginManagement` repositories do not serve the plugin (not the Gradle plugin portal, not Maven Central, and no mirror whose filter includes `com.bugsee`), the package appends `mavenCentral()` after the existing entries and warns. Set the environment variable `BUGSEE_NO_GRADLE_REPO_INJECTION` (any value) to stop the package from changing project repositories. The plugin is then not applied, and the warning lists the lines to add. + +Two menu items help with templates: + +- **Bugsee > Android > Remove Legacy Gradle Templates** checks `Assets/Plugins/Android` for Gradle templates that earlier package versions wrote, and backs up and removes the unedited ones. A template of your own that pins another AGP major than your Unity's default is left unchanged, and the build warns about it. +- **Bugsee > Android > Force Gradle Plugin On Older AGP (unsupported)** applies the plugin whatever AGP the package detects. A plugin that needs AGP 8.6 will likely fail Gradle configuration on an older AGP. + +## Minify and R8 + +Minify (R8) can be on for Release and Debug builds. Unity does not read keep rules from a package, so on every Android build the package appends its rules to the generated `unityLibrary/proguard-unity.txt`. The rules keep the wrapper classes that C# looks up by name over JNI (`UnityWrapper`, `UnityManagedException` and the SDK interfaces that C# implements). They sit between `# bugsee:proguard begin` and `# bugsee:proguard end` markers and are replaced, not duplicated, on the next build. They also silence R8's "Missing class" errors for `android.telephony.satellite.SatelliteManager`, `android.telephony.satellite.SatelliteStateChangeListener` and `android.app.ApplicationStartInfo`. + +If a custom main Gradle template drops `consumerProguardFiles 'proguard-unity.txt'`, the rules do not reach R8 and a Minify build cannot launch the SDK. The build warns when it sees that. Add the line back to the library's `defaultConfig`. If you add your own JNI code, keep its classes in your Custom Proguard File. + +## Native symbols + +Unity 6 defaults the native debug symbol level to `None`, and `SymbolTable` holds symbol tables only. File and line information for native frames needs `Full` (called `Debugging` on Unity 2021.3) with a zip format. + +When a Bugsee app token is set in the environment and the settings do not give that, the build warns. Two ways to build with full symbols: + +- Choose **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload**. It is a toggle that is saved per machine. +- Set `BUGSEE_ANDROID_FULL_SYMBOLS=1` in the environment. + +Either one builds with the full level and a symbols zip, and restores your settings after the build. The state is kept in `Library/Bugsee`, so an interrupted build is still restored. + +How the Editor uploads symbols, the mapping and the IL2CPP line map is described in [Android symbolication](/sdk/unity/symbolication/android) and [Environment variables](/sdk/unity/symbolication/environment-variables). An upload never fails the Unity build: a missing token, CLI or map is a warning. + +## Export Project + +An Export Project build leaves Gradle for later, in Android Studio or with `gradlew` on a CI machine. At export time there is no R8 mapping, no `symbols.zip` and no native library for the Editor to upload, so the Editor uploads nothing. + +On AGP 8.6 and later, the package applies the Gradle plugin to the exported launcher and writes a `bugsee { }` block that reads the token when Gradle runs. No token is written to any file of the exported project. + +```groovy +bugsee { + if (System.getenv('BUGSEE_NO_SYMBOL_UPLOAD') == null && System.getenv('BUGSEE_APP_TOKEN')) { + appToken(System.getenv('BUGSEE_APP_TOKEN')) + } + if (System.getenv('BUGSEE_ENDPOINT')) { + endpoint = System.getenv('BUGSEE_ENDPOINT') + } + if (System.getenv('BUGSEE_CLI_PATH') && new File(System.getenv('BUGSEE_CLI_PATH')).isFile()) { + cliPath = System.getenv('BUGSEE_CLI_PATH') + } + ndk { + enabled = true + useMergedNativeLibs = false + } +} +``` + +The Kotlin DSL form is the same in Kotlin syntax. + +To upload from the exported project, build it with `BUGSEE_APP_TOKEN` in the environment of the Gradle process: + +```bash +BUGSEE_APP_TOKEN= ./gradlew assembleRelease +``` + +Android Studio uses the environment it was started with. Start it from a terminal that has the variable, or run Gradle from a terminal. Without the variable, or with `BUGSEE_NO_SYMBOL_UPLOAD` set (any value), the plugin skips the upload and the build still succeeds. + +Limits of an exported project: + +- The export writes no IL2CPP line map. Get it as described in [Managed code symbolication](/sdk/unity/symbolication/managed-code) and upload it with `bugsee-cli debug-files upload --type il2cpp-linemap`. +- On AGP below 8.6 there is no plugin, so the exported project's Gradle build uploads nothing. Use `bugsee-cli` on its output. +- If the launcher already has a `bugsee { }` block of your own, the package does not edit it, and the Editor warns at export with the lines to add. Without them the plugin skips. +- Builds that the Editor runs itself keep the token-less block, because the Editor's own upload after Gradle sends the mapping and symbols. + +:::warning[The token can appear in logs] +Gradle with `--info` or `--debug` prints the `bugsee-cli` command line, which contains `--app-token `, in the console and in the daemon log under `~/.gradle/daemon`. Do not run CI builds of an exported project with `--info` or `--debug`, or mask the value. +::: + +## Related pages + +- [Installation](/sdk/unity/installation): add the package. +- [Android symbolication](/sdk/unity/symbolication/android): symbols, mappings and what resolves. +- [Gradle plugin for Android](/sdk/android/gradle-plugin): what the plugin does in a native app. +- [Configuration](/sdk/unity/configuration): the launch options, including the Android video and exit options. diff --git a/docs/sdk/unity/build-setup/ios.mdx b/docs/sdk/unity/build-setup/ios.mdx index f4e5783d..41151577 100644 --- a/docs/sdk/unity/build-setup/ios.mdx +++ b/docs/sdk/unity/build-setup/ios.mdx @@ -1,6 +1,6 @@ --- title: "iOS build setup" -description: "TODO(writer-A): iOS build setup for the Bugsee Unity SDK 7.x." +description: "What the Bugsee Unity SDK 7.x Editor package changes in your exported Xcode project: the Swift package, the symbol upload Run Script, the crash extension and early launch." sidebar_position: 3 slug: "/sdk/unity/build-setup/ios" --- @@ -9,4 +9,99 @@ slug: "/sdk/unity/build-setup/ios" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +You do not add the iOS SDK to Xcode yourself. When you build for iOS, the package edits the exported Xcode project. This page lists what it changes and the switches that control it. + +## What the package does to an iOS export + +| Step | What it does | +| --- | --- | +| Swift package | Adds the Bugsee Swift package, `https://github.com/bugsee/spm.git` at version 7.1.0, and links its `Bugsee` product to the app target and to `UnityFramework`. Bugsee 7.x on iOS is Swift Package Manager only. | +| Deployment target | Raises `IPHONEOS_DEPLOYMENT_TARGET` to 15.0 on both targets when it is lower. | +| Debug symbols | Sets `DEBUG_INFORMATION_FORMAT` to `dwarf-with-dsym` for every configuration on both targets, so Debug builds also produce a dSYM to upload. | +| Run Script | Adds a build phase named **Bugsee Upload Symbols** that uploads dSYMs and the IL2CPP line map. See [Symbol upload Run Script](#symbol-upload-run-script). | +| Crash extension | Can add a `BugseeCrashReport` extension target on Xcode 27 and later. See [Crash Report Extension](#crash-report-extension). | +| Early launch | Can start the SDK natively at app launch. Off by default. See [Early launch](#early-launch). | + +The Swift package link is added once. An Append export into an existing Xcode project drops the link an earlier export added and writes it again, so you never end up with the package twice. The step also removes a build phase that Unity's own Append export lists twice, which would otherwise make `xcodebuild archive` fail with "Unexpected duplicate tasks". + +If the Swift package link cannot be written, the export fails with a `[Bugsee]` message instead of producing a project with no SDK. + +### Keep Debug on plain DWARF + +Forcing a dSYM on Debug configurations makes Debug builds slower for a large `UnityFramework`. To keep Unity's setting, do one of the following before you export: + +- Set the environment variable `BUGSEE_NO_DSYM_FORCE` (any value). Use this on CI. +- Turn on **Bugsee > iOS > Keep Xcode Debug Info Format (skip dSYM force)**. It is a toggle saved per machine, for an Editor started from the Hub or the Finder, which does not see your shell variables. + +Debug builds then have no dSYM to upload. + +## Symbol upload Run Script + +The export writes `BugseeScripts/upload-symbols.sh` next to the Xcode project and adds a **Bugsee Upload Symbols** Run Script phase to the app target that runs it. The phase uploads the app's and `UnityFramework`'s dSYMs and the IL2CPP line map, so crash frames resolve to your code. + +- **Token.** The script reads `BUGSEE_APP_TOKEN` when Xcode builds, from the environment or from a user-defined build setting. The token is never written into the project. Without it, the build prints a warning and uploads nothing. +- **Which builds.** The script runs for every Xcode configuration, Debug included, and on every build that has the token in its environment, not only archives. Set `BUGSEE_SKIP_UPLOAD_ON_DEBUG=1` to skip the Debug configuration, for example for local runs from Xcode. +- **Opt out.** `BUGSEE_NO_SYMBOL_UPLOAD` set in the environment of the Xcode build makes the script print that it skips the upload and upload nothing. +- **The CLI.** The script never downloads `bugsee-cli`. At export, on macOS with `BUGSEE_APP_TOKEN` set, the Editor looks for an installed CLI and writes its absolute path into the script. That path contains your home directory. If you commit the exported project, set `BUGSEE_NO_SYMBOL_UPLOAD` or unset `BUGSEE_APP_TOKEN` before you export, and nothing is baked. When no CLI is found, the script prints a warning that lists the paths it tried, and the build continues. +- **Sandbox.** The export sets `ENABLE_USER_SCRIPT_SANDBOXING = NO` on the `Unity-iPhone` target. With the sandbox on, Xcode refuses to start the script and nothing is uploaded. A project-wide or command-line `ENABLE_USER_SCRIPT_SANDBOXING=YES` still wins over the target's setting. +- **Failures.** A failing upload never fails the build. + +For what is uploaded and how to read the results, see [iOS symbolication](/sdk/unity/symbolication/ios) and [Environment variables](/sdk/unity/symbolication/environment-variables). + +## Crash Report Extension + +On iOS 27 and later, the iOS SDK can report exits that no in-process handler survives, such as out-of-memory kills, through a Crash Report Extension. The export can add that extension to your Xcode project as an ExtensionKit target named `BugseeCrashReport`, with the bundle id `.BugseeCrashReport`, an iOS 27.0 deployment target on the extension only, and an App Group shared with the app. + +The target is added only when the build machine has **Xcode 27 or later**. The setting decides the rest: + +| Setting | Behavior | +| --- | --- | +| **Auto** (default) | Adds the extension in an interactive Editor build when Player Settings has **Automatically Sign** on and a team id. Never in batch mode. | +| **On** | Adds it for any signing setup. Register the App Group on both App IDs yourself. | +| **Off** | Never adds it. | + +Set it from the menu **Bugsee > iOS > Crash Report Extension** (Auto, On or Off), which is saved per machine, or from the environment with `BUGSEE_IOS_CRASH_EXTENSION=auto`, `1` or `0`, which wins over the menu. The App Group defaults to `group.`. Override it with `BUGSEE_IOS_APP_GROUP=group.`. + +The extension's `CFBundleShortVersionString` and `CFBundleVersion` are set to the app's at export. If you change the app's version after export, change the extension's too. + +If you do not want the target, set the mode to Off. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) for what it reports, its limits, the signing requirements and the Append export behavior. + +## Early launch + +By default, Bugsee starts when your C# code calls `Bugsee.Launch`. Early launch starts the iOS SDK natively, after Unity's own `didFinishLaunching` returns and before the first scene. The first `Bugsee.Launch` then adopts the running session instead of starting a second one. It is off by default. + +:::warning[Consent and privacy] +With early launch on, the iOS SDK starts before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for user consent. The token is embedded in the app bundle's `Info.plist`. +::: + +Turn it on for the export in one of two ways. The environment variables win over the menu. + +| Variable | Meaning | +| --- | --- | +| `BUGSEE_IOS_EARLY_LAUNCH` | `1`, `on`, `true` or `yes` turns it on. Anything else leaves it off. | +| `BUGSEE_IOS_APP_TOKEN` | The iOS app token. Required: with it missing, early launch is not added and the build logs a warning. | +| `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS` | Optional JSON object of launch options, with the same keys as the C# options, for example `{"com.bugsee.option.detect.hang":true}`. | + +Or choose **Bugsee > iOS > Early Launch...**, a window with an enable toggle, the iOS app token and the options JSON. It is saved per machine. + +The export writes these values into the app's `Info.plist`. It writes `$` as `$` in the options, because Xcode would otherwise collapse `$$` in plist strings. A token that is not a single printable line of at most 256 characters means early launch is not added, with a warning in the build log. Options that are not a JSON object, or are longer than 16,384 characters, are ignored with a warning, and the SDK defaults are used. Nothing is written when early launch is off, and an Append export removes an earlier export's entry. + +How the first `Bugsee.Launch` behaves with early launch: + +- **No second launch.** It adopts the running session. The `Launching` and `Launched` lifecycle events arrive once. +- **Options are launch-only.** Options passed to `Bugsee.Launch` that differ from the early options are logged as a warning and not applied. Put them in the early options, or call `Stop` and launch again. +- **The build-time token wins.** A different token in `Bugsee.Launch` is logged, and the session keeps the build-time token. +- **After `Stop`**, `Launch` works as without early launch. +- **Not on the Simulator.** Early launch does nothing there. + +:::caution[Known issue] +After an iOS launch that died before the app became active, the next launch may block the main thread for up to about 8 seconds while the crash report is uploaded. The fix is in the native iOS SDK and is not released yet. Unity launches that start at `Bugsee.Launch` do not hit it, because the SDK starts while the app is active. Early launch starts the SDK at app launch, before the app is active, so an app that uses it can hit this. +::: + +## Related pages + +- [Installation](/sdk/unity/installation): add the package. +- [iOS symbolication](/sdk/unity/symbolication/ios): dSYMs, the line map and the upload. +- [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension): the iOS 27 extension in detail. +- [Lifecycle & status](/sdk/unity/lifecycle): launch, stop and lifecycle events. +- [iOS installation](/sdk/ios/installation): the native SDK's own installation page. diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx index c3d8d3e6..3cd74f97 100644 --- a/docs/sdk/unity/configuration.mdx +++ b/docs/sdk/unity/configuration.mdx @@ -1,6 +1,6 @@ --- title: "Configuration" -description: "TODO(writer-A): Configuration for the Bugsee Unity SDK 7.x." +description: "Set the Bugsee Unity SDK 7.x launch options per platform with typed launch options, OptionsBuilder or raw keys, and read the defaults for every option." sidebar_position: 4 slug: "/sdk/unity/configuration" --- @@ -9,4 +9,307 @@ slug: "/sdk/unity/configuration" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +You configure the SDK with launch options, the second argument of `Bugsee.Launch`. The options are the same `com.bugsee.option.*` keys the native [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration) SDKs read. This page lists every option the Unity package exposes as a C# property, with its type, default and key. + +:::warning[Defaults changed in 7.x] +Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. Both were on in earlier versions. To keep them, set `ReportingTriggerByShake = true` (both platforms) and `ReportingTriggerByNotification = true` (Android). +::: + +## How launch options work + +`Bugsee.Launch(string appToken, Dictionary options = null)` takes one options argument. You build it in one of three ways, and each converts to the dictionary implicitly: + +| Type | Use it for | +| --- | --- | +| `AndroidLaunchOptions` | Typed properties for Android: the shared options plus the Android-only ones. | +| `IOSLaunchOptions` | Typed properties for iOS: the shared options plus the iOS-only ones. | +| `OptionsBuilder` | A fluent builder over raw keys, for shared code or keys that have no property. | + +All three live in the `Bugsee.Contracts.Options` namespace. + +- **Unset options keep the SDK default.** The typed properties are write-only. An option you do not set is not sent, and the native SDK applies its own default. +- **An option the other platform does not know is dropped.** Setting an Android-only option on an iOS launch has no effect, and the reverse. The package removes these keys before the native SDK sees them. +- **`SetCustomOption(key, value)`** sets any key on a typed options object. `Clear()` removes everything you set. `ToDictionary()` returns the current map. +- **`Options` holds the key constants**, for example `Options.CaptureNetwork`. Each key is `com.bugsee.option.` plus the suffix shown in the tables below. + +:::note[Name clash] +The package namespace and its static class are both named `Bugsee`. In code outside the `Bugsee` namespace, `Bugsee.Launch(...)` does not compile, because `Bugsee` resolves to the namespace. Add `using BugseeSdk = Bugsee.Bugsee;` and call `BugseeSdk.Launch(...)`, or write `Bugsee.Bugsee.Launch(...)`. The examples on this site use the alias. +::: + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeSetup +{ + public static void Start() + { +#if UNITY_ANDROID + var options = new AndroidLaunchOptions + { + ReportingTriggerByShake = true, + ReportingTriggerByNotification = true, + DetectAndReportHang = true, + CaptureVideoMode = VideoMode.V2, + }; + BugseeSdk.Launch("", options); +#elif UNITY_IOS + var options = new IOSLaunchOptions + { + ReportingTriggerByShake = true, + DetectAndReportHang = true, + CrashHandlerType = CrashHandlerType.MachAndBSD, + }; + BugseeSdk.Launch("", options); +#endif + } +} +``` + +The `OptionsBuilder` form works on both platforms from one code path. Its `Set` overloads take a key and a `bool`, `int`, `float` or `string`, and it has helpers for enum options (`SetVideoMode`, `SetVideoQuality`, `SetFrameRate`, `SetLogLevel`, `SetDefaultCrashPriority`, `SetDefaultErrorPriority`, `SetDefaultBugPriority`, `SetCrashHandlerType`, `SetCrashSignals`, `SetReportingUIStyle`) and for common switches (`Duration`, `CaptureVideo`, `CaptureNetwork`, `CaptureLogs`, `DetectAndReportCrash`, `CaptureManagedExceptions`, `CaptureUnobservedTaskExceptions`, `DetectAndReportHang`, `DetectAndReportExitNotResponding`, `DetectAndReportExitLowMemory`). + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeBuilderSetup +{ + public static void Start(string appToken) + { + var builder = new OptionsBuilder() + .CaptureNetwork(false) + .SetLogLevel(LogLevel.Warning) + .Set(Options.ReportingTriggerByShake, true); + + BugseeSdk.Launch(appToken, builder); + } +} +``` + +Read what the SDK runs with after launch: `Bugsee.GetLaunchOptions()` returns the effective options (the defaults with yours merged over them), and `Bugsee.GetHostLaunchOptions()` returns only the options your app passed. `GetLaunchOptions()` is `null` while the SDK is not launched. The keys are the native SDK's own and differ between Android and iOS. On iOS an option you set to its default value can be missing from `GetHostLaunchOptions()`, because the iOS SDK drops host options equal to their default. + +A [`Relaunch`](/sdk/unity/lifecycle) replaces the whole option set rather than merging into it. Pass the full set again. + +## Shared options + +Every property below is available on both `AndroidLaunchOptions` and `IOSLaunchOptions`. The Platform column says where the native SDK reads it. + +Defaults come from the option manifests of the pinned native SDKs (Android SDK 7.6.0, iOS SDK 7.1.0), except the three Unity-specific options, which the package defines. For what each option does in depth, see the native configuration pages: [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration). + +### Session and storage + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `Duration` | Both | `int` | `60` | `config.duration` | Length in seconds of the rolling capture buffer. Older data rolls off. | +| `WifiOnlyUpload` | Both | `bool` | `false` | `config.wifi-only-upload` | Defer report uploads until the device is on Wi-Fi. | +| `MaxDataSize` | Both | `int` | `150` | `config.max-data-size` | Disk space in MB that reports waiting to be sent may use. A value below 10 is raised to 10. Over the limit, whole pending reports are deleted, oldest first, never the newest crash. | +| `MaxPendingReports` | Both | `int` | `30` | `config.max-pending-reports` | Number of reports that may wait to be sent. A value below 1 is raised to 1. Eviction follows the same order as `MaxDataSize`. | +| `MaxPendingReportAge` | Both | `int` | `30` | `config.max-pending-report-age` | Age in days after which a waiting report is deleted. `0` or a negative value turns aging off. | +| `NotifyFlushDelay` | Both | `int` | `0` | `config.notify-flush-delay` | Milliseconds the [notification relay](/sdk/unity/notification-relay) waits before it drains its queue. `0` posts as soon as an item is on disk. | +| `ReportHandlerCallbackTimeout` | Android | `int` | `30` | `config.report-handler-callback-timeout` | Seconds to wait for a report handler to finish before the SDK continues without it. The iOS launch drops this option. | + +### Issue detection + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `DetectAndReportCrash` | Both | `bool` | `true` | `detect.crash` | Report native crashes (process death). | +| `CrashSignals` | Both | `CrashSignals` | `CrashSignals.Default` | `capture.crash-signals` | The fatal signals the native crash reporter intercepts. See [CrashSignals](#crashsignals). | +| `DetectAndReportEarlyCrash` | Both | `bool` | `true` | `detect.early-crash` | Protect against startup crash loops: reports from a launch that ended before the app became active are sent synchronously at the next launch, which blocks the main thread while they upload. | +| `DetectAndReportHang` | Both | `bool` | `false` | `detect.hang` | Report a main-thread hang. | +| `DetectAndReportHangFairLevel` | Both | `int` | `3000` | `detect.hang.level.fair` | Milliseconds of main-thread block that count as a Fair hang. | +| `DetectAndReportHangMediumLevel` | Both | `int` | `5000` | `detect.hang.level.medium` | Milliseconds of main-thread block that count as a Medium hang. | +| `DetectAndReportHangSevereLevel` | Both | `int` | `10000` | `detect.hang.level.severe` | Milliseconds of main-thread block that count as a Severe hang. | +| `DetectAndReportHttpErrors` | Both | `bool` | `false` | `detect.http-errors` | Report HTTP 5xx responses as errors. | +| `DetectAndReportAnomaly` | Both | `bool` | `false` | `detect.anomaly` | Report statistical performance anomalies. | +| `DetectFrustration` | Both | `bool` | `false` | `detect.frustration` | Report user-frustration patterns such as rage taps. | + +### Unity managed exceptions + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `CaptureManagedExceptions` | Both | `bool` | `true` | `unity.capture-managed-exceptions` | Report managed Unity exceptions. Independent of `DetectAndReportCrash`. | +| `CaptureUnobservedTaskExceptions` | Both | `bool` | `true` | `unity.capture-unobserved-task-exceptions` | Report `TaskScheduler.UnobservedTaskException` as a handled error. Needs `CaptureManagedExceptions`. Unity raises the event only after the faulted `Task` is garbage-collected, so the report arrives late. | +| `TreatUnityLogExceptionsAsFatal` | Both | `bool` | `false` | `unity.treat-log-exceptions-as-fatal` | Report an exception that Unity routes through its log (`LogType.Exception`) as unhandled instead of handled. | + +### Capture + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `CaptureLogs` | Both | `bool` | `true` | `capture.logs` | Capture console logs. See [Console logs](/sdk/unity/logs). | +| `CaptureLogsLevel` | Both | `LogLevel` | `Verbose` | `capture.logs.level` | Lowest `LogLevel` to capture. | +| `CaptureScreenshot` | Both | `bool` | `true` | `capture.screenshot` | Take a screenshot when a report is created. | +| `CaptureScreenshotScale` | Both | `float` | `1` | `capture.screenshot.scale` | Scale applied to screenshots, from 0.05 to 1.0 on Android. `1.0` leaves them unscaled. | +| `CaptureNetwork` | Both | `bool` | `true` | `capture.network` | Capture network events. See [Network events](/sdk/unity/network). | +| `CaptureNetworkBodySizeLimit` | Both | `int` | `20480` | `capture.network.body-size-limit` | Largest request or response body to keep, in bytes. | +| `CaptureNetworkBodyWithoutType` | Both | `bool` | `false` | `capture.network.body-without-type` | Also keep bodies that declare no content type. | +| `CaptureNetworkUseDefaultSanitizer` | Both | `bool` | `true` | `capture.network.default-sanitizer` | Redact known sensitive keys from captured network events when no network filter is set. | +| `CaptureViewHierarchy` | Both | `bool` | `true` | `capture.view-hierarchy` | Capture the view hierarchy for reports. See [View hierarchy](/sdk/unity/view-hierarchy). | +| `CaptureBreadcrumbs` | Both | `bool` | `false` | `capture.breadcrumbs` | Record breadcrumbs. While it is off, `Bugsee.AddBreadcrumb` records nothing and the breadcrumb filter is not called. | +| `CaptureBreadcrumbsExtras` | Both | `bool` | `false` | `capture.breadcrumbs.extras` | Attach extra data to breadcrumbs. | +| `CaptureVideo` | Both | `bool` | `true` | `capture.video` | Record screen video. See [Video capture](/sdk/unity/video-capture). | +| `CaptureVideoQuality` | Both | `VideoQuality` | `Default` | `capture.video.quality` | Quality of the encoded video. | +| `CaptureVideoFrameRate` | Both | `FrameRate` | `High` | `capture.video.frame-rate` | How often frames are captured. `Raw` exists on Android only. | +| `CaptureVideoScale` | Both | `float` | `1` | `capture.video.scale` | Extra down-scaling of the recorded video, from 0.1 to 1.0 on Android. | + +### Reporting + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `ReportingTriggerByShake` | Both | `bool` | `false` | `reporting.triggers.shake` | Open the report dialog when the user shakes the device. | +| `ReportingTriggerByScreenshot` | Both | `bool` | `false` | `reporting.triggers.screenshot` | Open the report dialog when the user takes a screenshot. | +| `ReportingDefaultCrashPriority` | Both | `IssueSeverity` | `Blocker` | `reporting.defaults.crash-priority` | Severity given to crash reports. | +| `ReportingDefaultErrorPriority` | Both | `IssueSeverity` | `High` | `reporting.defaults.error-priority` | Severity given to error reports. | +| `ReportingDefaultBugPriority` | Both | `IssueSeverity` | `High` | `reporting.defaults.bug-priority` | Severity given to bug reports when your call passes none. | +| `ReportingUISummaryRequired` | Both | `bool` | `false` | `reporting.ui.summary-required` | Make the summary field mandatory in the report dialog. | +| `ReportingUIDescriptionRequired` | Both | `bool` | `false` | `reporting.ui.description-required` | Make the description field mandatory. | +| `ReportingUIEmailRequired` | Both | `bool` | `false` | `reporting.ui.email-required` | Make the email field mandatory. | +| `ReportingUILabelsEnabled` | Both | `bool` | `false` | `reporting.ui.labels-enabled` | Show the labels field. | +| `ReportingUILabelsRequired` | Both | `bool` | `false` | `reporting.ui.labels-required` | Make the labels field mandatory. | +| `ReportingUIPrioritySelectorEnabled` | Both | `bool` | `false` | `reporting.ui.priority-selector-enabled` | Let the user choose the severity. | + +### Performance + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `PerformanceMonitoring` | Both | `bool` | `true` | `performance.enabled` | Master switch for performance monitoring. | +| `PerformanceSampleRate` | Both | `float` | `0.01` | `performance.sample-rate` | Share of transactions sampled for standalone upload, from 0 to 1. | +| `PerformanceAdaptiveSampling` | Both | `bool` | `true` | `performance.adaptive-sampling` | Promote notable unsampled transactions on top of the sample rate. | +| `PerformanceUploadMode` | Android | `string` | `"batched"` | `performance.upload-mode` | How standalone performance data is uploaded: `"batched"` or `"realtime"`. The iOS launch drops this option. | + +## Android options + +These properties exist on `AndroidLaunchOptions` only. An iOS launch drops the keys that the iOS SDK does not know. + +### Exit reasons and native crashes + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `ReportProcessingInProcess` | Android | `bool` | `true` | `config.report-processing-in-process` | Process and upload reports in the app process. When `false`, Android job scheduling does it. | +| `DetectAndReportExit` | Android | `bool` | `true` | `detect.exit` | Master switch for application exit reports. The per-reason options below select which reasons are reported. | +| `DetectAndReportExitLowMemory` | Android | `bool` | `true` | `detect.exit.low_memory` | Report exits where the OS reclaimed memory. | +| `DetectAndReportExitLowMemoryBackgroundAsError` | Android | `bool` | `false` | `detect.exit.bg_low_memory_as_error` | Report a low-memory kill of a background process as a non-fatal error, not a crash. Needs `DetectAndReportExitLowMemory`. | +| `DetectAndReportExitNotResponding` | Android | `bool` | `true` | `detect.exit.not_responding` | Report ANR exits. | +| `DetectAndReportExitNotRespondingAsCrash` | Android | `bool` | `false` | `detect.exit.not_responding.as_crash` | Report ANR exits as crashes. Needs `DetectAndReportExitNotResponding`. | +| `DetectAndReportExitExcessiveResourceUsage` | Android | `bool` | `false` | `detect.exit.excessive_resource_usage` | Report exits caused by excessive resource use. | +| `DetectAndReportExitDependencyDied` | Android | `bool` | `false` | `detect.exit.dependency_died` | Report exits caused by a dependency process dying. | +| `DetectAndReportExitUserRequested` | Android | `bool` | `false` | `detect.exit.user_requested` | Report exits the user requested. | +| `DetectAndReportExitUserWasStopped` | Android | `bool` | `false` | `detect.exit.user_was_stopped` | Report exits where the system stopped the app. | +| `DetectAndReportExitPermissionChanged` | Android | `bool` | `false` | `detect.exit.permission_changed` | Report exits caused by a permission change. | +| `DetectAndReportExitPackageUpdated` | Android | `bool` | `false` | `detect.exit.package_updated` | Report exits caused by a package update. | +| `DetectAndReportExitPackageStateChanged` | Android | `bool` | `false` | `detect.exit.package_state_changed` | Report exits caused by a package state change. | +| `DetectAndReportExitOther` | Android | `bool` | `false` | `detect.exit.other` | Report exits the OS classifies as other. | +| `DetectAndReportExitUnknown` | Android | `bool` | `false` | `detect.exit.unknown` | Report exits with an unknown reason. | +| `DetectAndReportHangSampling` | Android | `bool` | `true` | `detect.hang.sampling` | Sample the main thread during a hang to name the blocking frames. Needs `DetectAndReportHang`. | +| `DetectAndReportAnrSampling` | Android | `bool` | `true` | `detect.anr.sampling` | Sample the main thread during an ANR. Needs `DetectAndReportExitNotResponding`. | +| `DetectAndReportCrashNdk` | Android | `bool` | `true` | `detect.crash-ndk` | Report native (NDK) crashes. Also off when `DetectAndReportCrash` is `false`. | +| `CrashNdkIncludeTombstoneLogs` | Android | `bool` | `false` | `crash-ndk.tombstone-logs` | Add the OS tombstone log buffers to a native crash report. They skip Bugsee log filters and are uploaded unredacted. | +| `DetectAndReportMainThreadMisuse` | Android | `bool` | `false` | `detect.main_thread_misuse` | Report file, network and database work on the main thread. The iOS SDK also reads this key. | + +### Capture + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `CaptureNetworkOnLaunch` | Android | `bool` | `false` | `capture.network.on-launch` | Subscribe to network capture during launch so requests made at startup are not missed. The iOS SDK also reads this key. | +| `CaptureLogsUseAllSources` | Android | `bool` | `false` | `capture.logs.allsources` | Read all logcat buffers, not only the default ones. | +| `CaptureRespectFlagSecure` | Android | `bool` | `true` | `capture.respect-flag-secure` | Blank windows that set `FLAG_SECURE` in video and screenshots. | +| `AdvancedWebViewCapture` | Android | `bool` | `true` | `capture.webview.advanced` | Advanced WebView capture. The iOS SDK also reads this key. | +| `WebViewDomainAllowlist` | Android | `string` | `""` | `capture.webview.domain-allowlist` | Domains the WebView capture may record. | +| `WebViewReportTrigger` | Android | `bool` | `false` | `capture.webview.report-trigger` | Let WebView content trigger a report. The iOS SDK also reads this key. | +| `CaptureVideoMode` | Android | `VideoMode` | `V2` | `capture.video.mode` | How the screen is captured. See [VideoMode](#enums). | +| `CaptureVideoAdaptive` | Android | `bool` | `false` | `capture.video.adaptive` | Skip frames while nothing on screen changes. | +| `CaptureVideoSecureScrolling` | Android | `bool` | `false` | `capture.video.secure-scrolling` | With `VideoMode.V1`, skip more frames while secure views are on screen. | +| `CaptureVideoUsingCustomMuxer` | Android | `bool` | `false` | `capture.video.custom-muxer` | Use Bugsee's MP4 muxer instead of Android's `MediaMuxer`. | +| `CaptureVideoFullscreenRememberUserDecision` | Android | `bool` | `true` | `capture.video.fullscreen-remember-decision` | With `VideoMode.Fullscreen`, remember the user's screen-capture consent across launches. | +| `CaptureVideoFullscreenKeepRunning` | Android | `bool` | `true` | `capture.video.fullscreen-keep-running` | With `VideoMode.Fullscreen`, keep the capture session running in the background. | + +### Reporting triggers + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `ReportingTriggerByNotification` | Android | `bool` | `false` | `reporting.triggers.notification-bar` | Show a notification-bar entry that opens the report dialog. | +| `ReportingTriggerByBroadcast` | Android | `bool` | `false` | `reporting.triggers.broadcast` | Allow a broadcast intent to trigger a report. | + +`DetectAndReportExit`, `DetectAndReportMainThreadMisuse`, `CaptureNetworkOnLaunch`, `AdvancedWebViewCapture` and `WebViewReportTrigger` have a typed property on `AndroidLaunchOptions` only, but the iOS SDK reads the same keys. On iOS, set them with `SetCustomOption` and the `Options` constants. + +The NDK options (`DetectAndReportCrashNdk`, `CrashNdkIncludeTombstoneLogs` and the Android side of `CrashSignals`) belong to the `bugsee-android-ndk` module, which the package declares in every Android build. + +:::warning[Tombstone logs are not redacted] +`CrashNdkIncludeTombstoneLogs` uploads the OS tombstone's raw log buffers. They bypass Bugsee's log filters and can contain text that system or third-party libraries logged in your process. Leave it off unless you need them. +::: + +## iOS options + +These properties exist on `IOSLaunchOptions` only. An Android launch drops the keys that the Android SDK does not know. The iOS SDK also drops a host option that equals its default, so `Bugsee.GetHostLaunchOptions()` can omit an option you set to its default; `Bugsee.GetLaunchOptions()` always shows the effective value. + +| Property | Platform | Type | Default | Key suffix | What it does | +|---|---|---|---|---|---| +| `CrashHandlerType` | iOS | `CrashHandlerType` | `MachAndBSD` | `capture.crash-handler-type` | How the crash reporter intercepts crashes. See [CrashHandlerType](#enums). | +| `CaptureOnDeviceSymbolication` | iOS | `bool` | `false` | `capture.on-device-symbolication` | Symbolicate system frames on the device. | +| `CrashSwiftAsyncStackTraces` | iOS | `bool` | `true` | `detect.crash.swift_async_stacktraces` | Stitch Swift async stacks into C++ throw stacks. | +| `CrashFillEmptyExceptionStacks` | iOS | `bool` | `false` | `detect.crash.fill_empty_exception_stacks` | Fill the stack of an uncaught `NSException` that has none. Can change crash grouping. | +| `CaptureWebSocket` | iOS | `bool` | `true` | `capture.websocket` | Capture WebSocket traffic. | +| `CaptureAVPlayer` | iOS | `bool` | `false` | `capture.avplayer` | Capture video rendered on a native `AVPlayerLayer`. Unity's `VideoPlayer` is not covered. | +| `CaptureSampleBufferDisplayLayer` | iOS | `bool` | `false` | `capture.sample-buffer-display-layer` | Capture video rendered on an `AVSampleBufferDisplayLayer`. | +| `CaptureCameraPreview` | iOS | `bool` | `false` | `capture.camera-preview` | Record the image of a native `AVCaptureVideoPreviewLayer`. This puts what the camera sees into reports. Unity's `WebCamTexture` is not covered. | +| `CaptureBluetoothStatus` | iOS | `bool` | `false` | `capture.bluetooth-status` | Report the Bluetooth status. The SDK reads it only if your app asked for and got Bluetooth permission. | +| `CaptureDiskSpace` | iOS | `bool` | `false` | `capture.disk-space` | Report free and total disk space. Apple's stated reason for the API forbids sending it off the device, so use it in development builds only. | +| `CaptureDeviceNetworkNames` | iOS | `bool` | `false` | `capture.device-network-names` | Send the device name and Wi-Fi network name. This is personal data. The Wi-Fi name also needs an Apple entitlement and location permission. | +| `CaptureVideoPrivacyBlur` | iOS | `bool` | `true` | `capture.video.privacy-blur` | Blur transition frames in the video. Off, the video freezes during a transition instead. | +| `CaptureVideoMinFrameRate` | iOS | `int` | `0` | `capture.video.min-frame-rate` | Minimum video frame rate. The SDK clamps it to 0..30 and drops it unless a maximum at or above it is set. `0` derives it from `CaptureVideoFrameRate`. | +| `CaptureVideoMaxFrameRate` | iOS | `int` | `0` | `capture.video.max-frame-rate` | Maximum video frame rate. The SDK clamps it to 0..30. `0` derives it from `CaptureVideoFrameRate`. | +| `BuildTarget` | iOS | `string` | none | `config.build-target` | The Xcode target name, reported with the session. | +| `BuildType` | iOS | `string` | none | `config.build-type` | The build type (for example debug or release), reported with the session. | +| `ReportingUIStyle` | iOS | `ReportingUIStyle` | `System` | `reporting.ui.style` | Look of the report screen. See [ReportingUIStyle](#enums). | +Three iOS keys have no property: `capture.logs.oslog` (the iOS SDK accepts and ignores it), `capture.status-bar-info` (read only by a debug build of the iOS SDK) and `capture.mach-exceptions` (removed from the iOS SDK; use `CrashHandlerType`). + +:::warning[Privacy options] +`CaptureCameraPreview` puts what the camera sees into reports. `CaptureDeviceNetworkNames` sends the device name and Wi-Fi network name, which are personal data. Turn them on only when your privacy policy covers it. +::: + +## CrashSignals + +`CrashSignals` is a `[Flags]` enum that selects the fatal signals the native crash reporter intercepts. It is a shared option: it reaches both platforms, and on Android it is read by the `bugsee-android-ndk` module. + +| Value | Bit | Meaning | +| --- | --- | --- | +| `None` | `0` | No signal. | +| `Abrt` | `1` | `SIGABRT`: `abort()`, failed assertions, uncaught exceptions. | +| `Segv` | `2` | `SIGSEGV`: invalid memory access. | +| `Bus` | `4` | `SIGBUS`: misaligned or otherwise invalid memory access. | +| `Ill` | `8` | `SIGILL`: illegal instruction. | +| `Fpe` | `16` | `SIGFPE`: arithmetic exception. | +| `Trap` | `32` | `SIGTRAP`: breakpoint or trap instruction, including Swift runtime traps. | +| `All` | `63` | Every signal above. | +| `Default` | `128` | The SDK chooses: every signal. This is the default. | + +Keep the default. A real fault, such as a bad native pointer, ends the process with `SIGSEGV`, and with `Segv` and `Bus` left out that crash is not reported. Unity's IL2CPP raises a managed `NullReferenceException` from an explicit null check, not from a signal, so managed null references do not depend on these signals. + +How the two platforms read a value: + +- `Default` is honored only on its own. Combined with other bits, the value is used as given and the `Default` bit means nothing. +- On Android, a nonzero value other than `Default` that selects none of the six signals (for example `64`) is taken as every signal. Bits above `Trap` are masked off first, so a nonzero value left with no signal also becomes every signal. `0` (`None`) stays no signal. +- On iOS, any other value is used as given. Leaving out `Abrt` also stops uncaught Objective-C exceptions, which end in `abort()`, from being reported. + +A mask meant for iOS, such as `CrashSignals.None`, also narrows or switches off native signal capture on Android when the NDK module is present. Set it per platform, or leave it out of the Android options to keep every signal. + +## Enums + +| Enum | Values | +| --- | --- | +| `LogLevel` | `Error` (1), `Warning` (2), `Info` (3), `Debug` (4), `Verbose` (5) | +| `VideoMode` (Android) | `None` (0), `V1` (1), `V2` (2), `Fullscreen` (20), `DirectBuffers` (21) | +| `VideoQuality` | `Default` (0), `Medium` (1), `High` (2) | +| `FrameRate` | `Low` (1), `Medium` (2), `High` (3), `Raw` (4, no cap, meaningful for `DirectBuffers` only; Android) | +| `IssueSeverity` | `VeryLow` (1), `Medium` (2), `High` (3), `Critical` (4), `Blocker` (5) | +| `CrashHandlerType` (iOS) | `BSD` (1), `Mach` (2), `MachAndBSD` (3, default) | +| `ReportingUIStyle` (iOS) | `Light` (0), `Dusk` (1), `BasedOnStatusBar` (2), `System` (3, default) | + +`CrashHandlerType.BSD` installs BSD signal handlers. `Mach` installs a Mach exception handler plus a BSD handler for `SIGABRT`, so signals raised by software (`raise()`, `kill()`) are not reported. `MachAndBSD` reports both. + +## Related pages + +- [Lifecycle & status](/sdk/unity/lifecycle): `Launch`, `Relaunch`, `Stop` and the lifecycle callbacks. +- [Installation](/sdk/unity/installation): add the package and make the first launch. +- [Issue detection](/sdk/unity/issue-detection/overview): the detection options in context. +- [Video capture](/sdk/unity/video-capture) and [Privacy overview](/sdk/unity/privacy/overview): what is recorded and how to limit it. +- Native option reference: [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration). diff --git a/docs/sdk/unity/events-and-traces.mdx b/docs/sdk/unity/events-and-traces.mdx index 57f4b775..bd310777 100644 --- a/docs/sdk/unity/events-and-traces.mdx +++ b/docs/sdk/unity/events-and-traces.mdx @@ -1,6 +1,6 @@ --- title: "Custom events & traces" -description: "TODO(writer-C): Custom events & traces for the Bugsee Unity SDK 7.x." +description: "Record named events and trace how values change over time with Bugsee.Event and Bugsee.Trace in the Bugsee Unity SDK 7.x." sidebar_position: 10 slug: "/sdk/unity/events-and-traces" --- @@ -9,4 +9,103 @@ slug: "/sdk/unity/events-and-traces" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Events mark moments in the app's life ("payment processed"). Traces follow how a value changes ("credit balance"). Both appear on the report's timeline next to the video, logs and network traffic. + +In the Unity Editor, and on platforms other than Android and iOS, these calls do nothing. + +## Custom events + +An event has a name and optional parameters. + +```csharp +using System.Collections.Generic; +using BugseeSdk = Bugsee.Bugsee; + +// Without parameters +BugseeSdk.Event("payment_processed"); + +// With parameters +BugseeSdk.Event("payment_processed", new Dictionary +{ + ["amount"] = 125, + ["currency"] = "USD", + ["success"] = true, +}); +``` + +The signature is `Bugsee.Event(string name, IDictionary parameters = null)`. + +- Use strings, booleans and numbers as parameter values. The two platforms convert other types differently, so keep to these. +- On Android, parameters with a `null` key or a `null` value are skipped. +- Use a non-empty name. The iOS SDK ignores an event with an empty name. + +## Custom traces + +A trace is a named value. Set it every time the value changes. The report shows how it changed over the recorded period. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + + +BugseeSdk.Trace("credit_balance", 15); +BugseeSdk.Trace("level_name", "forest_3"); +BugseeSdk.Trace("music_enabled", true); +``` + +The signature is `Bugsee.Trace(string name, object value)`. Use a non-empty name. The iOS SDK ignores a trace with an empty name. + +### Value forms + +The SDK accepts these value forms on both platforms: + +| Value | What is sent | +| --- | --- | +| `string`, `bool`, `int`, `long` | The value as is. | +| `float`, `double` | A floating-point number. `1.0f` stays `1.0` and is never turned into the integer `1`. | +| Dictionary, list or array (any `IDictionary`, or any `ICollection` including generic collections) | JSON, with the limits below. | +| Enum | Its integer value. | +| `DateTime`, `DateTimeOffset` | ISO 8601 text. | +| `byte[]` | Base64 text. | +| Any other type | Its culture-invariant text. | + +Other sequence types that are not collections, such as a Unity `Transform`, are sent as text, not iterated. + +`NaN` and the infinities have no JSON form. Do not trace them: iOS sends `null` for them. + +### Dictionaries, lists and arrays + +A map, list or array is written as JSON with these rules: + +- The JSON is at most 8192 UTF-16 units long, and the writer visits at most 4096 values (entries, elements and scalars together). +- A container that does not fit keeps its leading entries whole and drops the rest. The text is always valid JSON and is never cut inside an entry. +- A map entry whose value is `null` is left out. A `null` list element is written as `null`. +- A collection that contains itself writes `null` where it repeats. +- The iOS SDK receives the JSON as a dictionary or array. The Android SDK receives the same text as a string. + +```csharp +using System.Collections.Generic; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Trace("inventory", new Dictionary +{ + ["coins"] = 120, + ["items"] = new List { "sword", "shield" }, +}); +``` + +## When events and traces are recorded + +The native SDKs differ for calls made before the SDK is fully launched: + +- **Android:** calls made before launch are buffered. +- **iOS:** events and traces are recorded once the SDK status is `Launched`. Calls made earlier, while the SDK is stopped, while a launch waits for the app to become active, or while it is still `Launching`, may be lost. + +To behave the same on both platforms, wait for `Bugsee.IsLaunched` before you rely on a call. See [Lifecycle & status](/sdk/unity/lifecycle). + +## Related pages + +- [View hierarchy](/sdk/unity/view-hierarchy) +- [Breadcrumbs](/sdk/unity/breadcrumbs) +- [User & session data](/sdk/unity/user-session-data) +- [Android events and traces](/sdk/android/events-and-traces) +- [iOS events and traces](/sdk/ios/events-and-traces) diff --git a/docs/sdk/unity/faq.md b/docs/sdk/unity/faq.md index d90e1775..b3efdaaa 100644 --- a/docs/sdk/unity/faq.md +++ b/docs/sdk/unity/faq.md @@ -1,6 +1,6 @@ --- title: "FAQ" -description: "TODO(writer-F): FAQ for the Bugsee Unity SDK 7.x." +description: "Practical questions and answers about Bugsee Unity SDK 7.x (beta): compile errors, platforms, symbolication, build variables and known beta behavior." sidebar_position: 24 slug: "/sdk/unity/faq" --- @@ -9,4 +9,129 @@ slug: "/sdk/unity/faq" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-F) +Upgrading from 6.x? See the [migration guide](/sdk/unity/migration). + +**1. Why does `Bugsee.Launch(...)` not compile?** + +The package namespace and its static class are both named `Bugsee`. In code outside the `Bugsee` namespace, `Bugsee` resolves to the namespace, so `Bugsee.Launch(...)` is an error. Alias the class and call the alias. You can also write the full name, `Bugsee.Bugsee.Launch(...)`. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Launch(""); +``` + +Import the other types with `using Bugsee.Contracts.Options;` and the namespaces listed in the [migration guide](/sdk/unity/migration#13-namespaces-and-the-name-clash). The examples on this site use the alias. See [Installation](/sdk/unity/installation#launch-the-sdk). + +
+ +**2. Which Unity versions and platforms does 7.x support?** + +Unity 2021.3 or later, for iOS builds (iOS 15.0 or later) and Android builds (API 21 or later). The package compiles for every build target, but it records and sends data only on iOS and Android. See [Overview](/sdk/unity/overview#requirements). + +
+ +**3. Do I need a `BugseeLauncher` component or a special GameObject?** + +No. 7.x has no launcher component. You call `Launch` from any script. The package creates its own helper object, `Bugsee.MainThreadDispatcher`, before the first scene loads. If you used the 6.x `BugseeLauncher` or `AddComponent()`, remove them: see the [migration guide](/sdk/unity/migration#11-replace-the-plugin). + +
+ +**4. Nothing is captured when I press Play in the Editor. Is that a bug?** + +No. In the Unity Editor, `Launch` does nothing: `Bugsee.Status` is `Stopped`, `Bugsee.IsLaunched` is `false`, and `LaunchAsync` completes `false`. The Editor does not record or send anything. Build to a device to test launch, capture and reports. See [Lifecycle & status](/sdk/unity/lifecycle#status) and [Installation](/sdk/unity/installation#check-that-it-works). + +
+ +**5. What happens on WebGL, standalone and other platforms?** + +The package compiles there, and the API calls are stubs: `Launch` does nothing and nothing is collected. `SetAttribute` still validates its key and value and throws `ArgumentException` for an invalid one, but it stores nothing, so `GetAttribute` returns `null`. Your code needs no `#if` guards to build. See [User & session data](/sdk/unity/user-session-data#in-the-editor). + +
+ +**6. The shake gesture and the notification-bar trigger do not open the report dialog. Why?** + +They are off by default in 7.x. Shake-to-report is off on both platforms, and the Android notification-bar trigger is off on Android. Turn them on in the launch options: `ReportingTriggerByShake = true` (both platforms) and `ReportingTriggerByNotification = true` on `AndroidLaunchOptions`. See [Bug reporting](/sdk/unity/manual/bug-reporting#built-in-report-triggers) and [Configuration](/sdk/unity/configuration#reporting). + +
+ +**7. What differs between IL2CPP and Mono?** + +- **iOS** builds use IL2CPP, the only scripting backend Unity offers for iOS. +- **Android IL2CPP** is the supported configuration for fully symbolicated native crashes. +- **Android Mono** works, but frames inside the Mono runtime libraries stay unsymbolicated, and the build logs a warning once. Unity 2021.3 has no Mono ARM64 build. +- **C# frames** resolve differently: a Mono Release build sends IL offsets that Bugsee maps from your portable `.pdb` files (CLI 0.9.0 or newer), and an IL2CPP Release build sends native addresses that Bugsee maps with the IL2CPP line map and native symbols. + +See [Android build setup](/sdk/unity/build-setup/android) and [Symbolication: C# code](/sdk/unity/symbolication/managed-code). + +
+ +**8. Why are the frames of my handled exceptions not symbolicated? What are Public and Debugging symbols?** + +This is a known issue in 7.0.0-beta.1. Handled managed exceptions in a Release IL2CPP build on Android, without IL2CPP line information, stay unsymbolicated (no file and line) when the symbols are Public, which means a symbol table only. Use Debugging symbols plus the IL2CPP line map: set **Create symbols.zip** to Debugging, or use the menu item **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload**. Development builds send no addresses on Android, and Debugging symbols do not change that. + +Also, switching from Public to Debugging symbols for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation: [issue 263](https://github.com/bugsee/bugsee-unity/issues/263). See [Symbolication: Android](/sdk/unity/symbolication/android#public-and-debugging-symbols). + +
+ +**9. Do I need `il2cppFileRoot.txt`?** + +No. Unity writes it next to the IL2CPP line map. The upload sends it when it is there, and it is not required. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#upload-the-il2cpp-line-map-from-ci). + +
+ +**10. My crash test on the iOS Simulator is not reported.** + +The iOS Simulator build of the SDK has no crash reporter. On the Simulator, native crashes, hangs and managed exceptions are not reported. The SDK logs a warning once at the first launch there. Test crashes on a physical device. Bug reports from the report dialog still work. See [Crash & error reporting](/sdk/unity/manual/crash-error-reporting) and the [iOS FAQ](/sdk/ios/faq). + +
+ +**11. How do I turn off the symbol upload?** + +The upload is opt-in. It runs only when `BUGSEE_APP_TOKEN` is set in the environment of the process that builds. To turn every upload off, even with a token, set `BUGSEE_NO_SYMBOL_UPLOAD` to any value. On iOS, set it in the Xcode environment as well. An upload never fails your build: a missing token, tool or map is a warning. See [Build environment variables](/sdk/unity/symbolication/environment-variables) and [Symbolication](/sdk/unity/symbolication/overview). + +
+ +**12. I get a warning that the build token and the launch token are different.** + +Symbols follow `BUGSEE_APP_TOKEN` at build time, and crashes follow the token you pass to `Launch`. When they name different apps, the symbols sit in another app than the crashes. Fix the token, or set `BUGSEE_NO_TOKEN_CHECK` for the build when you choose the token at run time. See [the build token and the launch token](/sdk/unity/symbolication/overview#the-build-token-and-the-launch-token). + +
+ +**13. How do I update the pinned version?** + +Change the tag in the package URL, either in the Package Manager or in `Packages/manifest.json`: + +```json +{ + "dependencies": { + "com.bugsee.unity": "https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1" + } +} +``` + +Always keep a `#tag` in the URL. Without one, Unity follows the repository's default branch, which is not a release. Read the [release notes](/sdk/unity/release-notes) before you move to a new beta, because the API can change between betas. See [Installation](/sdk/unity/installation#install-the-package). + +
+ +**14. Which native SDK versions does this release use?** + +Bugsee Android SDK 7.6.0 (with the NDK module 7.6.0), Bugsee iOS SDK 7.1.0, Bugsee Gradle plugin 4.1.1 and `bugsee-cli` 0.9.0. The package adds the native SDKs to the generated Gradle and Xcode projects when you build. See [Overview](/sdk/unity/overview#versions). + +
+ +**15. Does the iOS native early launch skip my consent check?** + +Yes. With early launch on (`BUGSEE_IOS_EARLY_LAUNCH=1`), the iOS SDK starts at app launch, before Unity's first scene, so it starts before any C# consent check. It is off by default. If you need consent first, leave it off and call `Launch` after the user agrees. See [Lifecycle & status](/sdk/unity/lifecycle#ios-early-launch). + +
+ +**16. Where are the 6.x docs?** + +The 6.x documentation, the stable release, starts at [Installation (6.x)](/sdk/unity/v6/installation), with the [6.x release notes](/sdk/unity/v6/release-notes). To move to 7.x, follow the [migration guide](/sdk/unity/migration). + +
+ +**17. Where do I report a problem with the beta?** + +On the [issue tracker of the repository](https://github.com/bugsee/bugsee-unity/issues). The known issues of this beta are listed in the [release notes](/sdk/unity/release-notes#700-beta1-november-23-2026). diff --git a/docs/sdk/unity/feedback.mdx b/docs/sdk/unity/feedback.mdx index e439198a..aaf2449f 100644 --- a/docs/sdk/unity/feedback.mdx +++ b/docs/sdk/unity/feedback.mdx @@ -1,6 +1,6 @@ --- title: "Feedback" -description: "TODO(writer-B): Feedback for the Bugsee Unity SDK 7.x." +description: "Add the in-app feedback chat to a Unity game with Bugsee SDK 7.x: turn the add-on on for a build, open the chat, set the greeting, and listen for messages with Bugsee.Feedback." sidebar_position: 18 slug: "/sdk/unity/feedback" --- @@ -9,4 +9,104 @@ slug: "/sdk/unity/feedback" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +Bugsee includes an in-app chat that lets your players talk to your support team and developers. The chat is a native UI that opens over your game. In 7.x it is an opt-in add-on: the native SDKs ship it as a separate module, and the Unity package links it into your build only when you ask. An app that does not use the chat carries no chat code. + +For what the chat does and how replies reach your team, see the native pages: [Android feedback](/sdk/android/feedback) and [iOS feedback](/sdk/ios/feedback). + +## Turn the add-on on + +Choose one of these, then rebuild: + +- Add the scripting define `BUGSEE_FEEDBACK` in **Player Settings > Other Settings > Scripting Define Symbols**, for Android, iOS or both. +- Set the environment variable `BUGSEE_FEEDBACK=1` (or `true`) for the build. This is the way to do it on CI. + +Where the Editor reads the switch: + +- The define is read from Player Settings for the build platform. On Unity 6, it is also read from the defines of the active build profile. A define passed only through `BuildPlayerOptions.extraScriptingDefines` is not seen. +- The environment variable is read by the Editor process while it exports the build, not by a later Gradle or Xcode run. + +What the build adds: + +| Platform | What is added | +| --- | --- | +| Android | `com.bugsee:bugsee-android-feedback`, at the version of the Android SDK (7.6.0 in this beta), is declared in the generated `unityLibrary/build.gradle` next to the core and NDK artifacts. | +| iOS | The Xcode export links the `BugseeFeedback` product of [`bugsee/feedback-spm`](https://github.com/bugsee/feedback-spm) into `UnityFramework`, at the same version as the core package (7.1.0 in this beta). | + +### Android requirements + +The Android add-on needs Android Gradle plugin 8.1.1 or later and `compileSdk` 35 or later. Unity 2021.3 and 2022.3 generate an older Gradle plugin (4.0.1 to 7.4.2), and an older Target API Level gives an older `compileSdk`. When the define is on and the project cannot build the add-on, the Android build fails with a message that names the reason, instead of failing later in Gradle. Use Unity 6 with a Target API Level of 35 or newer. + +If your project declares the Bugsee Android SDK itself (EDM4U, a custom Gradle template), the export does not add the add-on and warns that it did not. Declare `com.bugsee:bugsee-android-feedback` at the same version as the core artifact next to it. A project that declares the add-on itself does not need the define. + +### iOS requirements + +The iOS add-on needs iOS 15 or later. + +An export that appends to an existing Xcode project with the switch off removes the `feedback-spm` link, including one you added by hand. Keep the define on, or link the package in a target of your own. + +## Show the chat + +`Bugsee.Feedback` is a property of type `IFeedback`. Open the chat from your own UI, for example a "Contact support" button, after `Bugsee.Launch`: + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +public void OnContactSupportClicked() +{ + BugseeSdk.Feedback.ShowFeedbackUi(); +} +``` + +`IFeedback` has three members: + +| Member | What it does | +| --- | --- | +| `ShowFeedbackUi()` | Opens the native feedback chat over the game. Needs the add-on and a launched SDK. | +| `SetDefaultGreeting(string greeting)` | Sets the greeting shown at the top of an empty conversation. `null` clears it. | +| `SetListener(IFeedbackListener listener)` | Receives new and sent messages. `null` removes the listener. | + +## Greeting and messages + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Feedback; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +sealed class SupportChatListener : IFeedbackListener +{ + public void OnNewMessagesReceived(IReadOnlyList newMessages) + { + Debug.Log("Support replied: " + newMessages.Count + " new message(s)."); + } + + public void OnNewMessageSent(string message) + { + Debug.Log("Message sent."); + } +} + +// After BugseeSdk.Launch: +BugseeSdk.Feedback.SetDefaultGreeting("Hi! How can we help?"); +BugseeSdk.Feedback.SetListener(new SupportChatListener()); +``` + +`OnNewMessagesReceived` and `OnNewMessageSent` are called on Unity's main thread. + +## Without the add-on + +Without the add-on, each of the three members does nothing, and the wrapper logs a warning once per process that says how to turn the add-on on. + +On Android, when the add-on is in the app but the SDK has no feedback extension registered (for example because Bugsee is not launched), the call does nothing and logs a warning. + +In the Unity Editor and in players for other platforms, the members do nothing and log once. Test the chat on an Android or iOS device. + +## Colors of the chat + +The colors of the chat are set through `Bugsee.Appearance` with the keys of `FeedbackAppearance`. They are independent of the add-on switch and only affect a chat that is present. On iOS, only some of the colors apply. See [Appearance](/sdk/unity/appearance#feedback-colors). + +## Related pages + +- [Appearance](/sdk/unity/appearance): the report and chat colors. +- [User & session data](/sdk/unity/user-session-data): the user identifier and attributes. +- [Build setup: Android](/sdk/unity/build-setup/android) and [Build setup: iOS](/sdk/unity/build-setup/ios). diff --git a/docs/sdk/unity/installation.mdx b/docs/sdk/unity/installation.mdx index de930c4d..4ccec27d 100644 --- a/docs/sdk/unity/installation.mdx +++ b/docs/sdk/unity/installation.mdx @@ -1,6 +1,6 @@ --- title: "Installation" -description: "TODO(writer-A): Installation for the Bugsee Unity SDK 7.x." +description: "Install the Bugsee Unity SDK 7.x package from a pinned git tag, launch it from C#, and check that your first report arrives." sidebar_position: 1 slug: "/sdk/unity/installation" --- @@ -9,4 +9,153 @@ slug: "/sdk/unity/installation" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +The Bugsee Unity SDK is a Unity Package Manager (UPM) package named `com.bugsee.unity`. You add it from a git tag, call `Bugsee.Launch` once, and build for iOS or Android. This page covers the install, the first launch and a check that it works. + +## Requirements + +- **Unity 2021.3 or later.** +- **iOS** builds: a Mac with Xcode, and an iOS 15.0 or later deployment target. The package raises a lower deployment target to 15.0 on export. +- **Android** builds: Android Build Support for your Unity version. The package needs no Gradle template and no extra dependency manager. +- A Bugsee app token from the Bugsee dashboard. App tokens are per platform: your iOS app and your Android app each have their own token. + +See [Overview](/sdk/unity/overview#requirements) for the full list. + +## Install the package + +The package is installed from git, pinned to a release tag: + +``` +https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1 +``` + +Always include the `#v7.0.0-beta.1` part. Without a tag, Unity follows the repository's default branch, which is not a release. + +Pick one of the following routes. + +### Package Manager + +1. In Unity, open **Window > Package Manager**. +2. Click **+**, then **Add package from git URL...**. +3. Paste the URL above and click **Add**. + +### Edit the manifest + +Add the dependency to `Packages/manifest.json`. Unity resolves it the next time the Editor has focus. + +```json +{ + "dependencies": { + "com.bugsee.unity": "https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1" + } +} +``` + +### A clone or another git host + +Unity accepts a git URL that ends in `.git` (before the optional `#tag`) or starts with `git+`. Other spellings are rejected as an invalid version. For a clone on disk or a mirror, use one of these forms: + +``` +file:///path/to/bugsee-unity.git#v7.0.0-beta.1 +git+file:///path/to/bugsee-unity#v7.0.0-beta.1 +``` + +### From disk + +1. Open **Window > Package Manager**, click **+**, then **Add package from disk...**. +2. Pick the `package.json` in the root of a checkout, the folder that holds `package.json`, `Runtime` and `Editor`. + +In `manifest.json` the entry is `"com.bugsee.unity": "file:/path/to/bugsee-unity"`. Unity reads the folder in place, so keep it where it is. + +### From a tarball + +1. Open **Window > Package Manager**, click **+**, then **Add package from tarball...**. +2. Pick the `.tgz` file. + +Unity needs the package files under a top-level `package/` folder, which is what `npm pack` makes. It rejects an archive whose files are at the top level or under another folder name. That includes GitHub's "Source code" download, whose top folder is named after the repository and the tag. From a checkout, make the archive with: + +```bash +git archive --format=tar.gz --prefix=package/ -o bugsee-unity-7.0.0-beta.1.tgz v7.0.0-beta.1 +``` + +## What the package declares + +The package depends on three built-in Unity modules, which Unity resolves for you: `com.unity.modules.androidjni`, `com.unity.modules.jsonserialize` and `com.unity.modules.ui`. Keep them enabled. + +You do not add a scoped registry, a dependency-resolve step or custom Gradle templates. The package wires the native SDKs in when you build: + +- **Android**: every build declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk`, version 7.6.0, in the Gradle project that Unity generates. It adds `mavenCentral()` to the project repositories if they lack it. See [Android build setup](/sdk/unity/build-setup/android). +- **iOS**: every export adds the Bugsee Swift package (`https://github.com/bugsee/spm`, version 7.1.0) to the Xcode project. See [iOS build setup](/sdk/unity/build-setup/ios). + +If your project already uses the External Dependency Manager (EDM4U) for other SDKs, it keeps working. If the project already declares `com.bugsee:bugsee-android` itself, through EDM4U, a custom `mainTemplate.gradle` or a local AAR, the package keeps that declaration and adds nothing next to it. The build log warns when its version differs from the one this package pins. + +If your game code lives in its own assembly definition, add a reference to `Bugsee.Runtime`. The assembly is auto-referenced for the default `Assembly-CSharp`. + +## Launch the SDK + +Call `Bugsee.Launch` once, as early as you can, for example from a component in your first scene. This example launches with the SDK defaults. + +```csharp +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public class BugseeStartup : MonoBehaviour +{ +#if UNITY_ANDROID + const string AppToken = ""; +#elif UNITY_IOS + const string AppToken = ""; +#else + const string AppToken = ""; +#endif + + void Awake() + { + BugseeSdk.Launch(AppToken); + } +} +``` + +:::note[Name clash] +The package namespace and its static class are both named `Bugsee`. In code outside the `Bugsee` namespace, `Bugsee.Launch(...)` does not compile, because `Bugsee` resolves to the namespace. The alias `using BugseeSdk = Bugsee.Bugsee;` fixes it. You can also write `Bugsee.Bugsee.Launch(...)`. The examples on this site use the alias. +::: + +`Launch` does not wait for the native SDK to finish. It throws `ArgumentException` if the token is empty. In the Unity Editor it does nothing: test on a device. To pass options, or to launch and read the result, see [Configuration](/sdk/unity/configuration) and [Lifecycle & status](/sdk/unity/lifecycle). + +Shake-to-report is off by default. To turn it on, set `ReportingTriggerByShake = true` in the launch options; see [Configuration](/sdk/unity/configuration). + +## Check that it works + +Build to a device, run the app, and trigger a test report and a test crash. This component calls both from your own UI. + +```csharp +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public class BugseeInstallCheck : MonoBehaviour +{ + // Wire these to two buttons. + public void SendTestReport() => BugseeSdk.ShowReportDialog("Install check", "Sent from the install check"); + + public void CrashTheApp() => BugseeSdk.TestCrash(); +} +``` + +1. Tap the first button. The report dialog opens. Send it. +2. Tap the second button. The app ends with a native crash. +3. Start the app again. The SDK sends the crash report on that launch. +4. Open your app in the Bugsee dashboard. Both reports appear there. + +On the iOS Simulator the SDK has no crash reporter, so `TestCrash` is not reported there. Use a physical device to test crashes; see the [iOS FAQ](/sdk/ios/faq). + +If nothing arrives, check that the token matches the platform of the build, and read the Unity player log for lines that start with `[Bugsee]`. + +## Sample project + +The repository ships a small sample game that exercises the API. Open [`Samples~/BugseeMiniGame`](https://github.com/bugsee/bugsee-unity/tree/v7.0.0-beta.1/Samples~/BugseeMiniGame) in Unity Hub (Unity 2021.3 or later). + +## Next steps + +- [Android build setup](/sdk/unity/build-setup/android) and [iOS build setup](/sdk/unity/build-setup/ios): what the Editor does to your build. +- [Configuration](/sdk/unity/configuration): launch options and their defaults. +- [Symbolication](/sdk/unity/symbolication/overview): upload symbols so crash frames resolve to your code. +- [Privacy overview](/sdk/unity/privacy/overview): decide what is recorded. diff --git a/docs/sdk/unity/issue-detection/crash-report-extension.mdx b/docs/sdk/unity/issue-detection/crash-report-extension.mdx index 9d0cf3cd..1ec55b86 100644 --- a/docs/sdk/unity/issue-detection/crash-report-extension.mdx +++ b/docs/sdk/unity/issue-detection/crash-report-extension.mdx @@ -1,6 +1,6 @@ --- title: "Crash Report Extension (iOS)" -description: "TODO(writer-B): Crash Report Extension (iOS) for the Bugsee Unity SDK 7.x." +description: "Report memory-limit kills on iOS 27 and later from a Unity game with the Bugsee Crash Report Extension: what the Xcode export adds, the App Group, the settings and environment variables, and early launch." sidebar_position: 2 slug: "/sdk/unity/issue-detection/crash-report-extension" --- @@ -9,4 +9,138 @@ slug: "/sdk/unity/issue-detection/crash-report-extension" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +Some terminations end an iOS app before any in-process crash handler can run: a memory-limit kill (jetsam) and the launch watchdog (`0x8badf00d`). Starting with iOS 27, the system hands the dead process to a crash reporter extension embedded in the app. With Bugsee's extension, these terminations are reported. + +In a Unity project you do not add the extension by hand. The iOS export adds it to the Xcode project when the conditions below hold. For how the extension works, see the native page: [Crash Report Extension](/sdk/ios/issue-detection/crash-report-extension). + +:::info[Requirements] +The extension needs Xcode 27 or later to build, and a device on iOS 27 or later to run. Only the extension target needs iOS 27: your app keeps its own deployment target. The Simulator never runs the extension. +::: + +## What is reported + +| Termination | Report | +| --- | --- | +| Memory limit (jetsam) in the foreground | **Foreground Out of memory**, a crash | +| Memory limit (jetsam) in the background | **Background Out of memory**, a non-fatal error | +| Watchdog (`0x8badf00d`) | **Main thread locked**, a crash. When the watchdog ran while the app was not visible, a non-fatal error | + +The report carries the threads of the dead process with their stacks. In the dashboard, the summary is `Application process exited`. The kind (for example Main thread locked or Foreground Out of memory) is in the description and the attributes. + +The extension does not report other kinds of termination. In particular, a stack overflow is not handled by the extension. It is reported as an ordinary crash by Bugsee's crash handler, like any other native crash. + +The extension works next to the crash handler, not instead of it. Keep `DetectAndReportCrash` and the iOS exit detection at their defaults (on). The reports are sent on the next launch. + +### Launch watchdog kills in Unity + +The extension reports a termination only for a process in which Bugsee was launched, and nothing is filed for a process in which it was not. In Unity, Bugsee starts when your C# code calls `Bugsee.Launch`, which runs after iOS's launch watchdog window. **Launch watchdog kills (`0x8badf00d`) are therefore normally not reported in a Unity game.** Out-of-memory kills, and exits that happen after `Bugsee.Launch`, are reported. + +To start Bugsee earlier, turn on [iOS native early launch](#ios-native-early-launch). With early launch on, the SDK starts when the app finishes launching, and a launch watchdog kill that happens after that point can be reported. A crash or a kill inside Unity's own startup, before that point, is not covered. + +## What the export adds + +On an iOS export that meets the conditions below, the Bugsee package changes the Xcode project: + +- A target `BugseeCrashReport`, an ExtensionKit extension with the bundle id `.BugseeCrashReport` and an iOS 27.0 deployment target on the extension only. It links the `BugseeCrashExtension` product of the Bugsee Swift package (`bugsee/spm`) and is embedded in the app. Its source is the two documented lines, `import BugseeCrashExtension` and `@main struct CrashReport: BugseeCrashReporterExtension {}`. The app keeps linking `Bugsee`. +- The App Group entitlement (`com.apple.security.application-groups`) on the app and on the extension. The export creates `Unity-iPhone.entitlements` or extends the file the app target already names. +- The key `BugseeAppGroup` in the extension's `Info.plist`, which holds the group id. +- The extension's `CFBundleShortVersionString` and `CFBundleVersion`, set to the app's. + +You do not write any C# for it. There is no launch option. + +### When it is added + +The export adds the extension only when all of these hold. Otherwise it logs why in the Unity console and carries on unchanged. The step never fails the build. + +- The build machine has Xcode 27 or later (`xcodebuild -version`). +- The setting is not **Off**. The default, **Auto**, adds the extension only in an interactive Editor build, with Player Settings **Automatically Sign** on and a team ID set. The extension needs an App Group, and a manual or wildcard provisioning profile cannot carry one. Auto stays off in batch mode (batch mode, CI), because scripted archives often sign with a manual profile, and the new entitlement could break them. **On** adds the extension for any signing setup. **Off** never adds it. +- The iOS SDK package is the published `bugsee/spm` package, or a local package that declares the `BugseeCrashExtension` product. +- The project has no crash-reporter extension of its own. An app can have only one, and the export leaves such a project alone, with a warning. + +### Setting + +Choose the setting in the Unity Editor with the menu **Bugsee > iOS > Crash Report Extension**, with the items **Auto (Xcode 27+ and automatic signing)**, **On** and **Off**. The menu stores an Editor preference per machine, not per project. On CI, use the environment variable `BUGSEE_IOS_CRASH_EXTENSION`. It takes `auto`, `1` (or `on`) and `0` (or `off`), and it wins over the menu. + +```bash +export BUGSEE_IOS_CRASH_EXTENSION=1 +``` + +The Editor process reads the variable while it exports the build. + +If you do not want the extension, set `BUGSEE_IOS_CRASH_EXTENSION=0` (or choose **Off**): the export then adds no extension target and stays as it was. + +### App Group + +The extension saves what it finds in an App Group container, and the SDK reads it on the app's next launch. The group id is `group.` by default. Override it with the environment variable `BUGSEE_IOS_APP_GROUP`: + +```bash +export BUGSEE_IOS_APP_GROUP=group.com.example.game +``` + +A build script can also set `BugseeIosCrashExtensionPostProcess.AppGroupOverride`, in the `Bugsee.Editor` namespace. The environment variable wins. The id must start with `group.` and contain only letters, digits, `.` and `-`. If the id cannot be derived or is not valid, the export skips the extension and logs the reason. + +Signing: + +- With automatic signing, Xcode registers the App Group and the extension's App ID when it builds the project itself, or when `xcodebuild` runs with `-allowProvisioningUpdates`. +- With manual signing, or in any other case, register `group.` and `.BugseeCrashReport` in the Apple Developer portal, add both to the right App IDs, and add a provisioning profile for the extension. The extension's signing style follows the app target's. +- With **On**, register the App Group on both App IDs yourself. + +Bugsee removes only an App Group it added itself. A group your app's entitlements already had, for a widget for example, is never removed. + +### Versions + +The export sets the extension's `CFBundleShortVersionString` and `CFBundleVersion` to the app's values (through `MARKETING_VERSION` and `CURRENT_PROJECT_VERSION` on the extension target). They must equal the app's. If you change the app's version or build number after the export, for example in a CI script, change the extension's too. + +### Appending to an existing project + +An export that appends to an existing Xcode project keeps the extension target and refreshes what follows the app: bundle id, version, build, team and signing style. If the extension is no longer wanted (setting **Off**, an older Xcode, or batch mode with **Auto**), the export removes the target, its embed entry, its files and the App Group it added to the app. + +## iOS native early launch + +By default, Bugsee starts when C# calls `Bugsee.Launch`. Early launch is an opt-in that starts the iOS SDK natively when the app finishes launching, before Unity's first scene. The first `Bugsee.Launch` then adopts that session instead of starting another. + +:::warning[Consent and privacy] +With early launch on, the iOS SDK starts before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for the player's consent. The app token is stored in the app bundle (`Info.plist`). +::: + +Turn it on for the export with these environment variables: + +| Variable | What it does | +| --- | --- | +| `BUGSEE_IOS_EARLY_LAUNCH` | `1` (or `on`, `true`, `yes`) turns early launch on. Anything else leaves it off. | +| `BUGSEE_IOS_APP_TOKEN` | The iOS app token the SDK starts with. Required. | +| `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS` | Optional. A JSON object of launch options, with the same keys as the launch options, for example `{"com.bugsee.option.detect.hang":true}`. | + +```bash +export BUGSEE_IOS_EARLY_LAUNCH=1 +export BUGSEE_IOS_APP_TOKEN= +export BUGSEE_IOS_EARLY_LAUNCH_OPTIONS='{"com.bugsee.option.detect.hang":true}' +``` + +Or use the menu **Bugsee > iOS > Early Launch...**, which stores the same three values as an Editor preference per machine. The variables win. The export writes the values into the app's `Info.plist`, with `$` written as `$` so that Xcode does not collapse `$$` and drop internal keys. Nothing is written when early launch is off. + +How it behaves: + +- The native start happens when the app posts the did-finish-launching notification, after Unity's own `didFinishLaunching` returns. +- The first `Bugsee.Launch` with the same token adopts the running session. The `Launching` and `Launched` lifecycle events are delivered once. +- Options are fixed at build time. Options you pass to `Bugsee.Launch` that differ from the early options are logged as a warning and not applied, and so is a different token. Put what you need into `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS`. +- After `Bugsee.Stop`, `Bugsee.Launch` works as it does without early launch. +- Early launch does nothing in the Simulator. + +### Known issue: a launch that died before the app was active + +After an iOS launch that died before the app became active, the next launch may block the main thread for up to about 8 seconds while the crash report is uploaded. The fix is in the native iOS SDK and is not yet released. Unity launches normally do not hit it, because the SDK starts while the app is active. Early launch starts the SDK at app launch, before the app is active, so an app that uses early launch can hit it. + +## Test the extension + +- Use a device on iOS 27. The Simulator never runs the extension. +- Run the app without the debugger: launch it from the Home Screen, not with **Run** in Xcode. Nothing is filed with a debugger attached. +- The report is sent on the next launch of the app. + +For the native checks (the App Group container, the Console subsystem), see the native page: [Crash Report Extension](/sdk/ios/issue-detection/crash-report-extension#testing). + +## Related pages + +- [Issue detection: Overview](/sdk/unity/issue-detection/overview) +- [Crash & error reporting](/sdk/unity/manual/crash-error-reporting) +- [Build setup: iOS](/sdk/unity/build-setup/ios) diff --git a/docs/sdk/unity/issue-detection/overview.mdx b/docs/sdk/unity/issue-detection/overview.mdx index a5db49c6..c85fea6a 100644 --- a/docs/sdk/unity/issue-detection/overview.mdx +++ b/docs/sdk/unity/issue-detection/overview.mdx @@ -1,6 +1,6 @@ --- title: "Issue detection: Overview" -description: "TODO(writer-B): Issue detection: Overview for the Bugsee Unity SDK 7.x." +description: "The detectors of Bugsee Unity SDK 7.x (crashes, C# exceptions, hangs, ANRs, out-of-memory kills, HTTP errors, anomalies, frustration) and the launch options that turn each one on." sidebar_position: 1 slug: "/sdk/unity/issue-detection/overview" --- @@ -9,4 +9,130 @@ slug: "/sdk/unity/issue-detection/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +Besides the reports your players file and the ones you file from code, Bugsee files reports on its own when it detects a problem in the running game. Each detector is independent: you turn any of them on or off with a launch option, without affecting the others. + +The detectors are those of the native Bugsee SDKs, plus one that the Unity package adds for C# exceptions. This page lists the options the Unity package exposes. For how each detector works, see the native pages: [Android issue detection](/sdk/android/issue-detection) and [iOS issue detection](/sdk/ios/issue-detection). + +Crash, early-crash and exit detection are on by default. The other detectors are off until you enable them. + +## Detectors + +| Detector | What it observes | Option | Platform | Default | +| --- | --- | --- | --- | --- | +| Crashes | Fatal signals and uncaught native exceptions. Reported on the next launch. | `DetectAndReportCrash` | Android, iOS | On | +| Native (NDK) crashes | Crashes in native code on Android. | `DetectAndReportCrashNdk` | Android | On | +| C# exceptions | Unhandled and logged exceptions of your C# code, and unobserved task exceptions. | `CaptureManagedExceptions` | Android, iOS | On | +| Early crashes | A launch that ended before the app was running normally. | `DetectAndReportEarlyCrash` | Android, iOS | On | +| Hangs | The main thread not responding for 3, 5 or 10 seconds. | `DetectAndReportHang` | Android, iOS | Off | +| Exits | Terminations that no crash handler sees: on Android the reasons of `ApplicationExitInfo` (ANR, low memory and more), on iOS out-of-memory kills in the foreground and background. | `DetectAndReportExit` and the `DetectAndReportExit...` reason options | Android, iOS | On | +| iOS Crash Report Extension | On iOS 27 and later, memory-limit kills and, in some setups, the launch watchdog. | None: the export adds a target. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). | iOS | Auto | +| Main-thread misuse | Blocking disk, preferences and network work on the main thread. | `DetectAndReportMainThreadMisuse` | Android, iOS | Off | +| HTTP errors | Responses with a 5xx status. | `DetectAndReportHttpErrors` | Android, iOS | Off | +| Anomaly | Spans of completed performance transactions that take far longer than usual. | `DetectAndReportAnomaly` | Android, iOS | Off | +| Frustration | Rage taps, taps followed by an error, requests that never complete, a frozen UI. | `DetectFrustration` | Android, iOS | Off | + +The package does not include the Android memory-leak and thread-leak module. + +## Enable a detector + +Every detector is a launch option. Typed properties exist on the launch options classes for most of them: + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + DetectAndReportHang = true, + DetectAndReportHttpErrors = true, + DetectAndReportExitNotResponding = true, +}; +BugseeSdk.Launch("", options); +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + DetectAndReportHang = true, + DetectAndReportHttpErrors = true, +}; +BugseeSdk.Launch("", options); +#endif +``` + +`DetectAndReportExit` and `DetectAndReportMainThreadMisuse` are typed properties on `AndroidLaunchOptions` only. To set them on iOS, use `SetCustomOption` with the key constant: + +```csharp +using Bugsee.Contracts.Options; + +var options = new IOSLaunchOptions(); +options.SetCustomOption(Options.DetectAndReportMainThreadMisuse, true); +options.SetCustomOption(Options.DetectAndReportExit, false); // switch iOS exit detection off +``` + +See [Configuration](/sdk/unity/configuration) for every launch option. + +## Options per detector + +### Crashes and exceptions + +The options, signals and handler types are described in [Crash & error reporting](/sdk/unity/manual/crash-error-reporting#native-crashes). `CaptureManagedExceptions` is independent of `DetectAndReportCrash`. + +### Hangs + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `DetectAndReportHang` | Android, iOS | `bool` | `false` | Reports a stalled main thread as an error. | +| `DetectAndReportHangFairLevel` | Android, iOS | `int` | `3000` | Threshold of the lowest severity band, in milliseconds. | +| `DetectAndReportHangMediumLevel` | Android, iOS | `int` | `5000` | Threshold of the middle band, in milliseconds. | +| `DetectAndReportHangSevereLevel` | Android, iOS | `int` | `10000` | Threshold of the highest band, in milliseconds. | +| `DetectAndReportHangSampling` | Android | `bool` | `true` | Samples the main thread's stack during a hang instead of taking one snapshot. Needs `DetectAndReportHang`. | + +See [Android hangs](/sdk/android/issue-detection/hangs) and [iOS hangs](/sdk/ios/issue-detection/hangs). + +### Exits (Android) + +The master switch `DetectAndReportExit` (default `true`) enables the provider. The reason options below are only read while it is on. They are properties of `AndroidLaunchOptions`: + +| Option | Default | What it reports | +| --- | --- | --- | +| `DetectAndReportExitLowMemory` | `true` | Low-memory kills. They are reported as crashes. | +| `DetectAndReportExitNotResponding` | `true` | ANRs (not responding). | +| `DetectAndReportExitNotRespondingAsCrash` | `false` | Files ANR exits as crashes. | +| `DetectAndReportExitLowMemoryBackgroundAsError` | `false` | Files a low-memory kill of a process that was in the background as an error instead of a crash. Needs `DetectAndReportExitLowMemory`. | +| `DetectAndReportAnrSampling` | `true` | Samples the main thread's stack during an ANR. Needs `DetectAndReportExitNotResponding`. | +| `DetectAndReportExitExcessiveResourceUsage` | `false` | Excessive resource usage. | +| `DetectAndReportExitDependencyDied` | `false` | Dependency died. | +| `DetectAndReportExitUserRequested` | `false` | User requested. | +| `DetectAndReportExitUserWasStopped` | `false` | User was stopped. | +| `DetectAndReportExitPermissionChanged` | `false` | Permission changed. | +| `DetectAndReportExitPackageUpdated` | `false` | Package updated. | +| `DetectAndReportExitPackageStateChanged` | `false` | Package state changed. | +| `DetectAndReportExitOther` | `false` | Other. | +| `DetectAndReportExitUnknown` | `false` | Unknown. | + +The reasons map onto the exit reasons of Android's `ApplicationExitInfo`. The Android exit detector needs Android 11 (API 30) or later. See [Android exits](/sdk/android/issue-detection/exits). + +### Exits (iOS) + +iOS terminates an app that uses too much memory without running any of its code. The SDK infers such terminations across launches and reports them on the next launch. It is on by default, and has no reason options. See [iOS exits](/sdk/ios/issue-detection/exits). On iOS 27 and later, the [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) makes these reports more precise. + +### Other detectors + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `DetectAndReportMainThreadMisuse` | Android, iOS | `bool` | `false` | Reports blocking work on the main thread. | +| `DetectAndReportHttpErrors` | Android, iOS | `bool` | `false` | Reports responses with a 5xx status as errors. | +| `DetectAndReportAnomaly` | Android, iOS | `bool` | `false` | Reports performance outliers. It uses performance monitoring: see [Performance monitoring](/sdk/unity/performance). | +| `DetectFrustration` | Android, iOS | `bool` | `false` | Reports frustration patterns. | + +See the native pages for each: [main-thread misuse](/sdk/android/issue-detection/main-thread-misuse), [HTTP errors](/sdk/android/issue-detection/http-errors), [anomaly](/sdk/android/issue-detection/anomaly) and [frustration](/sdk/android/issue-detection/frustration) on Android, and [main-thread misuse](/sdk/ios/issue-detection/main-thread-misuse), [HTTP errors](/sdk/ios/issue-detection/http-errors), [anomaly](/sdk/ios/issue-detection/anomaly) and [frustration](/sdk/ios/issue-detection/frustration) on iOS. + +## What the reports look like + +A detector report carries the same context as any other report: the video, console logs and network events recorded before it. Crashes and exits are filed on the next launch and carry the recording of the run that ended. Severity comes from `ReportingDefaultCrashPriority` and `ReportingDefaultErrorPriority`: see [Bug reporting](/sdk/unity/manual/bug-reporting#default-severities). + +Detector reports reach your [report handler](/sdk/unity/report-handler) like any other report. Check `report.Type` to change only some of them. + +:::note[iOS Simulator and debugger] +The iOS Simulator build of the SDK has no crash reporter, and no detector files reports there: run on a device. While a debugger is attached, the iOS SDK installs no crash handler and does not track the run for abnormal exits. See [iOS issue detection](/sdk/ios/issue-detection). +::: diff --git a/docs/sdk/unity/lifecycle.mdx b/docs/sdk/unity/lifecycle.mdx index 3412171c..7c812479 100644 --- a/docs/sdk/unity/lifecycle.mdx +++ b/docs/sdk/unity/lifecycle.mdx @@ -1,6 +1,6 @@ --- title: "Lifecycle & status" -description: "TODO(writer-A): Lifecycle & status for the Bugsee Unity SDK 7.x." +description: "Launch, relaunch, stop and delete the Bugsee Unity SDK 7.x, read its status, and subscribe to its lifecycle events." sidebar_position: 5 slug: "/sdk/unity/lifecycle" --- @@ -9,4 +9,186 @@ slug: "/sdk/unity/lifecycle" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +You can launch, relaunch and stop the SDK at runtime, ask for its status, and subscribe to its lifecycle events: status transitions, report assembly and upload, blackouts and crash relaunches. + +## Launch, relaunch and stop + +| Call | Returns | What it does | +| --- | --- | --- | +| `Bugsee.Launch(string appToken, Dictionary options = null)` | `void` | Starts the SDK. Throws `ArgumentException` for an empty token. | +| `Bugsee.LaunchAsync(string appToken, Dictionary options = null)` | `Task` | `Launch` that completes with the SDK's answer. | +| `Bugsee.Relaunch(Dictionary options = null)` | `void` | Restarts a launched SDK with a new option set. | +| `Bugsee.RelaunchAsync(Dictionary options = null)` | `Task` | `Relaunch` that completes with the SDK's answer. | +| `Bugsee.Stop(Action completion = null)` | `void` | Stops the SDK. `completion` runs once it has stopped. | +| `Bugsee.StopAsync()` | `Task` | `Stop` that completes once the SDK has stopped. | +| `Bugsee.DeleteCollectedDataOnDevice(...)` | `void` or `Task` | Stops the SDK and deletes the data it collected. See [Delete collected data](#delete-collected-data). | + +The `options` argument takes `AndroidLaunchOptions`, `IOSLaunchOptions` or `OptionsBuilder`; see [Configuration](/sdk/unity/configuration). + +```csharp +using System.Threading.Tasks; +using Bugsee.Contracts.Options; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public class BugseeLifecycleExample : MonoBehaviour +{ + const string AppToken = ""; + + async void Start() + { + bool accepted = await BugseeSdk.LaunchAsync(AppToken, BuildOptions(videoOn: true)); + Debug.Log("Bugsee accepted the launch: " + accepted); + } + + // Relaunch with a new option set. Pass every option you want, not only the one that changes. + public async void RestartWithoutVideo() + { + bool accepted = await BugseeSdk.RelaunchAsync(BuildOptions(videoOn: false)); + Debug.Log("Bugsee accepted the relaunch: " + accepted); + } + + // To change the token, stop first and launch again. + public async void SwitchToken(string newToken) + { + await BugseeSdk.StopAsync(); + BugseeSdk.Launch(newToken, BuildOptions(videoOn: true)); + } + + static OptionsBuilder BuildOptions(bool videoOn) => + new OptionsBuilder() + .CaptureVideo(videoOn) + .Set(Options.ReportingTriggerByShake, true); +} +``` + +### What each call guarantees + +- **`Launch` and `LaunchAsync`** start a session when the SDK accepts the request. They do not wait for the native SDK to finish launching. A launch made while a stop is in flight waits for the stop. A launch while the SDK is already running ignores the new token and the new native options. On iOS, the managed capture options (`CaptureManagedExceptions`, `CaptureUnobservedTaskExceptions`) are applied again by such a repeated launch, so it can change or switch off managed exception capture in a running session. Android leaves the managed capture hooks unchanged. +- **`Relaunch` and `RelaunchAsync`** replace the whole option set; they do not merge. Every native option you leave out goes back to its default, and a `Relaunch()` without options resets every option. Handlers, filters and the lifecycle listener are kept. `TreatUnityLogExceptionsAsFatal` is read only when the managed exception hooks are installed, so a relaunch that keeps the hooks does not change it. Android ignores a `Relaunch` unless the status is `Launched`. +- **`Stop` and `StopAsync`** stop the SDK. The `Stop` completion runs when the SDK has reported the stop. A `Launch` or `Relaunch` requested during the stop waits for it, and the completion runs before that launch does. If the completion itself calls `Launch`, that call replaces the waiting one. An unfinished managed `IReport` and an in-flight managed upload are dropped by a stop. +- **`LaunchAsync` and `RelaunchAsync`** complete `true` when the SDK accepted the request. They complete `false` when the SDK refused it, or when a later request cancelled it while it waited. If the SDK gives no answer within 10 seconds, they complete `true` when the status is `Launching` or `Launched`, and `false` otherwise. +- **`StopAsync`** completes when the SDK has reported the stop, even if a `Launch` follows. It faults with `TimeoutException` when the SDK has not reported the stop within 10 seconds of the call. + +### Threads and ordering + +These calls do not wait for the native SDK. They are handed to the Unity main thread. + +- **Android**: a call from another thread is queued and never refused. `Launch`, `Relaunch` and `DeleteCollectedDataOnDevice` run one at a time, in request order. A queued `Launch` replaces earlier queued `Launch` and `Relaunch` requests. A `Relaunch` requested while another `Relaunch` is in flight joins it: it gets that relaunch's outcome, and its own options are ignored (a warning says so). `Stop` is not queued behind the others: it starts at once and drops every queued `Launch` and `Relaunch`. A `Stop` that arrives while a relaunch is stopping, or before its launch has begun, cancels the relaunch, and the relaunch completes `false`. +- **iOS**: a call from another thread waits up to 5 seconds for the main thread to take it. If it does not, the request does not run and an error is logged: `LaunchAsync` and `RelaunchAsync` complete `false`, and `StopAsync` faults with `TimeoutException`. Stops and the delete's wipe run one at a time. A `Launch` or `Relaunch` requested while a stop or a wipe is in flight waits until the SDK reports it finished. A later `Launch` or `Relaunch` replaces the waiting one, and a later `Stop` or `DeleteCollectedDataOnDevice` cancels it. + +### Deadlines + +If the native SDK does not report back, the package stops waiting: + +- After **10 seconds** it answers the caller with a warning: the `Stop` completion runs, `StopAsync` faults, and `LaunchAsync` and `RelaunchAsync` complete from the current status. The native operation stays in flight, and a launch requested meanwhile still waits for it. +- After **60 seconds** it stops waiting for a stop and moves on, with a warning. A late report from the native SDK is ignored. + +## Status + +`Bugsee.Status` returns a `BugseeStatus`, and `Bugsee.IsLaunched` returns whether the SDK is launched. + +| `BugseeStatus` | Meaning | +| --- | --- | +| `Stopped` | Not running. | +| `Launching` | Starting up. | +| `Launched` | Running. | +| `Stopping` | Shutting down. | + +```csharp +using Bugsee.Contracts.Lifecycle; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStatusExample +{ + public static bool IsRecording() => BugseeSdk.Status == BugseeStatus.Launched; +} +``` + +In the Unity Editor, `Launch` does nothing: `Status` is `Stopped`, `IsLaunched` is `false`, `LaunchAsync` completes `false` and `StopAsync` completes at once. Test launch, capture and reporting on a device. The Editor does not record or send anything. + +## Delete collected data + +`Bugsee.DeleteCollectedDataOnDevice()` stops the SDK if needed, deletes the data it collected on the device, and leaves the SDK stopped. Call `Launch` again to resume. It returns nothing; a failure is only logged. + +To get the result, or to delete less, use `DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)`, which returns `Task`, or the synchronous `DeleteCollectedDataOnDevice(DeleteScope scope)`. + +| `DeleteScope` | Deletes | Keeps | +| --- | --- | --- | +| `CaptureOnly` | The recorded capture. | Report snapshots and report bundles waiting for upload. | +| `CaptureAndIntermediate` | The capture and the report snapshots. | Report bundles waiting for upload. | +| `Everything` | Everything the SDK collected on disk, including report bundles not uploaded yet. This is the default. | Nothing. | + +The task completes `true` when the SDK reported the data deleted. It completes `false` when the SDK refused, gave no answer in time, or on iOS the call did not reach the main thread within 5 seconds. A timeout is a `false`, not a `TimeoutException`. On Android the time is counted from when the delete starts and is 10 seconds, stop included. On iOS the stop and the wipe each give up after 60 seconds. An undefined `DeleteScope` value throws `ArgumentOutOfRangeException`. On Android, the plain call deletes finished reports that were not uploaded yet; use `DeleteScope.CaptureAndIntermediate` to keep them. + +See [Privacy: Cleanup](/sdk/unity/privacy/cleanup) for how this fits with data retention. + +## Lifecycle events + +The SDK reports its transitions as events. You can receive them two ways, and both fire for every event: + +- `Bugsee.LifecycleEvent`, a static `event Action`. +- `Bugsee.SetLifecycleEventListener(ILifecycleEventListener listener)`. The listener has one method, `OnEvent(string eventType, object data)`. A second call replaces the first listener. + +Handlers run on the Unity main thread, on iOS and Android alike. The package keeps up to 128 events that the native SDK announces before it is listening, for example from a launch made natively before any C# call, and delivers them in order shortly after you launch. + +`data` is `null` or a `string`: the snapshot or request id for the report events. The native SDKs send nothing else. + +```csharp +using Bugsee.Contracts.Lifecycle; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public sealed class BugseeListener : ILifecycleEventListener +{ + public void OnEvent(string eventType, object data) + { + switch (eventType) + { + case LifecycleEvents.Launched: + Debug.Log("Bugsee is running"); + break; + case LifecycleEvents.RelaunchedAfterCrash: + Debug.Log("The previous session ended with a crash"); + break; + case LifecycleEvents.AfterReportUploaded: + Debug.Log("Report uploaded: " + data); + break; + } + } +} + +public static class BugseeListenerSetup +{ + public static void Register() => BugseeSdk.SetLifecycleEventListener(new BugseeListener()); +} +``` + +Compare `eventType` against the constants on `LifecycleEvents`, never against literal strings: + +| Constant | Dispatched when | +| --- | --- | +| `Launching` | The SDK is starting. | +| `Launched` | The SDK has launched. | +| `Stopping` | The SDK is stopping. | +| `Stopped` | The SDK has stopped. | +| `RelaunchedAfterCrash` | The SDK launched and found a crash left by an earlier run. | +| `BeforeReportShown`, `AfterReportShown` | The report dialog is about to be shown, or has been shown. | +| `BeforeReportAssembled`, `AfterReportAssembled`, `ReportAssemblyFailed` | The stages of assembling a report. | +| `BeforeReportUploaded`, `AfterReportUploaded` | A report is about to be uploaded, or was uploaded. | +| `ReportUploadFailedWithFutureRetry`, `ReportUploadFailed` | An upload failed and will be retried later, or failed for good. | +| `BlackoutStarted`, `BlackoutEnded` | A [blackout](/sdk/unity/privacy/video) began or ended. | +| `BeforeFeedbackShown`, `AfterFeedbackShown` | The [feedback](/sdk/unity/feedback) screen is about to be shown, or has been shown. | + +The constants mirror the Android SDK's list. The native SDKs decide which events they send; for example, the iOS SDK reserves the feedback events and does not dispatch them yet (see [iOS lifecycle events](/sdk/ios/lifecycle#available-lifecycle-events)). + +## iOS early launch + +If you turned on iOS native early launch at export, the SDK starts at app launch, before the first scene, and the first `Bugsee.Launch` adopts that running session instead of starting a second one. See [iOS build setup](/sdk/unity/build-setup/ios#early-launch). + +## Related pages + +- [Configuration](/sdk/unity/configuration): the launch options. +- [Installation](/sdk/unity/installation): add the package and make the first launch. +- [Privacy: Cleanup](/sdk/unity/privacy/cleanup): delete collected data and limit retention. +- [Report handler](/sdk/unity/report-handler): change reports before and after they upload. diff --git a/docs/sdk/unity/logs.mdx b/docs/sdk/unity/logs.mdx index 2731ae73..9c7d445e 100644 --- a/docs/sdk/unity/logs.mdx +++ b/docs/sdk/unity/logs.mdx @@ -1,6 +1,6 @@ --- title: "Console logs" -description: "TODO(writer-C): Console logs for the Bugsee Unity SDK 7.x." +description: "How the Bugsee Unity SDK 7.x captures the Unity console, how to write your own log lines with Bugsee.Log, the log options, and how to filter or redact log lines with SetLogEventFilter." sidebar_position: 8 slug: "/sdk/unity/logs" --- @@ -9,4 +9,123 @@ slug: "/sdk/unity/logs" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Bugsee records the app's log output and attaches it to every report, so you can read what the game was saying before something went wrong. + +## What is captured + +**Unity console.** The SDK subscribes to Unity's `Application.logMessageReceivedThreaded` event when you launch it and unsubscribes when you stop it. Every `Debug.Log`, `Debug.LogWarning`, `Debug.LogError` and `Debug.LogAssertion` line, from any thread, is forwarded to the native SDK. Lines logged from other threads are handed to the Unity main thread first. + +| Unity `LogType` | Bugsee `LogLevel` | +| --- | --- | +| `Log` | `Info` | +| `Warning` | `Warning` | +| `Error`, `Assert` | `Error` | +| `Exception` | Not forwarded as a log line | + +- If Unity supplies a stack trace for the line, the SDK appends it to the message after a line break. +- `LogType.Exception` lines are not forwarded as logs. Exceptions are reported through the exception pipeline instead. See [Crash & error reporting](/sdk/unity/manual/crash-error-reporting). + +**Native logs.** The native SDKs capture their own sources too. On Android that includes Logcat. See [Android console logs](/sdk/android/logs) and [iOS console logs](/sdk/ios/logs). + +In the Unity Editor, and on platforms other than Android and iOS, log calls do nothing. + +## Options + +Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [Configuration](/sdk/unity/configuration) for the full tables. The defaults are those of the native SDKs the package pins. + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `CaptureLogs` | Both | `bool` | `true` | Capture logs. Unity console lines and, on Android, Logcat are recorded while it is on. | +| `CaptureLogsLevel` | Both | `LogLevel` | `Verbose` | Lines more verbose than this level are dropped. | +| `CaptureLogsUseAllSources` | Android | `bool` | `false` | Read all Logcat buffers (system, radio and others) instead of the default sources. | + +`LogLevel` has the values `Error` (1), `Warning` (2), `Info` (3), `Debug` (4) and `Verbose` (5). + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + CaptureLogs = true, + CaptureLogsLevel = LogLevel.Info, +}; +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + CaptureLogs = true, + CaptureLogsLevel = LogLevel.Info, +}; +#endif + +BugseeSdk.Launch("", options); +``` + +To turn log capture off, set `CaptureLogs = false`. See [Privacy: console logs](/sdk/unity/privacy/logs). + +## Write your own log lines + +`Bugsee.Log` adds a line to the Bugsee log without printing it to the Unity console. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +// The level defaults to Info. +BugseeSdk.Log("User tapped Checkout"); + +BugseeSdk.Log("Payment succeeded", LogLevel.Info); +BugseeSdk.Log("Retrying request", LogLevel.Warning); +BugseeSdk.Log("Upload failed", LogLevel.Error); +``` + +- `Bugsee.Log(string message, LogLevel level = LogLevel.Info)` skips the log filter. +- `Bugsee.Log(string message, LogLevel level, bool requiresFiltering)` also runs the line through the filter when `requiresFiltering` is `true`. Use it when the message can hold data that your filter redacts. +- Both overloads do nothing for a `null` message or before the SDK is launched. +- Lines written with `Bugsee.Log` are recorded, and the ones that opt in are filtered, even with `CaptureLogs` off. +- On iOS, a line below `CaptureLogsLevel` is dropped before it reaches the filter. On Android, `CaptureLogsLevel` applies only to Logcat lines. An opt-in `Debug` line under `CaptureLogsLevel = LogLevel.Error` never reaches the filter on iOS. + +## Filter log lines + +`Bugsee.SetLogEventFilter` installs a filter that sees each captured log line before it is stored. Change the line and return it to keep it, or return `null` to drop it. Pass `null` to remove the filter. + +```csharp +using System.Text.RegularExpressions; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.SetLogEventFilter(log => +{ + if (log.Message == null) return log; + + // Drop lines you never want in a report. + if (log.Message.Contains("[private]")) return null; + + // Redact email addresses. + log.Message = Regex.Replace(log.Message, @"[\w.+-]+@[\w-]+\.[\w.]+", ""); + return log; +}); +``` + +The event has two settable properties: `Message` (`string`) and `Level` (`LogLevel`). + +The filter sees the Unity console lines the SDK forwards and, on Android, Logcat lines, as long as `CaptureLogs` is on. Lines written with `Bugsee.Log(message, level)` skip it. Pass `requiresFiltering: true` to send a line through it. + +Keep these rules in mind: + +- **Set the filter before the lines you want filtered are logged.** A line recorded before the filter is set is not filtered. +- **Do not keep the event.** It is valid only inside the callback. +- **Do not call `Bugsee.Log(..., true)` from inside the filter.** Android runs the filter during the `Log` call, so that recurses. +- **A filter that throws drops the line.** +- **The filter runs on the Unity main thread.** On Android the SDK calls it on its own threads and the package hands each call to the main thread, which processes its queue in `Update`. While the app is in the background Unity's loop is paused, so the call waits until the app resumes. On Android the SDK drops a line if its log filter does not answer within 10 seconds. +- **A filter that blocks forever blocks the main thread.** Keep it short. + +For privacy guidance, see [Privacy: console logs](/sdk/unity/privacy/logs). + +## Related pages + +- [Network events](/sdk/unity/network) +- [Breadcrumbs](/sdk/unity/breadcrumbs) +- [Crash & error reporting](/sdk/unity/manual/crash-error-reporting) +- [Privacy: console logs](/sdk/unity/privacy/logs) diff --git a/docs/sdk/unity/manual/bug-reporting.mdx b/docs/sdk/unity/manual/bug-reporting.mdx index b78ddc59..8af44da0 100644 --- a/docs/sdk/unity/manual/bug-reporting.mdx +++ b/docs/sdk/unity/manual/bug-reporting.mdx @@ -1,6 +1,6 @@ --- title: "Bug reporting" -description: "TODO(writer-B): Bug reporting for the Bugsee Unity SDK 7.x." +description: "File bug reports from a Unity game with Bugsee SDK 7.x: the built-in triggers, the report dialog, silent uploads, reports you build in code, and severity." sidebar_position: 1 slug: "/sdk/unity/manual/bug-reporting" --- @@ -9,4 +9,188 @@ slug: "/sdk/unity/manual/bug-reporting" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +A bug report is a recording of what happened (video, console logs, network events, events and traces) plus a summary, a description, labels and a severity. A player files one from the report dialog, you file one from code, or a trigger you turned on opens the dialog. + +Call these methods after the SDK has launched: see [Lifecycle & status](/sdk/unity/lifecycle). In the Unity Editor they do nothing (`CreateReport` and `Upload(report)` throw, see below), so test on an Android or iOS device. + +The snippets on this site call the facade through the alias `using BugseeSdk = Bugsee.Bugsee;`. See [Installation](/sdk/unity/installation#launch-the-sdk) for why. + +## Built-in report triggers + +Four triggers can open the report dialog. In 7.x all of them are off until you turn them on. The shake trigger and the Android notification-bar trigger were on by default in 6.x. + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `ReportingTriggerByShake` | Android, iOS | `bool` | `false` | Shaking the device opens the dialog. | +| `ReportingTriggerByScreenshot` | Android, iOS | `bool` | `false` | Taking a system screenshot opens the dialog. | +| `ReportingTriggerByNotification` | Android | `bool` | `false` | A notification-bar entry opens the dialog. Set on `AndroidLaunchOptions`. | +| `ReportingTriggerByBroadcast` | Android | `bool` | `false` | A broadcast opens the dialog. Set on `AndroidLaunchOptions`. | + +Set them in the launch options. The Android-only options exist on `AndroidLaunchOptions` only: + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + ReportingTriggerByShake = true, + ReportingTriggerByScreenshot = true, + ReportingTriggerByNotification = true, +}; +BugseeSdk.Launch("", options); +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + ReportingTriggerByShake = true, + ReportingTriggerByScreenshot = true, +}; +BugseeSdk.Launch("", options); +#endif +``` + +For what each trigger does on the device, see the native pages: [Android](/sdk/android/manual/bug-reporting) and [iOS](/sdk/ios/manual/bug-reporting). Every launch option is listed in [Configuration](/sdk/unity/configuration). + +## Show the report dialog + +`ShowReportDialog` opens the dialog from your own UI, for example a "Report a problem" button: + +```csharp +public static void ShowReportDialog( + string summary = "", + string description = "", + IssueSeverity? severity = null, + IList labels = null) +``` + +All parameters are optional and pre-fill the form: + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.ShowReportDialog(); + +BugseeSdk.ShowReportDialog( + "Cannot join the match", + "The lobby never loads after the splash screen.", + IssueSeverity.High, + new List { "multiplayer", "lobby" }); +``` + +`severity` is `IssueSeverity?`. Leave it out (or pass `null`) and the SDK uses the `ReportingDefaultBugPriority` launch option, which is `High` unless you set it. An explicit value is used as given. The enum values are: + +| `IssueSeverity` | Value | +| --- | --- | +| `VeryLow` | 1 | +| `Medium` | 2 | +| `High` | 3 | +| `Critical` | 4 | +| `Blocker` | 5 | + +In 6.x the call was `ShowReport(...)`. In 7.x it is `ShowReportDialog(...)`. + +### Report form options + +These launch options change the dialog. They are shared by both platforms unless noted: + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `ReportingUISummaryRequired` | Android, iOS | `bool` | `false` | The summary field must be filled in. | +| `ReportingUIDescriptionRequired` | Android, iOS | `bool` | `false` | The description field must be filled in. | +| `ReportingUIEmailRequired` | Android, iOS | `bool` | `false` | The email field must be filled in. | +| `ReportingUILabelsEnabled` | Android, iOS | `bool` | `false` | Shows the labels field. | +| `ReportingUILabelsRequired` | Android, iOS | `bool` | `false` | At least one label is required. | +| `ReportingUIPrioritySelectorEnabled` | Android, iOS | `bool` | `false` | Shows the severity selector. | +| `ReportingUIStyle` | iOS | `ReportingUIStyle` | `System` | The look of the report screen: `Light`, `Dusk`, `BasedOnStatusBar` or `System`. Set on `IOSLaunchOptions`. | + +To change colors and placeholder texts of the dialog, see [Appearance](/sdk/unity/appearance). + +## Upload a report without UI + +`Upload` creates and sends a report with no dialog: + +```csharp +public static void Upload( + string summary, + string description = "", + IssueSeverity? severity = null, + IList labels = null) +``` + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Upload("Save file is corrupted", "Slot 2 failed the checksum on load.", IssueSeverity.Critical); +``` + +An omitted `severity` is handled as for `ShowReportDialog`: the SDK applies `ReportingDefaultBugPriority`. + +:::warning +Do not call `Upload` from automated error paths. To report a caught exception, use [`Bugsee.LogException`](/sdk/unity/manual/crash-error-reporting#report-a-handled-exception): the report then carries the stack trace and is grouped with the other occurrences of the same error. +::: + +## Build a report in code + +`CreateReport` returns an `IReport` you fill in, then send with `Upload(IReport)`. Use it when you need to set an attribute or an attachment on the report, or when you collect the fields over time: + +```csharp +using System.Text; +using Bugsee.Contracts.Options; +using Bugsee.Contracts.Reporting; +using BugseeSdk = Bugsee.Bugsee; + +IReport report = BugseeSdk.CreateReport(); +report.Summary = "Checkout failed"; +report.Description = "The payment sheet closed without a result."; +report.Severity = IssueSeverity.High; +report.AddLabel("checkout"); +report.SetAttribute("order_id", "A-1721"); +report.AddAttachmentBytes(Encoding.UTF8.GetBytes("{\"retries\":3}"), "state.json", "application/json"); + +BugseeSdk.Upload(report); +``` + +To drop a report you do not want to send, call `BugseeSdk.Discard(report)`. + +Rules for `CreateReport`: + +- Only one report can be open at a time. A second `CreateReport` before `Upload(report)` or `Discard(report)` throws `InvalidOperationException`. +- `Upload(report)` and `Discard(report)` accept only the report object that `CreateReport` returned. Another `IReport` throws `ArgumentException`. +- The report is a snapshot that the SDK turns into a native report when you upload it. It has no report `Id` yet, its `Type` is `Bug`, and it holds no screenshots: `ScreenshotDisplayIds` is empty and `SetScreenshotPng` returns `false`. +- `IReport.Email` is used on Android. On iOS it is dropped with a warning: use `Bugsee.SetUserIdentifier` instead. See [User & session data](/sdk/unity/user-session-data). +- In the Unity Editor, `CreateReport` and `Upload(report)` throw `NotSupportedException`. + +`IReport.Severity` is `IssueSeverity?`. `null` means unset, and the SDK then applies its default. The value `0` is not a severity and counts as unset. + +The members of `IReport` are the same ones a [report handler](/sdk/unity/report-handler) receives: + +| Area | Members | +| --- | --- | +| Identity | `Id`, `Type` (`Bug`, `Crash` or `Error`) | +| Text | `Summary`, `Description`, `Email` | +| Severity | `Severity` | +| Labels | `Labels`, `AddLabel`, `SetLabels`, `ClearLabels` | +| Attributes | `Attributes`, `GetAttribute`, `SetAttribute`, `RemoveAttribute`, `ClearAllAttributes` | +| Attachments | `Attachments`, `AddAttachmentFile`, `AddAttachmentBytes`, `ClearAttachments` | + +On a report from `CreateReport`, `AddAttachmentFile(path, name, mimeType)` copies the file when you call it, so you can delete the original afterwards. It returns `null` when the file does not exist. Attachment count and size limits come from the native SDKs: see [Attachments](/sdk/unity/report-handler#attachments). + +## Default severities + +A report gets a default severity unless you set one in the call or in a report handler: + +| Report | Option | Default | +| --- | --- | --- | +| Bug report | `ReportingDefaultBugPriority` | `High` | +| Error (handled exception) | `ReportingDefaultErrorPriority` | `High` | +| Crash | `ReportingDefaultCrashPriority` | `Blocker` | + +All three are `IssueSeverity` properties on the launch options and apply to both platforms. + +## Add context to the report + +A report includes the events, traces, attributes, breadcrumbs and logs recorded before it. See [Custom events & traces](/sdk/unity/events-and-traces), [User & session data](/sdk/unity/user-session-data), [Breadcrumbs](/sdk/unity/breadcrumbs) and [Console logs](/sdk/unity/logs). To change a report before it is uploaded, use a [report handler](/sdk/unity/report-handler). For what a report may contain and how to limit it, see [Privacy: Report](/sdk/unity/privacy/report). diff --git a/docs/sdk/unity/manual/crash-error-reporting.mdx b/docs/sdk/unity/manual/crash-error-reporting.mdx index b976403e..64a0ebf4 100644 --- a/docs/sdk/unity/manual/crash-error-reporting.mdx +++ b/docs/sdk/unity/manual/crash-error-reporting.mdx @@ -1,6 +1,6 @@ --- title: "Crash & error reporting" -description: "TODO(writer-B): Crash & error reporting for the Bugsee Unity SDK 7.x." +description: "What Bugsee Unity SDK 7.x reports automatically (native crashes, unhandled and logged C# exceptions), how to report handled and unhandled exceptions yourself, and what the SDK cannot see." sidebar_position: 2 slug: "/sdk/unity/manual/crash-error-reporting" --- @@ -9,4 +9,241 @@ slug: "/sdk/unity/manual/crash-error-reporting" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +Most crashes and errors are reported **automatically** once `Bugsee.Launch` has run. This page lists what is captured, how each kind is reported, and how to report exceptions yourself. + +Bugsee files two kinds of report here: + +- A **crash** report, for something that ended the app. Its default severity is `Blocker` (`ReportingDefaultCrashPriority`). +- An **error** report, for a handled, non-fatal exception. Its default severity is `High` (`ReportingDefaultErrorPriority`). + +Both are `IssueSeverity` launch options and apply to both platforms. In the snippets on this page, `BugseeSdk` is the alias `using BugseeSdk = Bugsee.Bugsee;`, see [Installation](/sdk/unity/installation#launch-the-sdk). + +## What is captured automatically + +A Unity game has two layers of crash handling. The **native** layer is the Bugsee Android and iOS SDK, which catches crashes in the native runtime. The **managed** layer is the Unity wrapper, which catches C# exceptions. They are controlled by separate options. + +| Source | Reported as | Controlled by | +| --- | --- | --- | +| Native crash: fatal signal, uncaught native exception. Reported on the next launch | crash | `DetectAndReportCrash` (default on) | +| `AppDomain.UnhandledException` | crash | `CaptureManagedExceptions` (default on) | +| An exception Unity logs, including `Debug.LogException` and uncaught exceptions on the main thread | error, or crash with `TreatUnityLogExceptionsAsFatal` | `CaptureManagedExceptions` | +| `TaskScheduler.UnobservedTaskException` | error | `CaptureManagedExceptions` and `CaptureUnobservedTaskExceptions` (default on) | +| `Bugsee.LogException` | error | You call it | +| `Bugsee.LogUnhandledException` | crash | You call it | + +`CaptureManagedExceptions` does not depend on `DetectAndReportCrash`. Hangs, ANRs and out-of-memory kills are separate detectors: see [Issue detection](/sdk/unity/issue-detection/overview). + +### Managed exceptions + +With `CaptureManagedExceptions` on, the SDK registers these hooks during `Launch`: + +- A wrapper around `Debug.unityLogger.logHandler`, which receives `Debug.LogException` and the exceptions Unity logs itself. The SDK passes each call on to the handler it replaced. +- `Application.logMessageReceivedThreaded`, for exceptions Unity logs without going through the handler. An exception already reported through the handler is not reported twice. +- `AppDomain.CurrentDomain.UnhandledException`. +- `TaskScheduler.UnobservedTaskException`, unless the project is compiled with the `NET_LEGACY` define or `CaptureUnobservedTaskExceptions` is `false`. + +An exception that reaches none of these hooks is not reported. + +Options: + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `CaptureManagedExceptions` | Android, iOS | `bool` | `true` | Installs the hooks above. A `Relaunch` applies a changed value. | +| `CaptureUnobservedTaskExceptions` | Android, iOS | `bool` | `true` | Reports `TaskScheduler.UnobservedTaskException` as an error. Needs `CaptureManagedExceptions`. | +| `TreatUnityLogExceptionsAsFatal` | Android, iOS | `bool` | `false` | Reports exceptions that Unity logs as crashes instead of errors. | + +An uncaught exception that Unity logs is reported as an error, because the game keeps running. Set `TreatUnityLogExceptionsAsFatal` to report these as crashes. When a crash report is made on a background thread, the call waits up to 4 seconds for Unity's main thread to take it. + +Unity raises `UnobservedTaskException` only after the faulted `Task` is garbage-collected, so that error arrives late, at a time you do not control. Set `CaptureUnobservedTaskExceptions` to `false` if your fire-and-forget tasks fault on purpose. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + CaptureManagedExceptions = true, + CaptureUnobservedTaskExceptions = false, + TreatUnityLogExceptionsAsFatal = true, +}; +BugseeSdk.Launch("", options); +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + CaptureManagedExceptions = true, + CaptureUnobservedTaskExceptions = false, + TreatUnityLogExceptionsAsFatal = true, +}; +BugseeSdk.Launch("", options); +#endif +``` + +### Exceptions the SDK cannot see + +- **A `ThreadPool` work item on the Mono backend.** On the Mono scripting backend, an exception thrown inside a `ThreadPool.QueueUserWorkItem` callback can be lost: Unity logs nothing and `AppDomain.UnhandledException` is not raised, so no hook sees it. On IL2CPP the exception reaches `AppDomain.UnhandledException` and is reported. A `new Thread` that throws is logged by Unity and reported on both backends. +- **`Task.Run` and a dropped `async Task`.** The exception is stored in the `Task` and nothing is logged. It is reported only if the runtime finalizes the faulted task and raises `UnobservedTaskException`, which depends on garbage collection. The report can arrive late, or not at all if the app exits first. Await your tasks or handle their faults. + +To report an exception from a work item or a task continuation, catch it and call `Debug.LogException`. The SDK's log handler builds the report and hands it to Unity's main thread, so the call is safe from a background thread: + +```csharp +using System; +using System.Threading; +using UnityEngine; + +ThreadPool.QueueUserWorkItem(_ => +{ + try { DoWork(); } + catch (Exception e) { Debug.LogException(e); } +}); +``` + +`Debug.LogException` also prints the exception to the Unity console, and it reports only while `CaptureManagedExceptions` is on. + +### Native crashes + +Native crashes are reported on the next launch of the app, together with the recording of the session that crashed. + +- **Android:** uncaught exceptions in Java and Kotlin code, and crashes in native (NDK) code. The NDK part is the `bugsee-android-ndk` extension, which the package declares for you. The option `DetectAndReportCrashNdk` (default `true`, `AndroidLaunchOptions`) controls it, and it is also off when `DetectAndReportCrash` is `false`. +- **iOS:** fatal signals and uncaught Objective-C exceptions. `CrashHandlerType` (`IOSLaunchOptions`) selects how they are intercepted: `BSD`, `Mach` or `MachAndBSD` (the default). + +For the details of each platform, see the native pages: [Android crashes](/sdk/android/issue-detection/crashes), [Android native crashes](/sdk/android/issue-detection/native-crashes) and [iOS crashes](/sdk/ios/issue-detection/crashes). + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `DetectAndReportCrash` | Android, iOS | `bool` | `true` | Native crash reporting. | +| `DetectAndReportEarlyCrash` | Android, iOS | `bool` | `true` | Early-crash detection of the native SDK. See the native pages. | +| `CrashSignals` | Android, iOS | `CrashSignals` | `Default` | Which fatal signals the native crash reporter intercepts. | +| `CrashHandlerType` | iOS | `CrashHandlerType` | `MachAndBSD` | How the iOS crash reporter intercepts crashes. | +| `DetectAndReportCrashNdk` | Android | `bool` | `true` | Native (NDK) crash detection. | +| `CrashNdkIncludeTombstoneLogs` | Android | `bool` | `false` | Adds the raw log buffers of the OS tombstone to a native crash report. | + +:::warning[Tombstone logs are not redacted] +With `CrashNdkIncludeTombstoneLogs` on, the log buffers of the Android tombstone are uploaded as they are. They skip Bugsee's log filters and redaction, and can contain text logged in-process by system or third-party libraries. +::: + +#### Crash signals + +`CrashSignals` is a `[Flags]` enum with one bit per signal. Combine values to choose which signals the native reporter intercepts: + +| Value | Bit | Signal | +| --- | --- | --- | +| `None` | 0 | No signals. | +| `Abrt` | 1 | `SIGABRT` | +| `Segv` | 2 | `SIGSEGV` | +| `Bus` | 4 | `SIGBUS` | +| `Ill` | 8 | `SIGILL` | +| `Fpe` | 16 | `SIGFPE` | +| `Trap` | 32 | `SIGTRAP` | +| `All` | 63 | Every signal above. | +| `Default` | 128 | Let the SDK choose: every signal. | + +```csharp +using Bugsee.Contracts.Options; + +var options = new IOSLaunchOptions +{ + CrashSignals = CrashSignals.Abrt | CrashSignals.Segv | CrashSignals.Bus, +}; +``` + +Rules: + +- `Default` is honored only on its own. Combined with other bits, the value is used as given and the `Default` bit means nothing. +- `None` selects no signal on both platforms. +- Android reads the mask in the NDK extension. A nonzero value that selects none of the six signals (for example `64`) is also taken as every signal, and bits above `Trap` are ignored. iOS uses any other value as given. +- `CrashSignals` is a shared option, so a mask you set for iOS only also applies to Android if it is in the options you pass there. Set it per platform, or omit it on Android, to keep every signal. +- Keep `Segv` and `Bus`. IL2CPP raises `NullReferenceException` with explicit null checks, not from a signal, so managed null references never reach the native crash reporter. A real memory fault would go unreported without these two signals. +- On iOS a bad memory access arrives as one Mach exception that the kernel turns into `SIGSEGV` or `SIGBUS`, so it is intercepted when either of the two is selected. Leaving out `Abrt` also stops uncaught Objective-C exceptions from being reported, because they end in `abort()`. + +:::caution[iOS Simulator and debugger] +The iOS Simulator build of the Bugsee SDK has no crash reporter. On the Simulator, native crashes, hang detection and managed exceptions (`LogException`, `Debug.LogException`, `LogUnhandledException`, `AppDomain.UnhandledException`) are not reported. Manual bug reports, uploads, logs, events and video still work. Test crash reporting on a physical device. While the Xcode debugger is attached, the iOS SDK installs no crash handler: start the app from the Home Screen. See [iOS crashes](/sdk/ios/issue-detection/crashes). +::: + +## Report a handled exception + +`Bugsee.LogException` records an exception you caught, as an **error** report, without ending the app: + +```csharp +public static void LogException(Exception exception, IDictionary options = null) +``` + +```csharp +using System; +using BugseeSdk = Bugsee.Bugsee; + +try +{ + LoadProfile(); +} +catch (Exception e) +{ + BugseeSdk.LogException(e); + ShowOfflineBanner(); +} +``` + +Notes: + +- A `null` exception is ignored. +- Report an exception you threw, not one you only created. For a thrown exception on an IL2CPP player, the SDK also sends the native addresses of the stack, which let Bugsee resolve file and line numbers. A `new Exception(...)` that was never thrown has no native stack. +- On iOS, the options dictionary honors only the key `skipFrames`. The keys `labels`, `includeVideo` and `mergingRules` are ignored, with a one-time warning in the Unity console and the native log. A logged exception takes no labels and always carries the live capture. To set labels, use a [report handler](/sdk/unity/report-handler). +- In 7.x the SDK computes a new signature for managed exceptions (user frames only, never the message). Issues grouped before you update to 7.x can regroup. +- From a background thread, report with `Debug.LogException` as described above. + +## Report an unhandled exception + +`Bugsee.LogUnhandledException` reports an exception as a **crash**. Use it for an exception your game treats as fatal that Bugsee's hooks did not see, for example because your own error handler takes it first: + +```csharp +using System; +using BugseeSdk = Bugsee.Bugsee; + +void OnFatalError(Exception e) +{ + BugseeSdk.LogUnhandledException(e); + // End the session your own way. +} +``` + +For uncaught exceptions, prefer the automatic capture above: you do not need to call `LogUnhandledException` for exceptions that reach `AppDomain.UnhandledException`. For handled exceptions, use `LogException`. + +## Stack traces and symbolication + +How much of a stack trace Bugsee can resolve to C# class, file and line depends on the scripting backend and the build type: + +| Build | What the stack carries | +| --- | --- | +| Mono, Development build | A portable `.pdb` ships next to each assembly, so the stack text has file and line for the assemblies Unity compiles. | +| Mono, not a Development build | Method names and IL offsets only. Bugsee resolves file and line from a mapping that the Editor builds from the portable `.pdb` files and uploads. Android only: Mono is not available on iOS. | +| IL2CPP with line information | If Player Settings sets the IL2CPP stack trace information to **Method Name, File Name, and Line Number** (or Script Debugging), the stack text carries file and line. | +| IL2CPP without line information | The SDK sends the native addresses of a thrown exception. Bugsee resolves them with the il2cpp line map and the native symbols you upload. | + +The mapping and symbols are uploaded by the build. See [Symbolication](/sdk/unity/symbolication/overview), and the pages for [Android](/sdk/unity/symbolication/android), [iOS](/sdk/unity/symbolication/ios) and [managed code](/sdk/unity/symbolication/managed-code). + +### Known issues + +These apply to Bugsee Unity SDK 7.0.0-beta.1: + +- **Android, Release IL2CPP, Public symbols.** Handled managed exceptions in a Release IL2CPP build without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public (symbol table only). Use Debugging symbols with the il2cpp line map: set **Create symbols.zip** to **Debugging** in Player Settings, use the menu **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload**, or set `BUGSEE_ANDROID_FULL_SYMBOLS=1`. +- **Android, Development IL2CPP.** Development builds send no addresses, and Debugging symbols do not change that. +- **Public, then Debugging.** Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation: [bugsee-unity#263](https://github.com/bugsee/bugsee-unity/issues/263). Choose the symbol level before you upload a build. +- **IL2CPP, exceptions rethrown through `await`.** For an exception thrown in an async continuation and rethrown where it is awaited, the frames before the line `--- End of stack trace from previous location where exception was thrown ---` carry no address and stay unresolved when the build has no IL2CPP line information. Only the frames after the separator resolve. + +## Test crash reporting + +`Bugsee.TestCrash()` crashes the app on purpose, so you can check that crash reporting works: + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.TestCrash(); +``` + +Use it in QA builds only. It ends the process, and the crash report is sent on the next launch. It does nothing in the Unity Editor. + +## Related pages + +- [Issue detection](/sdk/unity/issue-detection/overview): hangs, ANRs, out-of-memory kills and the iOS Crash Report Extension. +- [Report handler](/sdk/unity/report-handler): change severity, labels and attributes of crash and error reports. +- [Configuration](/sdk/unity/configuration): every launch option. diff --git a/docs/sdk/unity/migration.mdx b/docs/sdk/unity/migration.mdx index a99d7077..8390a00f 100644 --- a/docs/sdk/unity/migration.mdx +++ b/docs/sdk/unity/migration.mdx @@ -1,6 +1,6 @@ --- title: "Migrating from 6.x to 7.x" -description: "TODO(writer-F): Migrating from 6.x to 7.x for the Bugsee Unity SDK 7.x." +description: "Move a Unity project from Bugsee Unity SDK 6.x to 7.x: install the package, port the launch code, map renamed and removed APIs and options, and check the changed defaults." sidebar_position: 25 slug: "/sdk/unity/migration" --- @@ -9,4 +9,407 @@ slug: "/sdk/unity/migration" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). ::: -TODO(writer-F) +:::note +This guide compares Bugsee Unity SDK 6.0.x (the `.unitypackage`, namespace `BugseePlugin`) with Bugsee Unity SDK 7.0.0-beta.1. If you are setting up a new project, start from [Installation](/sdk/unity/installation) instead. +::: + +:::note[TL;DR] +7.x is a new package with a new C# API, not an upgrade in place. You install it from a git tag instead of importing a `.unitypackage`, and you delete the 6.x files. The static class is still named `Bugsee`, but it lives in the namespace `Bugsee` (it was `BugseePlugin`), so in your code you alias it: `using BugseeSdk = Bugsee.Bugsee;`. You launch with one call and no scene object: there is no `BugseeLauncher` component. Option names, enums, attachments, lifecycle events and appearance change, and several defaults change. Shake-to-report and the Android notification-bar trigger are off by default. Expect code changes in every file that touches Bugsee. +::: + +## Before you start + +- [ ] Commit or back up your project. The migration deletes the 6.x plugin folder and edits every file that calls Bugsee. +- [ ] Read the Beta banner above. 7.0.0-beta.1 can change between betas, and 6.x stays the stable release. +- [ ] Install 7.x from the pinned git tag with the Unity Package Manager, as described in [Installation](/sdk/unity/installation). Do not install without the `#v7.0.0-beta.1` part. + +## 1. Installation and requirements + +### 1.1 Replace the plugin + +| | 6.x | 7.x | +| --- | --- | --- | +| Distribution | `Bugsee.unitypackage`, imported into `Assets` | Unity Package Manager package `com.bugsee.unity`, from a git tag | +| Where the files go | `Assets/Plugins/Bugsee`, with the native binaries `Bugsee-Unity.aar` (Android) and `Bugsee.a` with headers (iOS) inside | `Packages/`, read-only. The package bundles no native binaries. | +| Native SDKs | Bundled in the plugin folder | Added at build time: Android SDK 7.6.0 through Gradle, iOS SDK 7.1.0 through Swift Package Manager | +| Launch | A `BugseeLauncher` component on an object in your first scene, or a call you make yourself | One call, `Launch`, from any script | +| Namespace and class | `BugseePlugin`, class `Bugsee` (a `MonoBehaviour`) | Namespace `Bugsee`, static class `Bugsee` | + +Do these steps in order: + +1. Delete the folder `Assets/Plugins/Bugsee`. It holds the 6.x scripts, the AAR and the iOS library. +2. Remove the `BugseeLauncher` component from your scene, and the object you created for it, if it has no other use. +3. Remove `gameObject.AddComponent()` from any code that did a manual launch. In 6.x the `Bugsee` class was a component that had to be on a scene object, and the launcher gave that object the name `bgs_gameObject`. In 7.x `Bugsee` is a static class, so `AddComponent()` does not compile, and nothing in your scene is required. The package creates its own helper object, `Bugsee.MainThreadDispatcher`, before the first scene loads. +4. Remove the `BugseeEventsListener` component from your main camera if you added it for GPU information. The 7.x package has no such component. +5. If you edited `Assets/Plugins/BugseeLaunchHandler.cs` or set `BugseeLauncher.AndroidOptionsHandler` and its siblings, move those options into your own launch code (see section 2). +6. Add the package from `https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1`. See [Installation](/sdk/unity/installation). + +The package needs no scoped registry and no custom Gradle template. If your project already uses the External Dependency Manager for other SDKs, it keeps working. See [Android build setup](/sdk/unity/build-setup/android) and [iOS build setup](/sdk/unity/build-setup/ios) for what the package changes in the exported projects. + +### 1.2 Requirements + +7.x needs Unity 2021.3 or later, an iOS 15.0 or later deployment target (the package raises a lower one on export) and Android API 21 or later. See [Overview](/sdk/unity/overview#requirements). + +### 1.3 Namespaces and the name clash + +6.x code wrote `using BugseePlugin;` and then `Bugsee.Launch(...)`. In 7.x the namespace and the static class share the name `Bugsee`, so `Bugsee.Launch(...)` does not compile in code outside the namespace. Alias the class and import the other types by their namespaces: + +```csharp +using Bugsee.Contracts.Options; // options, enums such as IssueSeverity and LogLevel +using BugseeSdk = Bugsee.Bugsee; // the static class +``` + +| Types | 7.x namespace | +| --- | --- | +| The `Bugsee` class | `Bugsee` | +| Launch options, `Options`, `OptionsBuilder`, `IssueSeverity`, `LogLevel`, `FrameRate`, `VideoMode`, `VideoQuality`, `ReportingUIStyle`, `CrashSignals`, `CrashHandlerType` | `Bugsee.Contracts.Options` | +| `IReport`, `IAttachment`, `IReportHandler`, `ReportHandlerBase` | `Bugsee.Contracts.Reporting` | +| `ILifecycleEventListener`, `LifecycleEvents`, `BugseeStatus`, `DeleteScope` | `Bugsee.Contracts.Lifecycle` | +| `IAppearance`, `ReportAppearance`, `FeedbackAppearance` | `Bugsee.Contracts.Appearance` | +| `IFeedback` | `Bugsee.Contracts.Feedback` | +| `INetworkEvent`, `ILogEvent`, `IBreadcrumb`, `EventFilter` | `Bugsee.Contracts.Exchange` | +| `ISpan` | `Bugsee.Contracts.Apm` | + +## 2. Launch + +In 6.x the usual launch was the `BugseeLauncher` component: it held one token field per platform, chose the options with static handlers, and called `Bugsee.Launch` in `Awake` on mobile platforms. Launching from code looked like this. + +```csharp +// 6.x. Namespace BugseePlugin, class Bugsee is a MonoBehaviour. +using BugseePlugin; +using UnityEngine; + +public class MyLaunch : MonoBehaviour +{ + void Awake() + { + gameObject.AddComponent(); // required for a manual launch + +#if UNITY_ANDROID + var options = new AndroidLaunchOptions + { + ShakeToTrigger = true, + NotificationBarTrigger = true, + MaxRecordingTime = 60, + }; + Bugsee.Launch("", options); +#elif UNITY_IOS + var options = new IOSLaunchOptions { ShakeToReport = true }; + Bugsee.Launch("", options); +#endif + } +} +``` + +The 7.x equivalent has no component and no `AddComponent`. The typed options convert to the `Dictionary` that `Launch` takes. + +```csharp +// 7.x +using Bugsee.Contracts.Options; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public class MyLaunch : MonoBehaviour +{ + void Awake() + { +#if UNITY_ANDROID + var options = new AndroidLaunchOptions + { + ReportingTriggerByShake = true, + ReportingTriggerByNotification = true, + Duration = 60, + }; + BugseeSdk.Launch("", options); +#elif UNITY_IOS + var options = new IOSLaunchOptions { ReportingTriggerByShake = true }; + BugseeSdk.Launch("", options); +#endif + } +} +``` + +What changes in how you launch: + +- **One token per platform stays.** App tokens are per platform in both versions. +- **`Launch` throws `ArgumentException` for an empty token.** It does not wait for the native SDK. For the result, use `LaunchAsync`, and read `Bugsee.IsLaunched` and `Bugsee.Status`. See [Lifecycle & status](/sdk/unity/lifecycle). +- **A call without options uses the native SDK defaults.** In 6.x, `Launch(token)` sent the wrapper's own defaults for every option (see section 4). In 7.x the typed properties are write-only and an option you do not set is not sent, so the native SDK applies its default. +- **You can read an option only through `GetLaunchOptions`.** The 6.x option properties had getters. The 7.x ones only have setters, so `options.MaxRecordingTime` style reads do not compile. After launch, `Bugsee.GetLaunchOptions()` returns the effective options. +- **`Relaunch(options)` replaces the whole option set.** Pass the full set again. There is also `RelaunchAsync`. +- **`Stop` takes an optional completion callback**, and there is `StopAsync`. +- **In the Unity Editor and on other platforms, `Launch` does nothing.** Test on a device. +- **The dictionary overload now uses `com.bugsee.option.*` keys.** The 6.x short keys (`Bugsee.ShakeToReportKey`, `MaxRecordingTimeKey` and the other constants, whose values were strings such as `"ShakeToReport"`) do not exist in 7.x, and the package does not translate them. Use the constants of the `Options` class, or the typed options. See [Configuration](/sdk/unity/configuration). +- **An endpoint for an on-premises server.** 6.x had the constant `Bugsee.EndpointKey` (`"endpoint"`). 7.x has no typed endpoint option. Set it with `options.SetCustomOption("com.bugsee.option.$$ENDPOINT", url)`, which works on both platforms. + +## 3. API mapping + +All 7.x members below are on the static class `Bugsee`, which the examples call as `BugseeSdk`. + +### 3.1 Methods and events + +| 6.x (`BugseePlugin.Bugsee`) | 7.x | Notes | +| --- | --- | --- | +| `Launch(string, BugseeLaunchOptions = null)` and `Launch(string, IDictionary)` | `Launch(string, Dictionary options = null)` | Typed options, `OptionsBuilder` and a dictionary all go to the same parameter. | +| `Relaunch(BugseeLaunchOptions = null)` | `Relaunch(Dictionary options = null)`, `RelaunchAsync` | | +| `Stop()` | `Stop(Action completion = null)`, `StopAsync` | | +| `ShowReport(summary, description, BugseeSeverityLevel severity = High)` | `ShowReportDialog(summary, description, IssueSeverity? severity = null, IList labels = null)` | Renamed. `null` severity uses `ReportingDefaultBugPriority`. 6.x always sent High. | +| `Upload(summary, description, BugseeSeverityLevel severity = High)` | `Upload(summary, description, IssueSeverity? severity = null, IList labels = null)` | Same severity change. | +| `Pause()`, `Resume()` | `StartBlackout()`, `EndBlackout()`, `IsBlackout` | `Pause` and `Resume` still exist in 7.x but are marked obsolete and call the blackout methods. | +| `Event(name, IDictionary = null)` | `Event(name, IDictionary = null)` | Unchanged. See [Custom events & traces](/sdk/unity/events-and-traces). | +| `Trace(name, object)` | `Trace(name, object)` | Unchanged signature. | +| `Log(message, BugseeLogLevel level = Debug)` | `Log(message, LogLevel level = Info)` | The default level is now `Info`. A second overload takes `requiresFiltering`. See [Console logs](/sdk/unity/logs). | +| `LogException(Exception)` | `LogException(Exception, IDictionary options = null)` | Source compatible. `LogUnhandledException` is new. | +| `TestExceptionCrash()`, `TestSignalCrash()` | `TestCrash()` | One method, a native crash. | +| `ShowFeedbackUI()`, `SetFeedbackGreetingMessage(string)` | `Feedback.ShowFeedbackUi()`, `Feedback.SetDefaultGreeting(string)` | The feedback chat is an opt-in add-on. See [Feedback](/sdk/unity/feedback). | +| `SetAttribute(key, value)` returns `bool` | `SetAttribute(key, value)` returns nothing | Invalid keys and values throw `ArgumentException`. See [User & session data](/sdk/unity/user-session-data). | +| `GetAttribute(key)` | `GetAttribute(key)`, `GetAllAttributes()` | Values read back as `string`, `bool`, `long` or `double`. | +| `ClearAttribute(key)`, `ClearAllAttributes()` return `bool` | Same names, return nothing | | +| `SetEmail`, `GetEmail`, `ClearEmail` | `SetUserIdentifier`, `GetUserIdentifier`, `ClearUserIdentifier` | There is no email API in 7.x. An email address is a valid identifier. For one report, set `IReport.Email`. | +| `CaptureViewHierarchy()` | `CaptureViewHierarchy()` | Unchanged. See [View hierarchy](/sdk/unity/view-hierarchy). | +| `AddSecureRect(Rect)`, `RemoveSecureRect(Rect)` return `bool` | `AddSecureRectangle(RectInt)`, `RemoveSecureRectangle(RectInt)`, and `AddSecureScreenRectangle(Rect, displayId)` | The first pair takes native pixels with a top-left origin. The screen variant takes Unity screen space. See [Privacy: Video](/sdk/unity/privacy/video). | +| `RemoveAllSecureRects()`, `GetAllSecureRects()` returns `Rect[]` | `RemoveAllSecureRectangles()`, `GetAllSecureRectangles()` returns `RectInt[]` | | +| `OnAttachmentForReport` event | `SetReportHandler(IReportHandler)` | See 3.3. | +| `OnLifecycleEvent` event | `LifecycleEvent` event, `SetLifecycleEventListener` | See 3.4. | +| `Appearance` (`IBugseeAppearance`) | `Appearance` (`IAppearance`) | See 3.5. | +| `Assert(condition, description)` | None | Removed. In 6.x it was a no-op on Android. | +| `GetDeviceID()` | None | Removed. | +| `Snapshot()` | None | Removed together with the 6.x `V4` video mode. | +| `OnRecordingStarted` event | None | Removed. | +| `OnHandleUnresolvedException(object, UnhandledExceptionEventArgs)` | None | The 7.x SDK installs its managed exception hooks itself. See section 5. | +| `ShakeToReportKey`, `MaxRecordingTimeKey` and the other key constants | `Options` constants | See section 2. | + +### 3.2 Enums and types + +| 6.x | 7.x | Notes | +| --- | --- | --- | +| `BugseeSeverityLevel`: `Low` 1, `Medium`, `High`, `Critical`, `Blocker` 5 | `IssueSeverity`: `VeryLow` 1, `Medium`, `High`, `Critical`, `Blocker` 5 | `Low` is now `VeryLow`. The numbers are the same. | +| `BugseeLogLevel`: `Invalid` 0, `Error` 1 to `Verbose` 5 | `LogLevel`: `Error` 1 to `Verbose` 5 | `Invalid` is gone. | +| `BugseeFrameRate`: `Low`, `Medium`, `High` | `FrameRate`: `Low`, `Medium`, `High`, `Raw` | `Raw` is new and is meaningful for `VideoMode.DirectBuffers` only. | +| `BugseeStyle`: `Default` 0, `Dark` 1, `BasedOnStatusBar` 2 | `ReportingUIStyle`: `Light` 0, `Dusk` 1, `BasedOnStatusBar` 2, `System` 3 | The default is now `System`. iOS only. | +| `BugseeAndroidVideoMode`: `None`, `V1`, `V2`, `V3`, `V4` | `VideoMode`: `None` 0, `V1` 1, `V2` 2, `Fullscreen` 20, `DirectBuffers` 21 | `V3` and `V4` no longer exist. The 6.x `V2` used MediaProjection and asked the user for consent; in 7.x that is `Fullscreen`. The 7.x `V2` is the Android SDK's default capture engine. See [Video capture](/sdk/unity/video-capture). | +| `BugseeAndroidVideoQuality` | `VideoQuality` | `Default`, `Medium`, `High`. | +| `BugseeLifecycleEventType` | Strings in `LifecycleEvents` | See 3.4. | +| `BugseeReport`, `BugseeAttachment` structs | `IReport`, `IAttachment` | See 3.3. | + +### 3.3 Attachments and the report handler + +6.x added attachments by returning a list from the `OnAttachmentForReport` event. In 7.x you register a report handler and call `AddAttachmentBytes` or `AddAttachmentFile` on the report. The handler must call the completion callback. + +```csharp +// 6.x +Bugsee.OnAttachmentForReport += report => new List +{ + new BugseeAttachment { name = "state", filename = "state.json", data = stateBytes }, +}; +``` + +```csharp +// 7.x +using System; +using Bugsee.Contracts.Reporting; +using BugseeSdk = Bugsee.Bugsee; + +public class StateAttachments : ReportHandlerBase +{ + readonly byte[] _stateBytes; + + public StateAttachments(byte[] stateBytes) { _stateBytes = stateBytes; } + + public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) + { + IAttachment attachment = report.AddAttachmentBytes(_stateBytes, "state", "application/json"); + attachment.Filename = "state.json"; + completionCallback?.Invoke(); + } +} + +// Once, after launch or before it: +// BugseeSdk.SetReportHandler(new StateAttachments(bytes)); +``` + +The handler also lets you change the summary, description, severity, labels and attributes of the report. See [Report handler](/sdk/unity/report-handler) and [Bug reporting](/sdk/unity/manual/bug-reporting). + +### 3.4 Lifecycle events + +6.x raised `OnLifecycleEvent` with a `BugseeLifecycleEventType` value. 7.x raises `LifecycleEvent` with an event name from `LifecycleEvents` and an optional payload, and you can instead register an `ILifecycleEventListener`. + +```csharp +using Bugsee.Contracts.Lifecycle; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.LifecycleEvent += (eventType, data) => +{ + if (eventType == LifecycleEvents.RelaunchedAfterCrash) + { + UnityEngine.Debug.Log("The app was relaunched after a crash."); + } +}; +``` + +| 6.x `BugseeLifecycleEventType` | 7.x `LifecycleEvents` | +| --- | --- | +| `Launched` | `Launched` | +| `Stopped` | `Stopped` | +| `RelaunchedAfterCrash` | `RelaunchedAfterCrash` | +| `BeforeReportShown`, `AfterReportShown` | `BeforeReportShown`, `AfterReportShown` | +| `BeforeReportUploaded`, `AfterReportUploaded` | `BeforeReportUploaded`, `AfterReportUploaded` | +| `BeforeFeedbackShown`, `AfterFeedbackShown` | `BeforeFeedbackShown`, `AfterFeedbackShown` | +| `Paused`, `Resumed` | `BlackoutStarted`, `BlackoutEnded` | +| `Started` | No member of that name. See [Lifecycle & status](/sdk/unity/lifecycle#lifecycle-events). | + +7.x adds `Launching`, `Stopping`, `BeforeReportAssembled`, `AfterReportAssembled`, `ReportAssemblyFailed`, `ReportUploadFailedWithFutureRetry` and `ReportUploadFailed`. + +### 3.5 Appearance + +6.x had typed properties: `Bugsee.Appearance.Report.BackgroundColor = ...`. 7.x has one string-keyed surface, `IAppearance`, with `SetColor`, `GetColor`, `SetString` and `GetString`, and the key constants `ReportAppearance` and `FeedbackAppearance`. See [Appearance](/sdk/unity/appearance). + +```csharp +using Bugsee.Contracts.Appearance; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Appearance + .SetColor(ReportAppearance.BackgroundColor, new Color32(16, 24, 40, 255)) + .SetString(ReportAppearance.SummaryPlaceholder, "What went wrong?"); +``` + +## 4. Launch options + +The tables list the 6.x property, its 7.x counterpart and both defaults. 6.x defaults are the values its `AndroidLaunchOptions` and `IOSLaunchOptions` set in their constructors, which `Launch(token)` sent for you. 7.x defaults are those of the native SDKs the package pins (Android SDK 7.6.0, iOS SDK 7.1.0). Every 7.x property is on `AndroidLaunchOptions` and `IOSLaunchOptions` unless the Platform column says otherwise. The full list is in [Configuration](/sdk/unity/configuration). + +### 4.1 Renamed options + +| 6.x property | Platform | 7.x property | 6.x default | 7.x default | +| --- | --- | --- | --- | --- | +| `MaxRecordingTime` | Both | `Duration` | `60` | `60` | +| `ShakeToTrigger` (Android), `ShakeToReport` (iOS) | Both | `ReportingTriggerByShake` | Android `true`, iOS `false` | `false` | +| `NotificationBarTrigger` | Android | `ReportingTriggerByNotification` | `true` | `false` | +| `ScreenshotToReport` | Both | `ReportingTriggerByScreenshot` | Android `false`, iOS `true` | `false` | +| `CrashReport` | Both | `DetectAndReportCrash` | `true` | `true` | +| `DetectAppExit` | Both | `DetectAndReportExit` | `false` | `true` | +| `MaxNetworkBodySize` | Both | `CaptureNetworkBodySizeLimit` | `20480` | `20480` | +| `MonitorNetwork` | Both | `CaptureNetwork` | `true` | `true` | +| `RecordHttpBodyWithoutType` | Android | `CaptureNetworkBodyWithoutType` | not set | `false` | +| `VideoEnabled` | Both | `CaptureVideo` | `true` | `true` | +| `VideoScale` | Both | `CaptureVideoScale` | Android `1.0`, iOS `0` (not used) | `1` | +| `FrameRate` | Both | `CaptureVideoFrameRate` | `High` | `High` | +| `VideoQuality` | Android | `CaptureVideoQuality` | `Default` | `Default` | +| `VideoMode` | Android | `CaptureVideoMode` | `V3` | `V2` | +| `CaptureLogs` | Both | `CaptureLogs` | `true` | `true` | +| `LogLevel` | Android | `CaptureLogsLevel`, now on both platforms | `Verbose` | `Verbose` | +| `ViewHierarchyEnabled` | Both | `CaptureViewHierarchy` | `false` | `true` | +| `ScreenshotEnabled` | Both | `CaptureScreenshot` | follows `VideoEnabled` | `true` | +| `WifiOnlyUpload` | Both | `WifiOnlyUpload` | `false` | `false` | +| `MaxDataSize` | Both | `MaxDataSize` | `50` | `150` | +| `ReportPrioritySelector` | Both | `ReportingUIPrioritySelectorEnabled` | `false` | `false` | +| `DefaultCrashPriority` | Both | `ReportingDefaultCrashPriority` | `Blocker` | `Blocker` | +| `DefaultBugPriority` | Both | `ReportingDefaultBugPriority` | Android `High`, iOS `Low` | `High` | +| `ReportSummaryRequired` | Both | `ReportingUISummaryRequired` | `false` | `false` | +| `ReportDescriptionRequired` | Both | `ReportingUIDescriptionRequired` | `false` | `false` | +| `ReportEmailRequired` | Both | `ReportingUIEmailRequired` | `false` | `false` | +| `ReportLabelsEnabled` | Both | `ReportingUILabelsEnabled` | `false` | `false` | +| `ReportLabelsRequired` | Both | `ReportingUILabelsRequired` | `false` | `false` | +| `Style` | iOS | `ReportingUIStyle` | `Default` (0) | `System` | +| `CaptureAVPlayer` | iOS | `CaptureAVPlayer` | `false` | `false` | +| `MonitorBluetoothStatus` | iOS | `CaptureBluetoothStatus` | `false` | `false` | +| `MonitorDiskSpace` | iOS | `CaptureDiskSpace` | `false` | `false` | +| `CaptureDeviceAndNetworkNames` | iOS | `CaptureDeviceNetworkNames` | `false` | `false` | +| `AppLaunchCrashDetection` | iOS | `DetectAndReportEarlyCrash` (closest equivalent, both platforms) | `false` | `true` | + +`DetectAndReportEarlyCrash` makes the SDK send the reports of a launch that ended early synchronously at the next launch. Read [Issue detection](/sdk/unity/issue-detection/overview) before you leave it on. + +### 4.2 Removed options + +These 6.x options have no property in 7.x and no key in the native option manifests the package ships with, except where noted. + +| 6.x property | Platform | What to do | +| --- | --- | --- | +| `UseSdCard` | Android | Remove it. | +| `ServiceMode` | Android | Remove it. Video capture is selected by `CaptureVideoMode`. See the [Android migration guide](/sdk/android/migration). | +| `ExtendedVideoMode` | Android | Remove it. Use `CaptureVideoMode`. | +| `SnapshotSize`, `SnapshotCopyFactor` | Android | Remove them. They belonged to the 6.x `V4` video mode, which no longer exists. | +| `HandleAnr` | Android | No property with this name. ANR reporting is part of the exit detector: see [Issue detection](/sdk/unity/issue-detection/overview). | +| `CaptureDeviceAndNetworkNames` | Android | The 7.x option `CaptureDeviceNetworkNames` exists on iOS only. | +| `KillDetection` | iOS | No property with this name. iOS exit detection is on by default: see [Issue detection](/sdk/unity/issue-detection/overview). | +| `CaptureOSLogs` | iOS | No property. The iOS SDK accepts the key `capture.logs.oslog` and ignores it. | +| The `BugseeEnableMachExceptions` key (`Bugsee.EnableMachExceptionsKey`) | iOS | Not supported. Set `IOSLaunchOptions.CrashHandlerType` instead. | + +### 4.3 Options that are new in 7.x + +7.x types many options that 6.x did not have, among them hang, early-crash, HTTP-error, anomaly and frustration detection, breadcrumbs, performance monitoring, pending-report limits, screenshot scale, `CrashSignals`, `CaptureManagedExceptions` and the iOS capture switches. They are in [Configuration](/sdk/unity/configuration). + +## 5. Behavior changes + +### 5.1 Changed defaults + +Several options start with another value than they did in 6.x. The table in 4.1 has the numbers. Check these first: + +- **Shake-to-report is off.** On Android it was on in 6.x. If your game used shake to open the report dialog on Android, set `ReportingTriggerByShake = true`. On iOS the 6.x wrapper already started with shake off. +- **The Android notification-bar trigger is off.** Set `ReportingTriggerByNotification = true` on `AndroidLaunchOptions` to keep it. +- **The iOS screenshot trigger is off.** The 6.x iOS wrapper had it on. Set `ReportingTriggerByScreenshot = true` to keep it. +- **`MaxDataSize` is 150 MB, not 50.** +- **View hierarchy capture is on.** The 6.x wrapper had it off. +- **Exit detection is on.** Application exits (on Android, the reasons of `ApplicationExitInfo`; on iOS, out-of-memory kills) are reported unless you set `DetectAndReportExit = false`. +- **Early-crash handling is on.** The 6.x iOS option `AppLaunchCrashDetection` was off. +- **The default bug severity on iOS is `High`.** It was `Low` in the 6.x options. +- **The Android video mode default is `V2`** (the SDK's default capture engine), where 6.x used `V3`. +- **`Log` defaults to `LogLevel.Info`.** The 6.x default was `Debug`. +- **Breadcrumbs are off.** `AddBreadcrumb` records nothing until you set `CaptureBreadcrumbs = true`. See [Breadcrumbs](/sdk/unity/breadcrumbs). + +The native SDKs changed other defaults between their 6.x and 7.x lines. They are in the native guides: [Android](/sdk/android/migration) and [iOS](/sdk/ios/migration). + +### 5.2 Managed exceptions are a separate switch + +In 6.x, the `AppDomain.UnhandledException` and Unity log hooks for managed exceptions were installed only when `CrashReport` was `true`. In 7.x they follow `CaptureManagedExceptions` (default `true`), which is independent of `DetectAndReportCrash`. To stop reporting C# exceptions, set `CaptureManagedExceptions = false`. `CaptureUnobservedTaskExceptions` (default `true`) controls the unobserved task exceptions. See [Crash & error reporting](/sdk/unity/manual/crash-error-reporting). + +The client signature of a managed exception changed too. 6.x hashed the exception name, every raw stack line and the build GUID. 7.x uses the short type name and the first user frames, and leaves out the message, the build GUID, IL offsets and directories. Existing issues can regroup after you update. + +### 5.3 Severity + +`ShowReportDialog` and `Upload` take `IssueSeverity?`. Pass `null` or omit it to use `ReportingDefaultBugPriority`, which is `High` unless you configure it. In 6.x both calls always sent `High` and ignored the default. `IReport.Severity` is `IssueSeverity?` as well: `null` is unset. + +### 5.4 Attribute values + +`GetAttribute`, `GetAllAttributes` and `IReport.GetAttribute` return `long` for every integer and `double` for floating-point values, on both platforms. On 6.x Android, `GetAttribute` returned `int` when the value fit and `float` for decimals, so code that unboxes with `(int)` or `(float)` throws `InvalidCastException` in 7.x. Use `Convert.ToInt32` or cast to `long`. On 6.x iOS the call returned a string. + +### 5.5 Deleting collected data + +`DeleteCollectedDataOnDevice` is new in 7.x. On Android the plain call also deletes finished reports that were not uploaded yet, and stops the SDK first. To keep reports that wait for upload, call `DeleteCollectedDataOnDevice(DeleteScope.CaptureAndIntermediate)`. See [Lifecycle & status](/sdk/unity/lifecycle#delete-collected-data). + +### 5.6 Native crash signals + +`CrashSignals` is a shared launch option in 7.x and reaches both platforms. On Android it is read by the NDK module. A mask meant only for iOS, for example `CrashSignals.None`, also narrows native signal capture on Android. Leave it out of the Android options, or set it per platform. See [Configuration](/sdk/unity/configuration#crashsignals). + +## 6. Build and CI changes + +- **No `.unitypackage`, no native binaries in the project.** The Android SDK (Gradle) and the iOS SDK (Swift Package Manager) are added to the generated projects by the package. +- **Symbol upload is part of the build and opt-in.** Set `BUGSEE_APP_TOKEN` to turn it on and `BUGSEE_NO_SYMBOL_UPLOAD` to turn all uploads off. A missing token or tool is a warning, never a failed build. See [Symbolication](/sdk/unity/symbolication/overview) and [Build environment variables](/sdk/unity/symbolication/environment-variables). +- **If your CI sets `BUGSEE_BUILD_UUID`,** read its entry in the variable list. The Android mapping upload is keyed by the build id the built app carries, and the variable applies only when the app has none and the value is a UUID. +- **An iOS export on Xcode 27 or later can add a `BugseeCrashReport` extension target** with an App Group entitlement on your app. By default it is added only in an interactive Editor build with Automatically Sign on and a team, never in batch mode. Set `BUGSEE_IOS_CRASH_EXTENSION=0` to keep the export as it was. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). + +## 7. What is new in 7.x + +- **Lifecycle:** `LaunchAsync`, `RelaunchAsync`, `StopAsync`, `IsLaunched`, `Status`, `DeleteCollectedDataOnDeviceAsync`. See [Lifecycle & status](/sdk/unity/lifecycle). +- **Reports:** `CreateReport`, `Upload(IReport)`, `Discard`, and the report handler. See [Bug reporting](/sdk/unity/manual/bug-reporting). +- **Events and context:** `AddBreadcrumb`, `SetUserIdentifier`, `GetAllAttributes`, and filters for logs, network events and breadcrumbs. See [Breadcrumbs](/sdk/unity/breadcrumbs), [Network events](/sdk/unity/network) and [Privacy overview](/sdk/unity/privacy/overview). +- **Notification relay:** `Notify`. See [Notification relay](/sdk/unity/notification-relay). +- **Performance monitoring:** `StartTransaction` and spans. See [Performance monitoring](/sdk/unity/performance). +- **Privacy:** screen-space secure rectangles, secure web views on Android, and `ApplyDefaultNetworkSanitizer`. See [Privacy: Video](/sdk/unity/privacy/video) and [Privacy: Network](/sdk/unity/privacy/network). +- **Detection:** hangs, exits, HTTP errors, anomalies and frustration, plus the iOS Crash Report Extension and the opt-in iOS native early launch. See [Issue detection](/sdk/unity/issue-detection/overview). +- **Symbolication:** Editor and Xcode uploads of native symbols, mappings and the IL2CPP line map. See [Symbolication](/sdk/unity/symbolication/overview). + +## 8. Migration checklist + +- [ ] Delete `Assets/Plugins/Bugsee`, the `BugseeLauncher` component, any `AddComponent()` call and the `BugseeEventsListener` component. +- [ ] Add `com.bugsee.unity` from `https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1`. +- [ ] Replace `using BugseePlugin;` with `using Bugsee.Contracts.Options;` (and the other namespaces you need) and `using BugseeSdk = Bugsee.Bugsee;`. +- [ ] Port the launch to `BugseeSdk.Launch(token, options)` with `AndroidLaunchOptions` or `IOSLaunchOptions`. +- [ ] Rename options (4.1), remove the dropped ones (4.2), and set the trigger options you relied on (shake, notification bar, iOS screenshot). +- [ ] Rename `ShowReport` to `ShowReportDialog`, `BugseeSeverityLevel` to `IssueSeverity`, `BugseeLogLevel` to `LogLevel`. +- [ ] Replace `SetEmail` with `SetUserIdentifier`, and the feedback calls with `Feedback.ShowFeedbackUi`. +- [ ] Replace `OnAttachmentForReport` with a report handler and `OnLifecycleEvent` with `LifecycleEvent`. +- [ ] Replace the appearance properties with `SetColor` and `SetString`. +- [ ] Fix attribute reads that unbox to `int` or `float`. +- [ ] Decide `CaptureManagedExceptions`, `DetectAndReportExit` and `MaxDataSize` on purpose; they changed. +- [ ] Set `BUGSEE_APP_TOKEN` in your build environment if you want symbols uploaded. +- [ ] Build for a device, send a report with `ShowReportDialog` and a crash with `TestCrash`, and check both in the dashboard. See [Installation](/sdk/unity/installation#check-that-it-works). diff --git a/docs/sdk/unity/network.mdx b/docs/sdk/unity/network.mdx index 3b314737..502aed0e 100644 --- a/docs/sdk/unity/network.mdx +++ b/docs/sdk/unity/network.mdx @@ -1,6 +1,6 @@ --- title: "Network events" -description: "TODO(writer-C): Network events for the Bugsee Unity SDK 7.x." +description: "What network traffic the Bugsee Unity SDK 7.x records, the options that control it, how to add your own network events with AddNetworkEvent, and how to filter events with SetNetworkEventFilter." sidebar_position: 7 slug: "/sdk/unity/network" --- @@ -9,4 +9,197 @@ slug: "/sdk/unity/network" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Bugsee attaches the app's network requests, with their headers, bodies and response codes, to every report. This page covers what the Unity SDK records, the options that control it, how to record requests the SDK does not see, and how to filter or redact events before they are stored. + +## What is recorded + +The Unity package wraps the native Bugsee SDKs (Android 7.6.0 and iOS 7.1.0). Network capture happens in those native SDKs, on the platform's own HTTP stacks. See their pages for what each one records: + +- [Android network events](/sdk/android/network) +- [iOS network events](/sdk/ios/network) + +The Unity package has no network hook of its own. It does not patch `UnityWebRequest`, `System.Net.Http.HttpClient` or any other managed or Unity networking API. Do not rely on automatic capture for requests made through those APIs: record them yourself with [`AddNetworkEvent`](#record-your-own-network-events). To see what your build records, send a test report and open its network timeline in the dashboard. + +On Android, the package declares only the core Bugsee Android SDK and its NDK extension. It does not declare the HTTP client extension modules. Their setup is described on the Android page. + +In the Unity Editor, and on platforms other than Android and iOS, network calls do nothing. + +## Options + +Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [Configuration](/sdk/unity/configuration) for the full tables. The defaults are those of the native SDKs the package pins. + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `CaptureNetwork` | Both | `bool` | `true` | Master switch for network capture. | +| `CaptureNetworkBodySizeLimit` | Both | `int` (bytes) | `20480` | Largest request or response body the SDK keeps. | +| `CaptureNetworkBodyWithoutType` | Both | `bool` | `false` | Keep bodies that declare no content type. | +| `CaptureNetworkUseDefaultSanitizer` | Both | `bool` | `true` | Built-in redaction of sensitive values. See [Filters and the built-in redaction](#filters-and-the-built-in-redaction). | +| `CaptureNetworkOnLaunch` | Android property | `bool` | `false` | Install capture during launch instead of when capture starts, so requests made during app startup are not missed. | +| `CaptureWebSocket` | iOS | `bool` | `true` | Record WebSocket traffic. Needs `CaptureNetwork` too. | + +`CaptureNetworkOnLaunch` exists on both native SDKs, but the Unity package has a typed property for it on `AndroidLaunchOptions` only. On iOS, set the key with `SetCustomOption`. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + CaptureNetwork = true, + CaptureNetworkBodySizeLimit = 64 * 1024, + CaptureNetworkOnLaunch = true, +}; +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + CaptureNetwork = true, + CaptureNetworkBodySizeLimit = 64 * 1024, +}; +options.SetCustomOption(Options.CaptureNetworkOnLaunch, true); +#endif + +BugseeSdk.Launch("", options); +``` + +To turn network capture off, set `CaptureNetwork = false`. See [Privacy: network](/sdk/unity/privacy/network). + +## Record your own network events + +`Bugsee.AddNetworkEvent(INetworkEvent)` records an exchange the SDK did not see, such as a request made with `UnityWebRequest`. The event appears in the report next to the captured traffic. + +Build the event with the exchange factory, fill in its fields, and add it. A request usually produces two events with the same `id`: one when it starts and one when it completes. + +```csharp +using System; +using System.Collections.Generic; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +var factory = BugseeSdk.GetExchangeFactory(); +var id = Guid.NewGuid().ToString("N"); + +// When the request starts. +var started = factory.CreateNetworkEvent( + DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), + NetworkEventStage.RequestStarted, + id, + "UnityWebRequest", + "POST"); +started.Url = "https://api.example.com/orders"; +started.Headers = new Dictionary { ["Content-Type"] = "application/json" }; +started.Body = "{\"sku\":\"A-100\"}"; +BugseeSdk.AddNetworkEvent(started); + +// When the response arrives. +var completed = factory.CreateNetworkEvent( + DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(), + NetworkEventStage.RequestCompleted, + id, + "UnityWebRequest", + "POST"); +completed.Url = "https://api.example.com/orders"; +completed.ResponseCode = 201; +completed.Body = "{\"order\":\"1042\"}"; +BugseeSdk.AddNetworkEvent(completed); +``` + +`CreateNetworkEvent(timestamp, stage, id, mechanism, method)` takes the Unix time in milliseconds, the stage, an id that ties the events of one request together (pass `null` for a generated one), a free-text mechanism name, and the HTTP method. The id, mechanism, method and stage are read-only after creation. Set the other fields on the returned event. + +| Field | Type | Notes | +| --- | --- | --- | +| `Url` | `string` | The request URL. | +| `Headers` | `IDictionary` | Request or response headers. | +| `Body` | `string` | The body as text. | +| `Size` | `long` | The body size in bytes. | +| `ResponseCode` | `int` | The HTTP status code. | +| `StatusText` | `string` | The status text. | +| `ErrorShortMessage`, `ErrorDescription` | `string` | Error details for a failed request. | +| `IsOverride` | `bool` | Android only. The value is kept on the managed event and not sent to iOS. Default `false`. | + +### Stages + +| `NetworkEventStage` | Android | iOS | +| --- | --- | --- | +| `RequestStarted` | Recorded | Recorded | +| `RequestCompleted` | Recorded | Recorded | +| `RequestErrored` | Recorded | Recorded | +| `RequestAborted` | Recorded | Recorded | +| `Redirect` | Recorded | Dropped with a warning | +| `RequestTimingsReceived` | Recorded | Dropped with a warning | +| `WebSocket` | Recorded | Dropped with a warning | + +### When to add events + +Add events after the SDK is launched (`Bugsee.IsLaunched` is `true`). + +- **Android:** `GetExchangeFactory()` returns `null`, and `CreateNetworkEvent` returns `null`, while the SDK has no network consumer: before launch, or with `CaptureNetwork` off. Check for `null` before you use the event. +- **iOS:** events added before the launch completes are held and sent once it does. Events added after `Stop` are dropped. + +Events you add go through your [network filter](#filter-network-events), so a filter that redacts captured traffic redacts them too. + +## Filter network events + +`Bugsee.SetNetworkEventFilter` installs a filter that sees each network event before it is stored. Change the event and return it to keep it, or return `null` to drop it. Pass `null` to remove the filter. + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.SetNetworkEventFilter(e => +{ + // Drop health checks. + if (e.Url != null && e.Url.Contains("/health")) return null; + + // Edit the headers, then assign the dictionary back. + var headers = new Dictionary(e.Headers); + if (headers.ContainsKey("X-Session")) headers["X-Session"] = ""; + e.Headers = headers; + + return e; +}); +``` + +Keep these rules in mind: + +- **Do not keep the event.** The event is valid only inside the callback. Using it afterward throws `ObjectDisposedException` on Android. +- **Assign `Headers` back.** On Android, `Headers` returns a copy, so editing the returned dictionary in place does not change the event. Assign the edited dictionary to `e.Headers`. +- **A filter that throws drops the event.** The SDK records nothing for that event. +- **The filter runs on the Unity main thread.** On Android the SDK calls it on its own threads and the package hands each call to the main thread, which processes its queue in `Update`. While the app is in the background Unity's loop is paused, so the call waits until the app resumes. +- **A filter that blocks forever blocks the main thread.** Keep it short. + +### Filters and the built-in redaction + +With `CaptureNetworkUseDefaultSanitizer` on (the default), the SDK redacts sensitive values in captured events: sensitive URL query values, sensitive header values such as `Authorization` and `Cookie`, and sensitive body fields such as `password`. + +On Android and iOS, setting a filter with `SetNetworkEventFilter` turns the built-in redaction off. Everything your filter does not redact is then recorded as is. To keep the built-in redaction, call `Bugsee.ApplyDefaultNetworkSanitizer(e)` first in your filter, then add your own rules: + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.SetNetworkEventFilter(e => +{ + // Run the SDK's built-in redaction, in place. If it could not run, drop the event + // rather than record it unredacted. + if (!BugseeSdk.ApplyDefaultNetworkSanitizer(e)) return null; + + e.Url = e.Url.Replace("/internal/", "/x/"); + return e; +}); +``` + +`ApplyDefaultNetworkSanitizer` returns `true` when it ran. It returns `false` in the Editor, for a `null` event, and when the sanitizer could not run. + +- Inside the filter it needs nothing else and works on any thread. +- The redaction rules belong to each native SDK. On Android, the sanitizer also redacts error texts and `user:password@` credentials in URLs. On iOS it does not remove `user:password@` credentials from URLs, so do not rely on it for those. +- On an event you built yourself, Android sanitizes a native copy, and the SDK hands that copy out only while it is launched with network capture on. Outside that, nothing is redacted and the call returns `false`. Check the result. + +For the redaction rules and what each native SDK treats as sensitive, see [Privacy: network](/sdk/unity/privacy/network). + +## Related pages + +- [Console logs](/sdk/unity/logs) +- [Breadcrumbs](/sdk/unity/breadcrumbs) +- [Privacy: network](/sdk/unity/privacy/network) +- [Configuration](/sdk/unity/configuration) diff --git a/docs/sdk/unity/notification-relay.md b/docs/sdk/unity/notification-relay.md index f3b4fdee..d575fec0 100644 --- a/docs/sdk/unity/notification-relay.md +++ b/docs/sdk/unity/notification-relay.md @@ -1,6 +1,6 @@ --- title: "Notification relay" -description: "TODO(writer-B): Notification relay for the Bugsee Unity SDK 7.x." +description: "Bugsee.Notify in Unity SDK 7.x: send a title, body, severity and fields straight to your messaging integrations and webhooks, without creating a bug report." sidebar_position: 19 slug: "/sdk/unity/notification-relay" --- @@ -9,4 +9,112 @@ slug: "/sdk/unity/notification-relay" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +`Bugsee.Notify` sends a title, an optional body, a severity and optional string fields to the messaging integrations and webhooks you set up for the app, **without** creating a bug report. No video, logs, network events or events are attached. The call works the same on Android and iOS. + +## When to use it + +A bug report (video, logs, network traffic, an issue in the dashboard) is a lot to pay for when all you need is to tell a person what happened: "the payment webhook returned 500 for order 42". If your code already knows that, `Notify` is the direct path: one call, a few strings, delivered to the destinations your team already has. + +It is not a replacement for bug reports. It creates no Bugsee issue, so there is nothing to open and investigate afterward. When you need a session someone can replay, use [bug reporting](/sdk/unity/manual/bug-reporting) or [crash & error reporting](/sdk/unity/manual/crash-error-reporting). + +## API + +```csharp +public static void Notify( + string title, + string body = null, + IssueSeverity severity = IssueSeverity.Medium, + IDictionary fields = null, + bool urgent = false) +``` + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +// Title only +BugseeSdk.Notify("Payment webhook failed"); + +// With a body and a severity +BugseeSdk.Notify("Payment webhook failed", "Stripe returned a 500 for order 42", IssueSeverity.High); + +// With fields +BugseeSdk.Notify( + "Payment webhook failed", + "Stripe returned a 500 for order 42", + IssueSeverity.High, + new Dictionary + { + { "order_id", "42" }, + { "provider", "stripe" }, + }); +``` + +| Argument | Rules | +| --- | --- | +| `title` | Required. An empty or `null` title is ignored: the call logs the warning `[Bugsee] Notify ignored: a title is required.` and sends nothing. | +| `body` | Optional. `null` is sent as an empty string. | +| `severity` | An `IssueSeverity`: `VeryLow`, `Medium`, `High`, `Critical` or `Blocker`. The default is `Medium`, and the severity is always sent. | +| `fields` | Optional extra string pairs. Entries with a `null` key or a `null` value are dropped. | +| `urgent` | `true` asks for delivery without waiting for the next batch. See [Urgent notifications](#urgent-notifications). | + +`Notify` returns nothing and takes no callback, so your game cannot tell whether a notification reached the server. + +### Before launch + +Call `Notify` after `Bugsee.Launch`. A call made when the SDK is not launched is ignored by the native SDK, with a warning in the native log, and is not queued. In the Unity Editor the call does nothing. + +## Offline behavior and batching + +The SDK stores each notification on the device and uploads notifications in batches. A notification waits while the device is offline. See the native pages for the queue limits: [Android](/sdk/android/notification-relay) and [iOS](/sdk/ios/notification-relay). + +The launch option `NotifyFlushDelay` sets how long the SDK waits before it drains its queue, in milliseconds. The default is `0`, which posts a notification as soon as it is on disk. A positive value lets calls made in quick succession share one batch. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions { NotifyFlushDelay = 2000 }; +BugseeSdk.Launch("", options); +#elif UNITY_IOS +var options = new IOSLaunchOptions { NotifyFlushDelay = 2000 }; +BugseeSdk.Launch("", options); +#endif +``` + +There is no option to turn notification relay on or off in the SDK: it is available whenever the SDK is launched. + +### Urgent notifications + +With `urgent` set to `true`, the SDK asks to deliver that notification without waiting for the batch. If it cannot be sent at once, it is queued like any other. See the native pages for the exact rules. + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.Notify( + "Checkout is failing", + "Five payment errors in the last minute", + IssueSeverity.Critical, + new Dictionary { { "region", "eu-west" } }, + urgent: true); +``` + +## Delivery + +Calling `Notify` delivers nothing on its own. Notification relay has to be turned on for the app in Bugsee, and its destinations chosen. Until then the call succeeds on the device and nothing arrives. + +- **Integrations:** each application mapping of an integration has a _Relay_ option that forwards relayed notifications to it. See [Configuring integrations](/integrations/configuration#mapping-applications). A recipe receives a relayed notification in the shape of an issue: see [Event-based recipes](/integrations/recipes/recipes_notifications). +- **Webhooks:** a subscribed webhook receives the [`notification.relayed`](/webhooks/events#notificationrelayed) event, which documents the payload. + +## Privacy + +Nothing scrubs the title, body or fields before they are sent: the log, network and breadcrumb filters do not apply to them. Do not put anything in them that must not leave the device. For what else a notification carries, such as the user identifier and attributes, see the native pages and [User & session data](/sdk/unity/user-session-data). + +## Related pages + +- [Bug reporting](/sdk/unity/manual/bug-reporting): when you need a full report. +- [Configuration](/sdk/unity/configuration): every launch option. diff --git a/docs/sdk/unity/overview.mdx b/docs/sdk/unity/overview.mdx index 171f4717..b8b68094 100644 --- a/docs/sdk/unity/overview.mdx +++ b/docs/sdk/unity/overview.mdx @@ -1,6 +1,6 @@ --- title: "Overview" -description: "TODO(writer-A): Overview for the Bugsee Unity SDK 7.x." +description: "What the Bugsee Unity SDK 7.x records and detects on iOS and Android, how it wraps the native SDKs, and what your project needs to run it." sidebar_position: 0 slug: "/sdk/unity/overview" --- @@ -9,4 +9,86 @@ slug: "/sdk/unity/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-A) +The Bugsee Unity SDK captures what happened before a bug: a video of the screen, console logs, network events and the steps that led to it. It attaches that timeline to crash, error and bug reports from your iOS and Android games and apps, which you replay in the Bugsee dashboard. + +The SDK is a Unity Package Manager package, `com.bugsee.unity`. It wraps the native Bugsee SDKs for Android and iOS and gives both platforms one C# API, the static `Bugsee` class. + +## What Bugsee records + +Every report carries a synchronized timeline of the session that led up to it: + +- **Video**: a rolling recording of the screen. See [Video capture](/sdk/unity/video-capture) and [Privacy: Video](/sdk/unity/privacy/video). +- **Console logs**: Unity's console output, plus lines you send with `Bugsee.Log`. See [Console logs](/sdk/unity/logs). +- **Network events**: events you add from your own networking code, with filters to redact them. See [Network events](/sdk/unity/network). +- **Breadcrumbs**: steps you add, recorded once you turn them on. Breadcrumbs are off by default. See [Breadcrumbs](/sdk/unity/breadcrumbs). +- **Custom events, traces and attributes**: see [Custom events & traces](/sdk/unity/events-and-traces) and [User & session data](/sdk/unity/user-session-data). +- **View hierarchy**: a snapshot of your Unity scene. See [View hierarchy](/sdk/unity/view-hierarchy). +- **Performance**: transactions and spans you start from C#. See [Performance monitoring](/sdk/unity/performance). + +## What Bugsee detects + +The SDK turns problems into reports automatically: + +- **Native crashes** on both platforms. See [Issue detection](/sdk/unity/issue-detection/overview). +- **Managed exceptions** from your C# code, handled and unhandled. Capture is on by default. See [Crash & error reporting](/sdk/unity/manual/crash-error-reporting). +- **Hangs**, and on Android **ANRs and application exits**. Hang detection is off by default. See [Issue detection](/sdk/unity/issue-detection/overview). +- **Out-of-memory exits on iOS 27 and later**, through the Crash Report Extension that the iOS export can add. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). +- **Manual reports**: open the report dialog or upload a report from code. Shake-to-report is off by default. See [Bug reporting](/sdk/unity/manual/bug-reporting). + +## How it works + +- **One package.** You install `com.bugsee.unity` from a git tag. There is no scoped registry, no dependency-resolve step and no custom Gradle template. See [Installation](/sdk/unity/installation). +- **Native SDKs come with your build.** On Android, every build declares the Bugsee Android SDK in the Gradle project that Unity generates. On iOS, every export adds the Bugsee Swift package to the Xcode project. See [Android build setup](/sdk/unity/build-setup/android) and [iOS build setup](/sdk/unity/build-setup/ios). +- **Launch from C#.** One call, `Bugsee.Launch(token, options)`, starts the SDK. See [Lifecycle & status](/sdk/unity/lifecycle). +- **Typed launch options.** `AndroidLaunchOptions` and `IOSLaunchOptions` set the same `com.bugsee.option.*` keys the native SDKs read. See [Configuration](/sdk/unity/configuration). +- **Privacy on the device.** Mask regions of the video and filter or drop network, log and breadcrumb data before it is recorded. See [Privacy overview](/sdk/unity/privacy/overview). +- **Readable release reports.** The Editor uploads symbols, mappings and line maps after a build, and an Xcode Run Script uploads dSYMs, so crash frames resolve to your source. A missing token or tool produces a warning, never a failed build. See [Symbolication](/sdk/unity/symbolication/overview). +- **Automatic upload.** Reports upload to the dashboard in the background. + +The in-app feedback chat is an opt-in add-on. See [Feedback](/sdk/unity/feedback). + +## Requirements + +| | | +| --- | --- | +| Unity | 2021.3 or later | +| iOS | 15.0 or later, built with Xcode and Swift Package Manager | +| Android | API 21 (Android 5.0) or later | +| Platforms | iOS and Android | + +The Android minimum is the minimum of the Bugsee Android SDK 7.x; see the [Android overview](/sdk/android/overview). The minimum API level of your player comes from your Unity version and Player Settings, and can be higher. + +The package compiles for every build target, but it records and sends data only on iOS and Android. In the Unity Editor and on other platforms, `Bugsee.Launch` does nothing. + +Scripting backends: + +- **iOS** builds use IL2CPP, the only scripting backend Unity offers for iOS. +- **Android**: IL2CPP is the supported configuration for fully symbolicated native crashes. A Mono build works, but frames inside the Mono runtime stay unsymbolicated, and the build logs a warning about it. + +The iOS Simulator has no crash reporter, so crashes and exceptions are reported only from a physical device. + +## Versions + +This beta, `7.0.0-beta.1`, is built on these components: + +| Component | Version | +| --- | --- | +| Bugsee Android SDK | 7.6.0, with the NDK module `bugsee-android-ndk` 7.6.0 | +| Bugsee iOS SDK | 7.1.0, from `github.com/bugsee/spm` | +| Bugsee Gradle plugin | 4.1.1, applied when the generated project uses AGP 8.6 or later | +| `bugsee-cli` | 0.9.0, used for symbol uploads | + +7.x replaces the 6.x `.unitypackage` distribution. The C# API is new, so 6.x code does not compile unchanged. See [Migrating from 6.x to 7.x](/sdk/unity/migration). + +## Get started + +Head to [Installation](/sdk/unity/installation) to add the package and make the first launch. From there, [Configuration](/sdk/unity/configuration) covers the launch options and [Privacy overview](/sdk/unity/privacy/overview) covers redaction. + +## Related pages + +- [Installation](/sdk/unity/installation): add the package and launch the SDK. +- [Android build setup](/sdk/unity/build-setup/android) and [iOS build setup](/sdk/unity/build-setup/ios): what the Editor does to your build. +- [Configuration](/sdk/unity/configuration): launch options for both platforms. +- [Lifecycle & status](/sdk/unity/lifecycle): launch, relaunch, stop and lifecycle events. +- [Release notes](/sdk/unity/release-notes): what changed in each release. +- [FAQ](/sdk/unity/faq): common questions. diff --git a/docs/sdk/unity/performance.mdx b/docs/sdk/unity/performance.mdx index bb34a58a..2e5197e9 100644 --- a/docs/sdk/unity/performance.mdx +++ b/docs/sdk/unity/performance.mdx @@ -1,6 +1,6 @@ --- title: "Performance monitoring" -description: "TODO(writer-C): Performance monitoring for the Bugsee Unity SDK 7.x." +description: "Measure how long your game's work takes with Bugsee.StartTransaction and ISpan in the Bugsee Unity SDK 7.x, and the performance monitoring options." sidebar_position: 21 slug: "/sdk/unity/performance" --- @@ -9,4 +9,114 @@ slug: "/sdk/unity/performance" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Performance monitoring (APM) records how long your app's work takes, as a tree of transactions and spans. Bugsee attaches the transactions to reports. In the Unity SDK you start transactions and spans from C#, and the native SDKs record them. + +The Unity package adds no automatic instrumentation of Unity code, scenes or frames. The native SDKs create transactions and spans of their own while performance monitoring is on. See [Android performance](/sdk/android/performance) and [iOS performance](/sdk/ios/performance) for what each one records. + +In the Unity Editor, and on platforms other than Android and iOS, `StartTransaction` returns a span that accepts every call and records nothing. + +## Concepts + +- A **transaction** is the root of a trace. It has a name, such as `"checkout"`, an operation, such as `"user.flow"`, attributes and a status. +- A **span** is a unit of work inside a transaction. Spans form a tree: each span can have child spans. + +## Transactions and spans + +`Bugsee.StartTransaction(string name, string operation, IDictionary attributes = null)` returns an `ISpan`, the root of a trace. Start child spans with `ISpan.StartChild`. Finish every span you start. + +```csharp +using System.Collections.Generic; +using Bugsee.Contracts.Apm; + +using (var checkout = BugseeSdk.StartTransaction( + "checkout", "user.flow", new Dictionary { ["cart"] = 3 })) +using (var pay = checkout.StartChild("payment", "charge card")) +using BugseeSdk = Bugsee.Bugsee; +{ + pay.SetAttribute("provider", "example-pay"); + // ... do the work ... + pay.Finish(); + checkout.SetStatus(SpanStatus.Ok); +} +``` + +Spans are always created from a parent. There is no global "current span" and no `StartSpan` or `GetActiveSpan` on `Bugsee`, because the native SDKs track the active span per thread. Pass the parent span to the code that starts children. + +### The `ISpan` members + +| Member | Description | +| --- | --- | +| `SpanId`, `TraceId` | The ids of the span and its trace. Empty strings for an inert span. | +| `Operation` | The operation the span was started with. | +| `IsFinished` | `true` once the span was finished, directly or because its parent finished. | +| `SetName(string)` | Sets the name. Returns the span, so calls can be chained. | +| `SetDescription(string)` | Sets the description. | +| `SetAttribute(string key, object value)` | Sets an attribute. | +| `SetStatus(SpanStatus)` | Sets the status without finishing the span. | +| `StartChild(string operation, string description = null)` | Starts a child span. A finished parent returns an inert span. | +| `Finish()` | Finishes the span with `SpanStatus.Ok`. | +| `Finish(SpanStatus)` | Finishes the span with the given status. | +| `Dispose()` | The same as `Finish()`. | + +`SpanStatus` has the values `Ok`, `Error`, `Timeout`, `Cancelled`, `DeadlineExceeded` and `Unknown`. + +Attribute values follow the rules of [`Bugsee.SetAttribute`](/sdk/unity/user-session-data#accepted-values): a string of up to 1024 UTF-16 units, a `bool`, or a number within the signed 64-bit range. + +### Rules + +- **Finish or dispose every span.** A span wraps a native span. Finishing it releases the native object. A span that is dropped without finishing is not reported as finished. +- **Finishing a parent finishes its live children.** They finish with `SpanStatus.Cancelled`. +- **After `Finish`, every call on the span does nothing.** +- **Nothing throws.** Invalid input and native failures log a Unity warning and leave the span unchanged. A rejected attribute value is dropped with a warning. +- **A span can be used from any thread,** including thread-pool and `Task` threads. A child can finish on one thread while its parent finishes on another. + +### When you get an inert span + +`StartTransaction` returns an inert span that accepts every call and records nothing when: + +- the SDK is not launched, including while it is still launching, +- the `name` or the `operation` is empty, or +- you are in the Unity Editor. + +With performance monitoring off, the native SDK returns its own shared no-op span, whose ids read `"0"`. + +## Options + +Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [Configuration](/sdk/unity/configuration) for the full tables. The defaults are those of the native SDKs the package pins. + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `PerformanceMonitoring` | Both | `bool` | `true` | The master switch. With `false`, nothing is instrumented and `StartTransaction` returns the no-op span. | +| `PerformanceSampleRate` | Both | `float` | `0.01` | The probability that a transaction is sampled for the standalone performance upload. | +| `PerformanceAdaptiveSampling` | Both | `bool` | `true` | Promote transactions that lost the random draw into the standalone upload, based on their status, duration and span-tree complexity. | +| `PerformanceUploadMode` | Android | `string` | `"batched"` | How sampled transactions are uploaded: `"batched"` or `"realtime"`. The package drops it before an iOS launch. | + +Every transaction goes into reports, whatever the sampling options say. Sampling affects only the standalone upload. What that upload does is defined by the native SDKs. See [Android performance](/sdk/android/performance#sampling-and-upload-modes) and [iOS performance](/sdk/ios/performance#sampling). + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + PerformanceMonitoring = true, + PerformanceSampleRate = 0.1f, +}; +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + PerformanceMonitoring = true, + PerformanceSampleRate = 0.1f, +}; +#endif + +BugseeSdk.Launch("", options); +``` + +## Related pages + +- [Custom events & traces](/sdk/unity/events-and-traces) +- [Configuration](/sdk/unity/configuration) +- [Android performance](/sdk/android/performance) +- [iOS performance](/sdk/ios/performance) diff --git a/docs/sdk/unity/privacy/breadcrumbs.md b/docs/sdk/unity/privacy/breadcrumbs.md index 2b65239d..80087d93 100644 --- a/docs/sdk/unity/privacy/breadcrumbs.md +++ b/docs/sdk/unity/privacy/breadcrumbs.md @@ -1,6 +1,6 @@ --- title: "Privacy: Breadcrumbs" -description: "TODO(writer-D): Privacy: Breadcrumbs for the Bugsee Unity SDK 7.x." +description: "How to keep sensitive data out of the breadcrumbs Bugsee Unity SDK 7.x records: breadcrumbs are off by default, the CaptureBreadcrumbs options, and redacting breadcrumbs with SetBreadcrumbFilter." sidebar_position: 5 slug: "/sdk/unity/privacy/breadcrumbs" --- @@ -9,4 +9,107 @@ slug: "/sdk/unity/privacy/breadcrumbs" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Breadcrumbs are short records of what the app was doing before an issue: navigation, taps, lifecycle changes, network requests, and the entries your code adds with `Bugsee.AddBreadcrumb`. See [Breadcrumbs](/sdk/unity/breadcrumbs) for what is recorded. This page covers how to keep sensitive data out of them. + +The filter and the options forward to the native SDKs. For what each platform puts in a breadcrumb, see [Android breadcrumb privacy](/sdk/android/privacy/breadcrumbs) and [iOS breadcrumb privacy](/sdk/ios/privacy/breadcrumbs). + +## Breadcrumbs are off by default + +`CaptureBreadcrumbs` is off by default on both platforms. While it is off: + +- `Bugsee.AddBreadcrumb` records nothing. +- The breadcrumb filter is never called. + +Set `CaptureBreadcrumbs` to `true` on your launch options to use either. `CaptureBreadcrumbsExtras` is also off by default. It adds extra details to some breadcrumbs, and those details can carry personal data. On iOS, for example, a device-event breadcrumb can carry the `userInfo` of a system notification. Leave it off unless you need it. See the native pages for what the extras contain. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + BugseeSdk.Launch("", new AndroidLaunchOptions { CaptureBreadcrumbs = true }); +#elif UNITY_IOS + BugseeSdk.Launch("", new IOSLaunchOptions { CaptureBreadcrumbs = true }); +#endif + } +} +``` + +To turn breadcrumbs back off, leave the option out or set it to `false`. + +## What the Unity API records + +`Bugsee.AddBreadcrumb(string category, string message, string levelName)` adds a breadcrumb. `levelName` is one of `"debug"`, `"info"`, `"warning"`, `"error"` and `"fatal"`, in lower case. Any other value throws an `ArgumentException`. Do not put personal data into the category or the message. + +## Redacting with a breadcrumb filter + +`Bugsee.SetBreadcrumbFilter(EventFilter filter)` sees every breadcrumb before it is recorded: the ones the SDK collects and the ones you add. Return the breadcrumb, changed or not, to keep it, or `null` to drop it. + +An `IBreadcrumb` has these members, and you can set all of them: + +| Member | Type | +| --- | --- | +| `Timestamp` | `long` | +| `Category` | `string` | +| `Message` | `string` | +| `Type` | `string` | +| `Level` | `LogLevel?` | +| `Data` | `IDictionary` | + +```csharp +using System.Text.RegularExpressions; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +public static class BreadcrumbRedaction +{ + static readonly Regex Token = + new Regex(@"([?&](?:token|access_token|api_key)=)[^&\s]+", RegexOptions.IgnoreCase); + + public static void Install() + { + BugseeSdk.SetBreadcrumbFilter(crumb => + { + // Drop a whole category. + if (crumb.Category == "internal") + return null; + + // Mask tokens in the message. + if (crumb.Message != null) + crumb.Message = Token.Replace(crumb.Message, "$1"); + + // Mask tokens in the URL of an HTTP breadcrumb. + var data = crumb.Data; // a copy: assign it back after you change it + if (data != null && data.TryGetValue("url", out var url) && url is string text) + { + data["url"] = Token.Replace(text, "$1"); + crumb.Data = data; + } + + return crumb; + }); + } +} +``` + +Call `Install()` before `Bugsee.Launch`, and launch with `CaptureBreadcrumbs = true`. + +What to know: + +- **The network filter does not reach breadcrumbs.** A URL that your [network filter](/sdk/unity/privacy/network) drops or rewrites can still appear in an HTTP request breadcrumb. Repeat your URL rules in the breadcrumb filter. +- **A filter that throws drops the breadcrumb.** The package does not record it unfiltered. +- **Use the breadcrumb you are given.** It is valid only inside the callback. Do not keep it. +- **Passing `null` to `SetBreadcrumbFilter` removes the filter.** Breadcrumbs are then recorded without it. +- **The filter runs on the Unity main thread.** The SDK calls it on its own thread, and the package hands the call to the main thread. While the app is in the background, Unity's loop is paused, and the calls wait until it resumes. The package gives the breadcrumb filter no timeout of its own. +- **Breadcrumbs from before you set the filter are not filtered.** Set the filter before `Bugsee.Launch`. +- **Blackout.** On iOS, gesture, keyboard and focus breadcrumbs are not recorded during a blackout. See [Privacy: Video](/sdk/unity/privacy/video#blackout) and the [iOS page](/sdk/ios/privacy/breadcrumbs). + +## Related pages + +- [Breadcrumbs](/sdk/unity/breadcrumbs): what is recorded and `AddBreadcrumb`. +- [Privacy: Network](/sdk/unity/privacy/network): the network filter. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/privacy/cleanup.md b/docs/sdk/unity/privacy/cleanup.md index c97c2b8a..a3b77750 100644 --- a/docs/sdk/unity/privacy/cleanup.md +++ b/docs/sdk/unity/privacy/cleanup.md @@ -1,6 +1,6 @@ --- title: "Privacy: Cleanup" -description: "TODO(writer-D): Privacy: Cleanup for the Bugsee Unity SDK 7.x." +description: "How to delete the data the Bugsee Unity SDK 7.x has stored on the device with DeleteCollectedDataOnDevice and DeleteScope, and how the retention options bound the reports that wait for upload." sidebar_position: 7 slug: "/sdk/unity/privacy/cleanup" --- @@ -9,4 +9,113 @@ slug: "/sdk/unity/privacy/cleanup" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Bugsee does not stream data continuously. What it records, and the reports built from it, stay on the device until a report is uploaded. When you need that data gone, for example when a user signs out or withdraws consent, delete it with `Bugsee.DeleteCollectedDataOnDevice`. The call forwards to the native `deleteCollectedDataOnDevice`. See [Android cleanup](/sdk/android/privacy/cleanup) and [iOS cleanup](/sdk/ios/privacy/cleanup) for the native side. + +## Deleting everything + +`Bugsee.DeleteCollectedDataOnDevice()` deletes what the SDK collected on the device, including the finished reports that are not uploaded yet. You do not stop the SDK first: the package stops it if it is not stopped, and leaves it stopped. Call `Bugsee.Launch` again to resume. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +public static class UserData +{ + public static void Forget() + { + BugseeSdk.DeleteCollectedDataOnDevice(); // no result: a failure is logged + } +} +``` + +The call has no result. A failure is only logged. To get the result, or to delete less, use `DeleteCollectedDataOnDeviceAsync`. + +:::warning[Android: the delete now also removes finished reports that were not uploaded] +In 7.x, `DeleteCollectedDataOnDevice` on Android also deletes the finished reports that wait for upload, and it stops the SDK first when it is not stopped. To keep the finished reports that wait for upload, call `DeleteCollectedDataOnDevice(DeleteScope.CaptureAndIntermediate)`. +::: + +## Deleting less + +`DeleteScope` chooses how much a delete removes. Every scope stops the SDK. + +| `DeleteScope` | Deletes | Keeps | +| --- | --- | --- | +| `CaptureOnly` | The recorded capture. | The report snapshots and the finished reports that wait for upload. | +| `CaptureAndIntermediate` | The recorded capture and the report snapshots (the data set aside for a report that is not bundled yet). | The finished reports that wait for upload. | +| `Everything` (the default) | Everything the SDK collected on disk, including the finished reports that are not uploaded yet. Their uploads are cancelled. On iOS it also deletes the crashes that are not reported yet and the performance baselines that anomaly detection has learned. | | + +On iOS, the two narrower scopes keep the crashes that are not reported yet, so the next launch can still report them. On Android, the scopes map to `includingIntermediate` and `includingBundles` of the native call. See the native pages for the details. + +Pass the scope to the synchronous overload or to the async one: + +```csharp +using System.Threading.Tasks; +using Bugsee.Contracts.Lifecycle; +using BugseeSdk = Bugsee.Bugsee; + +public static class UserData +{ + public static async Task SignOut() + { + // The user identifier and the attributes are not deleted by any scope: clear them yourself. + BugseeSdk.ClearUserIdentifier(); + BugseeSdk.ClearAllAttributes(); + + bool deleted = await BugseeSdk.DeleteCollectedDataOnDeviceAsync(DeleteScope.CaptureAndIntermediate); + UnityEngine.Debug.Log("Bugsee data deleted: " + deleted); + + // The SDK is stopped. Call BugseeSdk.Launch again to resume. + } + + public static void ForgetCaptureOnly() + { + BugseeSdk.DeleteCollectedDataOnDevice(DeleteScope.CaptureOnly); + } +} +``` + +## How every form behaves + +- **The SDK is left stopped.** Every form stops the SDK first, joining a stop that is already in flight, and leaves it stopped. A managed report that is not finished and a managed upload that is in flight are dropped, as with `Stop`. +- **The async form returns a `Task`.** It completes with `true` when the SDK reported the data deleted. It completes with `false` when the SDK refused, gave no answer in time, or, on iOS, when the call did not reach the Unity main thread within 5 seconds, which means the delete never started. A timeout is a `false`, not a `TimeoutException`. A `false` after a timeout can still be followed by the delete finishing. A failure of the call itself is carried by the `Task`. Awaited from the Unity main thread, the continuation resumes there. +- **The default scope is `Everything`.** `DeleteCollectedDataOnDeviceAsync()` with no argument deletes the same as `DeleteCollectedDataOnDevice()`. +- **An undefined `DeleteScope` value throws.** A value that is not one of the three, such as `(DeleteScope)5`, throws `ArgumentOutOfRangeException`. It is never read as one of the three. +- **Order with `Launch` and `Relaunch`.** On Android, `Launch`, `Relaunch` and deletes run one at a time, in the order you requested them. On iOS, a `Launch` or `Relaunch` that you request after a delete waits for it to finish. A delete is never skipped because a `Launch` follows it. +- **Other players.** On players other than Android and iOS, the Editor included, nothing is collected, so the async form completes `true`. +- **It is not a reset.** No scope deletes the user identifier or the attributes. Clear them with `Bugsee.ClearUserIdentifier()` and `Bugsee.ClearAllAttributes()`. See [User & session data](/sdk/unity/user-session-data). On iOS, no scope deletes the notification relay queue or the Feedback conversation cache either. See [iOS cleanup](/sdk/ios/privacy/cleanup). + +If your app embeds the iOS [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension), the documents the extension writes are not deleted by these calls. See [iOS cleanup](/sdk/ios/privacy/cleanup#crash-report-extension-documents). + +## Reports waiting on the device + +A report that cannot be sent right away waits on the device. Three launch options on `BugseeLaunchOptions` bound how much waits and for how long. Past a limit, whole reports are deleted: errors first, then bug reports, then crashes, oldest first. The newest crash is kept, and on Android so is a report that is being sent. + +| Option | Default | Meaning | +| --- | --- | --- | +| `MaxDataSize` | 150 | Disk space in MB that waiting reports may take up. A value below 10 is raised to 10. | +| `MaxPendingReports` | 30 | The most reports that may wait. A value below 1 is raised to 1. | +| `MaxPendingReportAge` | 30 | Days a report may wait before it is deleted, whatever its type. 0 or a negative value turns the age limit off. | + +`MaxDataSize` defaults to 150 on both platforms. A low value loses reports sooner. See [Configuration](/sdk/unity/configuration) for how to set them. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + BugseeSdk.Launch("", new AndroidLaunchOptions { MaxPendingReports = 5, MaxPendingReportAge = 7 }); +#elif UNITY_IOS + BugseeSdk.Launch("", new IOSLaunchOptions { MaxPendingReports = 5, MaxPendingReportAge = 7 }); +#endif + } +} +``` + +## Related pages + +- [Lifecycle](/sdk/unity/lifecycle): `Launch`, `Relaunch`, `Stop` and the deadlines. +- [Privacy: Report](/sdk/unity/privacy/report): editing a report before upload. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/privacy/logs.md b/docs/sdk/unity/privacy/logs.md index 3dc7acea..f43df446 100644 --- a/docs/sdk/unity/privacy/logs.md +++ b/docs/sdk/unity/privacy/logs.md @@ -1,6 +1,6 @@ --- title: "Privacy: Console logs" -description: "TODO(writer-D): Privacy: Console logs for the Bugsee Unity SDK 7.x." +description: "How to keep sensitive data out of the logs Bugsee Unity SDK 7.x records: turning capture off, the log level, and redacting or dropping lines with SetLogEventFilter." sidebar_position: 3 slug: "/sdk/unity/privacy/logs" --- @@ -9,4 +9,139 @@ slug: "/sdk/unity/privacy/logs" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Log lines often carry more than you meant to share: a token in a URL, an e-mail address in a debug message, a payload dumped while a feature was being built. Bugsee records the Unity console output, the native logs of the app, and the lines you send with `Bugsee.Log`. See [Console logs](/sdk/unity/logs) for where each comes from. This page covers how to keep sensitive data out of them. + +The filter and the options forward to the native SDKs. For their behavior, see [Android log privacy](/sdk/android/privacy/logs) and [iOS log privacy](/sdk/ios/privacy/logs). + +## Disabling log capture + +Set `CaptureLogs` to `false` to stop the automatic capture of logs. It is on by default on both platforms. The property is on `BugseeLaunchOptions`, so `AndroidLaunchOptions` and `IOSLaunchOptions` have it. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + BugseeSdk.Launch("", new AndroidLaunchOptions { CaptureLogs = false }); +#elif UNITY_IOS + BugseeSdk.Launch("", new IOSLaunchOptions { CaptureLogs = false }); +#endif + } +} +``` + +Lines you send with `Bugsee.Log` are still recorded with `CaptureLogs` off. The option turns off only what is captured automatically. + +## What is captured + +- **The Unity console.** From a launch until `Stop`, the package forwards what your code writes with `Debug.Log`, `Debug.LogWarning`, `Debug.LogError` and `Debug.LogAssertion` to the SDK. A line is the message followed by a new line and the stack trace Unity attaches, when there is one. `Debug.Log` lines are recorded at level `Info`, warnings at `Warning`, and errors and assertions at `Error`. Exceptions are not recorded as log lines: they go through the exception pipeline. See [Crash & error reporting](/sdk/unity/manual/crash-error-reporting). +- **The native logs.** On Android, the SDK also reads logcat. +- **Lines you send** with `Bugsee.Log`. + +The Unity log and logcat both need `CaptureLogs`. + +## Log level + +`CaptureLogsLevel` takes a `LogLevel` (`Error`, `Warning`, `Info`, `Debug`, `Verbose`) and drops lines more verbose than it. The default is `Verbose` on both platforms, which keeps everything. The platforms apply it to different lines: + +| Platform | `CaptureLogsLevel` applies to | +| --- | --- | +| Android | The lines the SDK reads from logcat. It does not apply to the lines you send with `Bugsee.Log`, which are recorded whatever their level. | +| iOS | Every line the SDK records, including the lines you send with `Bugsee.Log`. | + +To keep a particular line out of a report whatever the level, use a log filter. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + BugseeSdk.Launch("", new AndroidLaunchOptions { CaptureLogsLevel = LogLevel.Warning }); +#elif UNITY_IOS + BugseeSdk.Launch("", new IOSLaunchOptions { CaptureLogsLevel = LogLevel.Warning }); +#endif + } +} +``` + +`CaptureLogsUseAllSources` (Android only, off by default) makes the SDK query all logcat buffers instead of the default sources. Leave it off unless you need the other buffers. + +## Redacting with a log filter + +`Bugsee.SetLogEventFilter(EventFilter filter)` sees each captured line before it is recorded. Return the event, changed or not, to keep it, or `null` to drop it. An `ILogEvent` has a `Message` and a `Level`, and you can set both. + +```csharp +using System.Text.RegularExpressions; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +public static class LogRedaction +{ + static readonly Regex Token = new Regex(@"(token|access_token|api_key)=[^&\s]+", RegexOptions.IgnoreCase); + static readonly Regex Email = new Regex(@"[\w.%+-]+@[\w-]+(?:\.[\w-]+)+"); + + public static void Install() + { + BugseeSdk.SetLogEventFilter(line => + { + if (line.Message == null || line.Message.StartsWith("[payments]")) + return null; // drop the line + + line.Message = Token.Replace(line.Message, "$1="); + line.Message = Email.Replace(line.Message, ""); + return line; + }); + } +} +``` + +Call `Install()` before `Bugsee.Launch`. + +What to know: + +- **Use the event you are given.** The `ILogEvent` is valid only inside the callback. Do not keep it. On Android, a copy you stored throws `ObjectDisposedException` after the callback. +- **A filter that throws drops the line.** The package does not record the line unfiltered. +- **Passing `null` to `SetLogEventFilter` removes the filter.** Lines are then recorded without it. +- **The filter runs on the Unity main thread.** The SDK calls it on its own thread, and the package hands the call to the main thread. While the app is in the background, Unity's loop is paused, and the calls wait until it resumes. The Android SDK drops a line whose filter has not answered within 10 seconds. Keep the filter fast. +- **Lines recorded before you set the filter are not filtered.** Set the filter before `Bugsee.Launch`. + +### `Bugsee.Log` and the filter + +A line you send with `Bugsee.Log(message, level)` skips the log filter. This is the behavior of the native SDKs. If a line can carry user data, pass `true` as the third argument so that it goes through the filter: + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class SafeLog +{ + public static void Signed(string userEmail) + { + BugseeSdk.Log("Signed in as " + userEmail, LogLevel.Info, true); + } +} +``` + +- The `level` default of `Bugsee.Log(string, LogLevel)` is `LogLevel.Info`. +- A line you send with `requiresFiltering` set to `true` is filtered even with `CaptureLogs` off. +- On iOS, a line below `CaptureLogsLevel` never reaches the filter. On Android, the level applies only to the logcat lines. +- Do not call `Bugsee.Log(..., true)` from inside the log filter. On Android the filter runs during the call, so it recurses. +- The call does nothing for a null message, and before the SDK is launched. + +## Tombstone logs on Android + +`CrashNdkIncludeTombstoneLogs` (Android only, off by default) adds the raw log buffers of the OS tombstone to a native crash report. Those buffers do not go through your log filter or the Bugsee redaction, and they can contain text that system or third-party libraries logged in your process. They are uploaded as the OS wrote them. Enable the option only if that is acceptable. + +## Related pages + +- [Console logs](/sdk/unity/logs): where lines come from and `Bugsee.Log`. +- [Privacy: Network](/sdk/unity/privacy/network): the matching network filter. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/privacy/network.mdx b/docs/sdk/unity/privacy/network.mdx index cedc5c71..a08ec485 100644 --- a/docs/sdk/unity/privacy/network.mdx +++ b/docs/sdk/unity/privacy/network.mdx @@ -1,6 +1,6 @@ --- title: "Privacy: Network" -description: "TODO(writer-D): Privacy: Network for the Bugsee Unity SDK 7.x." +description: "How to keep credentials and personal data out of the network traffic Bugsee Unity SDK 7.x records: turning capture off, body options, the built-in redaction, SetNetworkEventFilter and ApplyDefaultNetworkSanitizer." sidebar_position: 4 slug: "/sdk/unity/privacy/network" --- @@ -9,4 +9,130 @@ slug: "/sdk/unity/privacy/network" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Recorded network traffic is one of the most useful parts of a report, and one of the most sensitive: headers carry credentials, URLs carry tokens, and bodies carry whatever the user typed. See [Network events](/sdk/unity/network) for what is recorded. This page covers how to keep sensitive values out of it. + +The package does not add network capture of its own for Unity's `UnityWebRequest`. It records the events the native SDK captures, and the events you add with `Bugsee.AddNetworkEvent`. The options, the built-in redaction and the filter are the native SDKs'. For their lists and behavior, see [Android network privacy](/sdk/android/privacy/network) and [iOS network privacy](/sdk/ios/privacy/network). + +## Disabling network capture + +Set `CaptureNetwork` to `false` to record no network traffic. It is on by default on both platforms. The property is on `BugseeLaunchOptions`, so `AndroidLaunchOptions` and `IOSLaunchOptions` have it. On iOS, `CaptureWebSocket` (on `IOSLaunchOptions`, on by default) turns WebSocket traffic off on its own. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + BugseeSdk.Launch("", new AndroidLaunchOptions { CaptureNetwork = false }); +#elif UNITY_IOS + BugseeSdk.Launch("", new IOSLaunchOptions { CaptureNetwork = false }); +#endif + } +} +``` + +## Body options + +Three launch options on `BugseeLaunchOptions` limit which bodies are kept: + +| Option | Default | Description | +| --- | --- | --- | +| `CaptureNetworkBodySizeLimit` | `20480` | The largest request or response body captured, in bytes. | +| `CaptureNetworkBodyWithoutType` | `false` | Also keep bodies that declare no content type. Leave it off unless you need them. | +| `CaptureNetworkUseDefaultSanitizer` | `true` | The built-in redaction, described below. | + +Neither of the first two removes headers or URL parameters. Use the built-in redaction and a network filter for those. See the native pages for how the body limit applies: [Android configuration](/sdk/android/configuration) and [iOS configuration](/sdk/ios/configuration). + +## The built-in redaction + +With `CaptureNetworkUseDefaultSanitizer` on, which is the default, the SDK replaces the values of known sensitive keys with `` before it records an event: `Authorization` and `Cookie` headers, query values such as `token`, and body fields such as `password`. The lists differ between the platforms. For example, the Android redaction also removes `user:password@` credentials from URLs, and the iOS redaction does not. See the native pages for the lists: [Android](/sdk/android/privacy/network#a-filter-replaces-the-built-in-redaction) and [iOS](/sdk/ios/privacy/network#built-in-redaction). + +The built-in redaction knows nothing about your own API. A header such as `X-Session-Id` or a JSON field such as `otp` is recorded as it is unless your filter removes it. + +:::warning[A network filter turns the built-in redaction off] +On Android and iOS, a filter set with `Bugsee.SetNetworkEventFilter` turns the SDK's built-in redaction off. On Android this includes a filter declared in the app manifest. Whatever your filter does not redact is recorded as it is. Call `Bugsee.ApplyDefaultNetworkSanitizer(event)` first in your filter to keep the built-in redaction, as shown below. +::: + +## Redacting with a network filter + +`Bugsee.SetNetworkEventFilter(EventFilter filter)` sees each network event before it is recorded: the captured traffic, and the events you add with `Bugsee.AddNetworkEvent`. Return the event, changed or not, to keep it, or `null` to drop it. + +An `INetworkEvent` exposes these fields: + +| Writable | Read-only | +| --- | --- | +| `Url`, `Body`, `Size`, `ResponseCode`, `StatusText`, `ErrorShortMessage`, `ErrorDescription`, `Headers`, `IsOverride` (Android only) | `Id`, `Mechanism`, `Method`, `Stage` | + +The error texts can quote a URL, so redact them too if your URLs carry secrets. `Headers` returns a copy: assign the dictionary back to `Headers` after you change it. + +```csharp +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Bugsee.Contracts.Exchange; +using BugseeSdk = Bugsee.Bugsee; + +public static class NetworkRedaction +{ + static readonly Regex SecretParameter = + new Regex(@"([?&](?:otp|code|session)=)[^&#]*", RegexOptions.IgnoreCase); + + public static void Install() + { + BugseeSdk.SetNetworkEventFilter(e => + { + // Keep the SDK's own redaction, in place. If it could not run, drop the event + // rather than record it unredacted. + if (!BugseeSdk.ApplyDefaultNetworkSanitizer(e)) return null; + + // Drop the traffic of an endpoint that must never be recorded. + if (e.Url != null && e.Url.Contains("/v1/identity/")) return null; + + // Your own redaction. + if (e.Url != null) + e.Url = SecretParameter.Replace(e.Url, "$1"); + + IDictionary headers = e.Headers; + if (headers != null && headers.ContainsKey("X-Session-Id")) + { + headers["X-Session-Id"] = ""; + e.Headers = headers; + } + + return e; + }); + } +} +``` + +Call `Install()` before `Bugsee.Launch`. + +### `ApplyDefaultNetworkSanitizer` + +`Bugsee.ApplyDefaultNetworkSanitizer(INetworkEvent)` runs the SDK's built-in redaction on the event, in place, and returns `true` when it ran. It returns `false` in the Editor, for a null event, and when the sanitizer could not run. In a filter, a `false` means nothing was redacted: drop the event, as in the example. + +- Inside the filter, it needs nothing else, and it works on any thread. +- On Android, an event you built yourself (with `Bugsee.GetExchangeFactory()`, or your own `INetworkEvent`) is redacted through a native copy that the SDK hands out only while it is launched with network capture on. Outside that, nothing is redacted and the call returns `false`. Check the result. +- On iOS, the package copies the event into a native event, runs the SDK's sanitizer on it, and writes back only the fields that changed. It needs no launch. +- The rules are each SDK's own. The iOS sanitizer does not remove `user:password@` credentials from a URL, which the Android one does. Do not rely on it for those. A failure inside the SDK is logged, and the call returns `false`. + +### What the filter guarantees + +- **A filter that throws drops the event.** The package does not record the event unfiltered. +- **Use the event you are given.** The event is valid only inside the callback. Do not keep it. On Android, a copy you stored throws `ObjectDisposedException` after the callback. +- **Passing `null` to `SetNetworkEventFilter` removes the filter.** Events are then recorded without your filter. +- **The filter runs on the Unity main thread.** The SDK calls it on its own thread, and the package hands the call to the main thread. While the app is in the background, Unity's loop is paused, and the calls wait until it resumes. The package gives the network filter no timeout of its own. A filter that blocks forever blocks the main thread. + +### What the filter does not cover + +- **Traffic recorded before the filter is set.** Set the filter before `Bugsee.Launch`. +- **Breadcrumbs.** The network filter does not reach breadcrumbs. If you turn breadcrumbs on, an HTTP request breadcrumb can carry the request URL. See [Privacy: Breadcrumbs](/sdk/unity/privacy/breadcrumbs). + +## Related pages + +- [Network events](/sdk/unity/network): what is recorded, `AddNetworkEvent`. +- [Privacy: Breadcrumbs](/sdk/unity/privacy/breadcrumbs): redacting breadcrumbs. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index fe127d4f..5fcc5848 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -1,6 +1,6 @@ --- title: "Privacy overview" -description: "TODO(writer-D): Privacy overview for the Bugsee Unity SDK 7.x." +description: "The privacy controls of Bugsee Unity SDK 7.x: what the SDK records by default, the options that turn each stream off, and where to mask, filter, redact or delete data before it leaves the device." sidebar_position: 1 slug: "/sdk/unity/privacy/overview" --- @@ -9,4 +9,84 @@ slug: "/sdk/unity/privacy/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Bugsee does not stream data continuously. The SDK keeps what it records in a rolling buffer on the device, as long as the `Duration` launch option (60 seconds by default on both platforms), and sends it only when a report is created: by a crash or another issue Bugsee detects, from the report dialog, or from your code. The shake trigger and the Android notification-bar trigger are off by default in 7.x. They were on in 6.x. + +The data in a report (screen video, touches, console logs, network traffic, breadcrumbs, attributes and the text a user types into the report dialog) can contain personal data. It is the responsibility of your application to keep sensitive data out of reports before they leave the device. Bugsee gives you a control at each point where data is recorded. + +The Unity package is a wrapper. It starts the native Android SDK (7.6.0) and iOS SDK (7.1.0), and the native SDKs do the recording and the redaction. Where a Unity API forwards to a native feature, the Unity pages say so and link to the native 7.x privacy page. On players other than Android and iOS, the Editor included, the package records nothing and the privacy calls do nothing. + +## Where the controls are + +| Page | Covers | +| --- | --- | +| [Video](/sdk/unity/privacy/video) | Turning video and the screenshot off, secure rectangles for Unity content, WebView secure views, blackout. | +| [Console logs](/sdk/unity/privacy/logs) | Turning log capture off, the log level, `SetLogEventFilter`, `Bugsee.Log` and the filter. | +| [Network](/sdk/unity/privacy/network) | Turning network capture off, body options, the built-in redaction, `SetNetworkEventFilter`, `ApplyDefaultNetworkSanitizer`. | +| [Breadcrumbs](/sdk/unity/privacy/breadcrumbs) | Breadcrumbs are off by default, `SetBreadcrumbFilter`. | +| [Report](/sdk/unity/privacy/report) | Editing or removing report fields, attributes, labels, attachments and the screenshot in a report handler. | +| [Cleanup](/sdk/unity/privacy/cleanup) | `DeleteCollectedDataOnDevice` and `DeleteScope`, clearing the user identifier and attributes, how much waits on the device. | + +## What is recorded by default + +You set every option below on the launch options you pass to `Bugsee.Launch`. See [Configuration](/sdk/unity/configuration) for how options reach the SDK. + +| Data | Option | Default | Notes | +| --- | --- | --- | --- | +| Screen video and touches | `CaptureVideo` | on | [Privacy: Video](/sdk/unity/privacy/video) | +| Report screenshot | `CaptureScreenshot` | on | Separate from the video option. | +| Unity scene tree (names and component types, no text) | `CaptureViewHierarchy` | on | [View hierarchy](/sdk/unity/view-hierarchy) | +| Console logs | `CaptureLogs` | on | Includes the Unity console output the package forwards. [Privacy: Console logs](/sdk/unity/privacy/logs) | +| Network traffic | `CaptureNetwork` | on | [Privacy: Network](/sdk/unity/privacy/network) | +| WebSocket traffic (iOS) | `CaptureWebSocket` | on | Set on `IOSLaunchOptions`. | +| Breadcrumbs | `CaptureBreadcrumbs` | off | [Privacy: Breadcrumbs](/sdk/unity/privacy/breadcrumbs) | + +The defaults come from the option manifests of the two native SDK versions the package wraps. The data you add yourself is recorded as you pass it: [custom events and traces](/sdk/unity/events-and-traces), and the [user identifier and attributes](/sdk/unity/user-session-data). + +## Options that record more + +These options are off by default. Each one records data you may not want in a report, so enable it only when your users know about it and agree. + +| Option | Platform | What it adds | +| --- | --- | --- | +| `CaptureCameraPreview` | iOS | The live image of a native `AVCaptureVideoPreviewLayer`, so a report shows what the camera sees. It also makes Bugsee take part in your capture session. It does not record Unity's `WebCamTexture`. | +| `CaptureDeviceNetworkNames` | iOS | The device name and the Wi-Fi network name, which are personal data. Without it the SDK sends a redacted value. | +| `CrashNdkIncludeTombstoneLogs` | Android | The raw log buffers of the OS tombstone in a native crash report. They skip the Bugsee log filters and redaction, so they are uploaded as the OS wrote them. | + +:::warning[iOS early launch starts before your consent check] +If you turn on the optional iOS early launch at build time, the iOS SDK starts natively before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for user consent. See [iOS build setup](/sdk/unity/build-setup/ios). +::: + +The optional iOS [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) is a separate component. Read its page before you add it to an app that asks for consent. + +## Reports waiting on the device + +A report that cannot be sent right away waits on the device. Three launch options bound how much waits and for how long. Past a limit, the oldest reports are deleted whole: errors first, then bug reports, then crashes, and the newest crash is kept. + +| Option | Default | Meaning | +| --- | --- | --- | +| `MaxDataSize` | 150 | Disk space in MB that waiting reports may take up. A value below 10 is raised to 10. | +| `MaxPendingReports` | 30 | The most reports that may wait. A value below 1 is raised to 1. | +| `MaxPendingReportAge` | 30 | Days a report may wait before it is deleted, whatever its type. 0 or a negative value turns the age limit off. | + +`MaxDataSize` defaults to 150 on both platforms. It was 50 on iOS in earlier native versions. See [Privacy: Cleanup](/sdk/unity/privacy/cleanup). + +## Data sent outside reports + +Two features send data without a report, and only when your app calls them: + +- [Notification relay](/sdk/unity/notification-relay): `Bugsee.Notify` sends the title, body and fields you pass to your messaging integrations. No video, logs or events are attached. +- [Feedback](/sdk/unity/feedback): the messages a user types into the feedback chat. The add-on is opt-in. + +## Things to know + +- **Install filters and the report handler before `Bugsee.Launch`.** A filter applies to what is recorded after you set it. Set the log, network and breadcrumb filters and the report handler at the top of your startup code. +- **Filters and the report handler run on the Unity main thread.** The native SDKs can call them on other threads, and the package hands each call to the main thread. While the app is in the background, Unity's loop is paused, and filter calls wait until it resumes. +- **A filter that throws drops the event.** The package drops an event when your filter throws an exception. It does not record the event unfiltered. +- **A network filter turns the built-in network redaction off.** Run `Bugsee.ApplyDefaultNetworkSanitizer` first in your filter to keep it. See [Privacy: Network](/sdk/unity/privacy/network). +- **The report handler is not a redaction boundary for every report.** It is skipped for a report that is created while the process is terminating, and it cannot remove the video, the logs or the network traffic from a report. See [Privacy: Report](/sdk/unity/privacy/report). +- **Secure rectangles cover Unity content.** Unity draws its UI itself, so the native secure views and the automatic masking of native password fields do not know your Unity elements. Register a rectangle for each one. See [Privacy: Video](/sdk/unity/privacy/video). + +## Native references + +- Android: [Privacy overview](/sdk/android/privacy/overview). +- iOS: [Privacy overview](/sdk/ios/privacy/overview). diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md index c7e0be01..296aa3e4 100644 --- a/docs/sdk/unity/privacy/report.md +++ b/docs/sdk/unity/privacy/report.md @@ -1,6 +1,6 @@ --- title: "Privacy: Report" -description: "TODO(writer-D): Privacy: Report for the Bugsee Unity SDK 7.x." +description: "How to strip sensitive data from Bugsee Unity SDK 7.x reports before upload: what a report carries, what a report handler can change, the report screenshot, and turning the screenshot off." sidebar_position: 6 slug: "/sdk/unity/privacy/report" --- @@ -9,4 +9,141 @@ slug: "/sdk/unity/privacy/report" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +A report bundles what the SDK recorded with what the user or your code put into it. The recorded streams have their own controls on the other privacy pages. This page covers the rest: the report's own fields, attributes, labels and attachments, and the report screenshot. You change them with a report handler before the report is sent. See [Report handler](/sdk/unity/report-handler) for the full contract, and the native pages [Android report privacy](/sdk/android/privacy/report) and [iOS report privacy](/sdk/ios/privacy/report) for the native side. + +## What a report carries + +| Part | Where it comes from | Control | +| --- | --- | --- | +| Video, screenshot, touches | Screen capture | [Privacy: Video](/sdk/unity/privacy/video) | +| Unity scene tree | `CaptureViewHierarchy` | [View hierarchy](/sdk/unity/view-hierarchy) | +| Console logs | Log capture and `Bugsee.Log` | [Privacy: Console logs](/sdk/unity/privacy/logs) | +| Network traffic | Network capture and `Bugsee.AddNetworkEvent` | [Privacy: Network](/sdk/unity/privacy/network) | +| Breadcrumbs | `Bugsee.AddBreadcrumb` and the native SDKs | [Privacy: Breadcrumbs](/sdk/unity/privacy/breadcrumbs) | +| Custom events and traces | `Bugsee.Event`, `Bugsee.Trace` | What you pass in. See [Custom events & traces](/sdk/unity/events-and-traces). | +| Summary, description, email, severity | The report dialog, `Bugsee.Upload`, `Bugsee.CreateReport`, or the error that raised the report | A report handler | +| Labels | The report dialog and your code | A report handler | +| Attributes and the user identifier | `Bugsee.SetAttribute`, `Bugsee.SetUserIdentifier` | [User & session data](/sdk/unity/user-session-data); per report, a report handler | +| Attachments | Your code | You add them. A report handler can clear them. | + +## What a report handler can change + +`Bugsee.SetReportHandler(IReportHandler handler)` registers an object whose two methods run around the reports the native SDK builds: + +- `OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback)` +- `OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback)` + +Derive from `ReportHandlerBase` and override what you need. Each method must call `completionCallback()` when it is done. The `IReport` you receive is the report itself: what you change is what is uploaded. + +| You can | With | +| --- | --- | +| Rewrite or clear the summary, the description and the email | `report.Summary`, `report.Description`, `report.Email` | +| Change the severity | `report.Severity` (an `IssueSeverity?`) | +| Remove or change attributes | `report.RemoveAttribute(name)`, `report.SetAttribute(name, value)`, `report.ClearAllAttributes()`; `report.Attributes` lists them | +| Replace or clear the labels | `report.SetLabels(labels)`, `report.ClearLabels()`; `report.Labels` lists them | +| Remove the attachments | `report.ClearAttachments()`; `report.Attachments` lists them | +| Add an attachment | `report.AddAttachmentFile(path, name, mimeType)`, `report.AddAttachmentBytes(data, name, mimeType)` | +| List, read, replace or remove the screenshot | `ScreenshotDisplayIds`, `GetScreenshotPng`, `SetScreenshotPng` (see below) | + +```csharp +using System; +using System.Text.RegularExpressions; +using Bugsee.Contracts.Reporting; +using BugseeSdk = Bugsee.Bugsee; + +public sealed class RedactingReportHandler : ReportHandlerBase +{ + static readonly Regex CardNumber = new Regex(@"\b\d(?:[ -]?\d){12,18}\b"); + + public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) + { + Redact(report); + completionCallback(); + } + + public override void OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback) + { + Redact(report); + completionCallback(); + } + + static void Redact(IReport report) + { + // Strip what the user may have typed into the report dialog. + report.Email = null; + if (report.Description != null) + report.Description = CardNumber.Replace(report.Description, "[CARD]"); + + // Keep an attribute off the report. + report.RemoveAttribute("session_token"); + + // No attachments at all. + report.ClearAttachments(); + } + + public static void Install() + { + BugseeSdk.SetReportHandler(new RedactingReportHandler()); + } +} +``` + +Call `RedactingReportHandler.Install()` before `Bugsee.Launch`. + +The example runs the same redaction in both phases. Which phase already holds the text a user typed into the report dialog is the native SDK's behavior: see [Android report privacy](/sdk/android/privacy/report) and [iOS report privacy](/sdk/ios/privacy/report). A redaction that runs in both phases does not depend on it. + +What to know: + +- **The handler runs on the Unity main thread, inside its turn.** Do the redaction there, keep it short, and call `completionCallback()` when you are done. +- **The SDK does not wait indefinitely.** The native SDK carries on with the report unchanged after the handler timeout, 30 seconds by default. A before-phase handler that only gets to run after that is skipped. On Android, the `ReportHandlerCallbackTimeout` launch option sets the timeout. The iOS SDK does not read that option. While the app is in the background, Unity's loop is paused, and the handler waits until it resumes. +- **The handler is skipped for a report that is created while the process is terminating.** When `isTerminating` is `true`, the package acknowledges the native SDK at once and does not call your handler. Do not rely on the handler to redact those reports. Keep the data out where it is recorded: mask it on screen, or drop it in a filter. +- **Edits after the handler's turn are not applied.** Do not keep the `IReport` and change it later. +- **The handler cannot remove the video, the logs or the network traffic from a report.** Use the capture options and the filters. +- **A report from `Bugsee.CreateReport`.** `IReport.Email` set on a report from `Bugsee.CreateReport` is used on Android. On iOS it is dropped with a warning, because the managed upload cannot carry it. Use `Bugsee.SetUserIdentifier` there. + +## The report screenshot + +The SDK attaches a screenshot of the screen to the report. Secure rectangles and blackout redact what is captured. To send no screenshot at all, set `CaptureScreenshot` to `false` on your launch options. See [Privacy: Video](/sdk/unity/privacy/video#disabling-video). + +In a report handler you can read, replace or remove the screenshot, as PNG bytes, per display: + +```csharp +using System; +using System.Collections.Generic; +using Bugsee.Contracts.Reporting; + +public sealed class ScreenshotRemovingHandler : ReportHandlerBase +{ + public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) + { + var displays = new List(report.ScreenshotDisplayIds); // usually 0 + foreach (int display in displays) + { + report.SetScreenshotPng(display, null); // remove it + } + completionCallback(); + } +} +``` + +- `ScreenshotDisplayIds` lists the displays that hold a screenshot, and is empty when there is none. `GetScreenshotPng(displayId)` returns the PNG bytes as a copy you own. `SetScreenshotPng(displayId, png)` replaces the screenshot, and `null` removes it. `IsScreenshotChanged` becomes `true` once a screenshot the report holds is replaced or removed. +- These calls work in both phases, on Android and iOS, on the report a handler receives. They are not available on a report from `Bugsee.CreateReport`: it holds no screenshot, the getters return nothing, and a set returns `false` and logs a warning once. +- `GetScreenshotPng` returns `null` both for a display with no screenshot and for a listed display whose screenshot cannot be read. If a display is listed and you get `null`, do not assume there is nothing to redact. Replace or remove that screenshot. +- `SetScreenshotPng` returns `true` when the report took the change. It returns `false`, with a warning, for data that is not a PNG, for data over 32 MiB, for a PNG with a side over 8192 pixels, and for a PNG the platform cannot decode. +- Call them on Unity's main thread, inside the handler's turn. `GetScreenshotPng` blocks that thread while the SDK produces the PNG. + +:::warning[A screenshot you set is not redacted] +A screenshot is the screen as it was captured. It can show personal data. Nothing re-checks a bitmap you read or replace, and a screenshot you set replaces the captured one in the report and its upload with no redaction added for you. Do not log the bytes or send them anywhere the report does not go. To send none at all, use `CaptureScreenshot = false`. +::: + +Attachments cannot remove, replace or redact the SDK's screenshot. + +## Attributes and the user identifier + +Attributes you set with `Bugsee.SetAttribute` and the user identifier you set with `Bugsee.SetUserIdentifier` are included in the reports Bugsee builds while they are set. Clear them with `Bugsee.ClearAttribute`, `Bugsee.ClearAllAttributes` and `Bugsee.ClearUserIdentifier`. See [User & session data](/sdk/unity/user-session-data) and [Privacy: Cleanup](/sdk/unity/privacy/cleanup). + +## Related pages + +- [Report handler](/sdk/unity/report-handler): the full contract. +- [Privacy: Cleanup](/sdk/unity/privacy/cleanup): deleting what is stored on the device. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx index 77447a26..a76bb2a3 100644 --- a/docs/sdk/unity/privacy/video.mdx +++ b/docs/sdk/unity/privacy/video.mdx @@ -1,6 +1,6 @@ --- title: "Privacy: Video" -description: "TODO(writer-D): Privacy: Video for the Bugsee Unity SDK 7.x." +description: "How to keep sensitive content out of Bugsee Unity SDK 7.x video and screenshots: turning capture off, secure rectangles for Unity content, WebView secure views, and blackout." sidebar_position: 2 slug: "/sdk/unity/privacy/video" --- @@ -9,4 +9,220 @@ slug: "/sdk/unity/privacy/video" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-D) +Bugsee records the screen as video, attaches a screenshot to the report, and records touches. A secure rectangle hides a region in the video and in the report screenshot. This page covers what the Unity package exposes. The native SDKs do the masking: see [Android video privacy](/sdk/android/privacy/video) and [iOS video privacy](/sdk/ios/privacy/video) for what they hide on their own. + +## Disabling video + +Set `CaptureVideo` to `false` to record no video. The report screenshot is a separate option: set `CaptureScreenshot` to `false` to attach none. Both default to `true` on both platforms. Both properties are on `BugseeLaunchOptions`, so `AndroidLaunchOptions` and `IOSLaunchOptions` have them. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +public static class BugseeStartup +{ + public static void Launch() + { +#if UNITY_ANDROID + var options = new AndroidLaunchOptions { CaptureVideo = false, CaptureScreenshot = false }; + BugseeSdk.Launch("", options); +#elif UNITY_IOS + var options = new IOSLaunchOptions { CaptureVideo = false, CaptureScreenshot = false }; + BugseeSdk.Launch("", options); +#endif + } +} +``` + +See [Configuration](/sdk/unity/configuration) and [Video capture](/sdk/unity/video-capture) for the other video options. + +## What the package can hide + +The package has no call that marks a `GameObject` or a uGUI element secure. The native secure-view calls (`addSecureView` and its Android equivalents) are not exposed. Unity draws your content itself, so you hide it by its screen coordinates: + +| To hide | Use | +| --- | --- | +| A region of Unity content, in Unity screen coordinates | [`AddSecureScreenRectangle`](#unity-screen-coordinates) | +| A region you already measured in native pixels | [`AddSecureRectangle`](#native-pixel-coordinates) | +| A native WebView from a WebView plugin | [`AddSecureWebView`](#webview-secure-views) | +| Everything, for a period | [`StartBlackout`](#blackout) | + +Treat a text field, a password field or a balance label that Unity draws as unprotected until you register a rectangle for it. + +A rectangle hides the area in the video and in the report screenshot. A rectangle does not delete anything from the device, and it does not change what is in the log, the network events or the breadcrumbs. Use the other privacy pages for those. + +### Unity screen coordinates + +`Bugsee.AddSecureScreenRectangle(Rect unityScreenRect, int displayId = 0)` takes what Unity's screen space gives you: pixels of `Screen.width` by `Screen.height` with the origin at the **bottom-left**. `Input.mousePosition` is in that space, and so are the world corners of a `RectTransform` on a Screen Space - Overlay canvas. The package converts the rectangle for you: it flips the y axis, scales it from Unity's render size to the native surface (Android Resolution Scaling, `Screen.SetResolution`, the iOS render scale) and offsets it by where Unity's surface sits on the screen. The result is rounded outwards. + +```csharp +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public class SecureElement : MonoBehaviour +{ + [SerializeField] RectTransform element; // on a Screen Space - Overlay canvas + + Rect hidden; + + void Start() + { + Canvas.ForceUpdateCanvases(); // the corners are valid only after the layout ran + var corners = new Vector3[4]; + element.GetWorldCorners(corners); // bottom-left, top-left, top-right, bottom-right + hidden = Rect.MinMaxRect(corners[0].x, corners[0].y, corners[2].x, corners[2].y); + BugseeSdk.AddSecureScreenRectangle(hidden); + } + + void OnDestroy() + { + BugseeSdk.RemoveSecureScreenRectangle(hidden); + } +} +``` + +How it behaves: + +- The package remembers the rectangle as a **fraction of the screen it was added for** and converts it again, within a frame, when the screen size or the position of the surface changes. It follows Resolution Scaling, a moving surface and any layout that scales with the screen. +- It does **not** know your layout. After a rotation, or any change that does not scale proportionally (fixed-size or anchored UI), call `RemoveSecureScreenRectangle` with the rectangle you added, and add the new one. +- Remove a rectangle with exactly the values you added. A rectangle recomputed from floats can differ in the last bit and then removes nothing. +- Adding the same rectangle twice needs two removals. +- The call is queued to Unity's main thread and takes effect on the next frame, in call order with the other screen-space calls and with `RemoveAllSecureRectangles()`. +- A `NaN` value is ignored with a warning. A rectangle that is entirely off screen hides nothing. +- `displayId` 0 is the main display. For another id, the rectangle is in the rendering space of `Display.displays[displayId]` and is converted with that display's system size and no offset. A display that does not exist registers nothing and logs a warning. A negative id throws `ArgumentOutOfRangeException`. +- If the package cannot read the surface, it uses the last surface it read, or the full size of the display if it has read none yet. It logs a warning once per change of state. + +### Native pixel coordinates + +`Bugsee.AddSecureRectangle(RectInt pixelRect)` passes the rectangle to the native SDKs as given. It takes screen pixels with the origin at the **top-left**, y growing downward. It is not flipped from Unity's bottom-left space. On Android the pixels are display pixels. On iOS the package divides by the screen scale to get points. + +Convert a Unity screen rectangle before you add it: + +```csharp +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public static class SecureRects +{ + // Unity screen rect (bottom-left origin) -> rect for AddSecureRectangle (top-left origin). + public static RectInt ToSecureRect(Rect unityScreenRect) + { + int x = Mathf.FloorToInt(unityScreenRect.xMin); + int y = Mathf.FloorToInt(Screen.height - unityScreenRect.yMax); + int w = Mathf.CeilToInt(unityScreenRect.xMax) - x; + int h = Mathf.CeilToInt(Screen.height - unityScreenRect.yMin) - y; + return new RectInt(x, y, w, h); + } + + public static void Hide(Rect unityScreenRect) + { + BugseeSdk.AddSecureRectangle(ToSecureRect(unityScreenRect)); + } +} +``` + +Limits of this call: + +- The rectangle must already be in the coordinate space of the native display. The package does no scaling or offsetting for it, beyond the iOS conversion to points. With Android Resolution Scaling, `Screen.SetResolution`, or a Unity view that does not fill the screen (a status bar or notch offset), `Screen.height` and the pixels differ from native pixels. Scale or offset the rectangle yourself, or use `AddSecureScreenRectangle`, which does it for you. +- On iOS the division by `UIScreen.scale` is wrong if the render size differs from the screen's points times its scale. +- Rectangles are not scaled, flipped or moved on rotation or resize. They are keyed by their exact left, top, right and bottom values. When the screen size changes, remove the old rectangle, or call `RemoveAllSecureRectangles()`, before you add the new one. +- Adding the same rectangle twice needs two removals. + +Remove a rectangle with `Bugsee.RemoveSecureRectangle(RectInt)`, passing the same top-left rectangle you added. `Bugsee.RemoveAllSecureRectangles()` removes every rectangle added with `AddSecureRectangle` at once, and every rectangle added with `AddSecureScreenRectangle` on the next frame. + +`Bugsee.GetAllSecureRectangles()` returns a `RectInt[]` with the rectangles added with `AddSecureRectangle` that are not removed yet, in the top-left pixels they were added with, in no particular order. Each distinct rectangle is listed once, and one added several times is listed until it is removed as often as it was added. It is empty when there are none. It does not list rectangles added with `AddSecureScreenRectangle`. The package answers from its own list, because it gives the native SDKs its rectangles through its own provider. + +### Rectangles and the Unity scene tree + +The [view hierarchy](/sdk/unity/view-hierarchy) of a report is the Unity scene tree. A node of that tree whose box overlaps a secure rectangle loses its name and its component list. The node keeps its class name and its bounds. A node whose bounds cannot be placed counts as covered while any rectangle is registered. The tree never contains the text of a label or an input field. + +## WebView secure views + +If your app embeds a native WebView through a WebView plugin, mark it with `Bugsee.AddSecureWebView` so that its area is hidden in the video. Pass the native handle of the WebView, which the plugin must expose: an `AndroidJavaObject` holding the `android.webkit.WebView` on Android, and an `IntPtr` to the `WKWebView` on iOS. The call returns `false` for a null or zero handle, for an object that is not a WebView, and in the Editor. + +```csharp +using System; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +public static class SecureWebViews +{ + public static bool Hide(AndroidJavaObject androidWebView) => BugseeSdk.AddSecureWebView(androidWebView); + + public static bool Hide(IntPtr wkWebViewPointer) => BugseeSdk.AddSecureWebView(wkWebViewPointer); + + public static bool Show(AndroidJavaObject androidWebView) => BugseeSdk.RemoveSecureWebView(androidWebView); + + public static bool Show(IntPtr wkWebViewPointer) => BugseeSdk.RemoveSecureWebView(wkWebViewPointer); +} +``` + +- **Android.** The call runs on the Android UI thread and waits for it. A request that the UI thread does not reach within 3 seconds is dropped, logged, and returns `false`: call it again. The SDK buffers a registration made before launch. It does not survive `Stop()`, so register again after a relaunch. +- **iOS.** The native `addSecureWebView:` alone does not hide the web view. It protects secure areas inside the page. The package therefore also calls `addSecureView:`, which masks the view in the video. The SDK masks a view only while it is launched: a call made before the launch finished has no effect on the video, so call it after `Bugsee.IsLaunched` is `true`. `RemoveSecureWebView` calls `removeSecureView:`, which also lifts a mask that your own code set on the same view. The pointer must be a live Objective-C object. A pointer to another class is refused, and a stale or non-object pointer is undefined. + +Limits: + +- It marks a native view. It does nothing for a page that a plugin draws into a Unity texture. Use a secure rectangle for that. +- It does nothing while the experimental Android Unity frame pusher (`VideoMode.DirectBuffers`) is the capture source, because that capture does not know native views. See [Video capture](/sdk/unity/video-capture). + +For what the native SDKs hide inside a page, see [Android WebView](/sdk/android/webview) and the WebView section of [iOS video privacy](/sdk/ios/privacy/video#webview-elements). + +## Android windows marked `FLAG_SECURE` + +On Android, the SDK blanks a window that carries the system `FLAG_SECURE` flag, without any Bugsee call. The `CaptureRespectFlagSecure` option controls this on `AndroidLaunchOptions`. It is on by default. Set it to `false` if your app marks windows `FLAG_SECURE` broadly and you want them recorded. See [Android video privacy](/sdk/android/privacy/video). + +## Blackout + +Blackout blanks the capture for as long as you need it. The calls forward to the native SDKs. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +public static class SensitiveFlow +{ + public static void Run() + { + BugseeSdk.StartBlackout(); + try + { + // The sensitive flow. + } + finally + { + BugseeSdk.EndBlackout(); + } + } + + public static bool IsHidden => BugseeSdk.IsBlackout; // a property +} +``` + +- `Bugsee.StartBlackout()`, `Bugsee.EndBlackout()` and the `Bugsee.IsBlackout` property are the API. `Bugsee.Pause()` and `Bugsee.Resume()` still exist as obsolete aliases of the first two. +- The transitions raise the lifecycle events `LifecycleEvents.BlackoutStarted` and `LifecycleEvents.BlackoutEnded`. See [Lifecycle](/sdk/unity/lifecycle). +- What a blackout suppresses, and how long it lasts across `Stop` and relaunch, is the native SDK's behavior. See [Android video privacy](/sdk/android/privacy/video) and the [iOS blackout section](/sdk/ios/privacy/video#blackout). + +## Recording less detail + +`CaptureVideoScale` and `CaptureScreenshotScale` are float options on `BugseeLaunchOptions` that scale the recorded video and the screenshot down. Both default to `1.0` on both platforms, which leaves the picture as it is. A lower value reduces the detail of what is recorded. The accepted ranges and the exact effect are the native SDKs': see [Android configuration](/sdk/android/configuration) and [iOS configuration](/sdk/ios/configuration). + +## Native video options on iOS + +These options are on `IOSLaunchOptions` and are off by default. Each records content that your Unity views do not draw: + +| Option | What it records | +| --- | --- | +| `CaptureAVPlayer` | Video rendered onto a native `AVPlayerLayer`. It does not apply to Unity's `VideoPlayer`. | +| `CaptureSampleBufferDisplayLayer` | Video rendered onto an `AVSampleBufferDisplayLayer`, as used by WebRTC and custom players. | +| `CaptureCameraPreview` | The live image of a native `AVCaptureVideoPreviewLayer`. It does not apply to Unity's `WebCamTexture`. | + +:::warning[Camera preview records what the camera sees] +With `CaptureCameraPreview` on, a report contains whatever the lens is pointed at. It also makes Bugsee take part in your capture session. Do not enable it unless your users know and agree. +::: + +`CaptureVideoPrivacyBlur` (iOS, on by default) blurs the video frames recorded while protected views move. With it off, the video freezes for the transition instead. The transition is never recorded unprotected. + +## Related pages + +- [Video capture](/sdk/unity/video-capture): the video options and modes. +- [View hierarchy](/sdk/unity/view-hierarchy): the Unity scene tree in a report. +- [Privacy overview](/sdk/unity/privacy/overview): every privacy control. diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index b4811ee5..50766141 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -1,6 +1,6 @@ --- title: "Release notes" -description: "TODO(writer-F): Release notes for the Bugsee Unity SDK 7.x." +description: "Release history for Bugsee Unity SDK 7.x (beta), with the native SDK versions each release is built on." sidebar_position: 23 slug: "/sdk/unity/release-notes" --- @@ -9,4 +9,94 @@ slug: "/sdk/unity/release-notes" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-F) +Release history for Bugsee Unity SDK 7.x, the package `com.bugsee.unity`. Looking for the stable release? See the [6.x release notes](/sdk/unity/v6/release-notes). Upgrading from 6.x? See the [migration guide](/sdk/unity/migration). + +Each release lists the native SDKs it is built on. Their own changes are in the native SDK release notes: [Android](/sdk/android/release-notes) and [iOS](/sdk/ios/release-notes). + +## 7.0.0-beta.1 (November 23 2026) + +The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API, built on Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. + +**Highlights** + +- **A new package and a new C# API.** You install `com.bugsee.unity` from a git tag with the Unity Package Manager, and you call the static class `Bugsee` (namespace `Bugsee`). See [Installation](/sdk/unity/installation). +- **Typed launch options** for Android and iOS, `AndroidLaunchOptions` and `IOSLaunchOptions`, with the same keys the native SDKs read. See [Configuration](/sdk/unity/configuration). +- **iOS Crash Report Extension** (Xcode 27 and later) and opt-in **iOS native early launch**. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). +- **Symbol upload from the build** for Android and iOS. See [Symbolication](/sdk/unity/symbolication/overview). + +**Breaking changes** + +The [migration guide](/sdk/unity/migration) lists every change from 6.x, with the old and the new code. These are the main ones. + +- **New package, new API.** The `.unitypackage` and the `Assets/Plugins/Bugsee` files, the `BugseeLauncher` component and the namespace `BugseePlugin` are replaced by the git package and the namespace `Bugsee`. Remove the 6.x plugin files and the old AAR, and port your calls. +- **Shake-to-report and the Android notification-bar trigger are off by default** (iOS SDK 7.1.0 and Android SDK 7.6.0). Set `ReportingTriggerByShake = true` (both platforms) and `AndroidLaunchOptions.ReportingTriggerByNotification = true` (Android) to turn them on. +- **`ShowReportDialog` and `Upload` take `IssueSeverity? severity = null`.** `null` uses the `ReportingDefaultBugPriority` option. They used to always send High. +- **Attribute values read back as `long` and `double` on Android**, as on iOS: `GetAttribute`, `GetAllAttributes` and `IReport.GetAttribute`. Replace `(int)` unboxing with `Convert.ToInt32` or a cast to `long`. +- **There is no typed `Debug` or `Endpoint` launch option.** Set an endpoint with `SetCustomOption("com.bugsee.option.$$ENDPOINT", url)`. +- **The iOS key `BugseeEnableMachExceptions` is not supported.** Use `IOSLaunchOptions.CrashHandlerType`. +- **The client signature of managed exceptions changed**, so existing issues can regroup after the update. +- **If your CI sets `BUGSEE_BUILD_UUID`,** the Android mapping upload is now keyed by the build id the built app carries. The variable applies only when the app has none and the value is a UUID. +- **An iOS export on Xcode 27 or later can add a `BugseeCrashReport` extension target** and an App Group entitlement. Set `BUGSEE_IOS_CRASH_EXTENSION=0` to keep the export as before. + +**Added** + +- **`CrashSignals` reaches Android.** It is a shared launch option now (it was iOS only). On Android it is read by the NDK module. A mask meant only for iOS, such as `CrashSignals.None`, also narrows native signal capture on Android: leave it out of the Android options to keep every signal. +- **`DeleteScope` and `DeleteCollectedDataOnDeviceAsync`.** `Bugsee.DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)` returns a `Task`, and `DeleteCollectedDataOnDevice(DeleteScope scope)` is the synchronous form. On Android, `DeleteCollectedDataOnDevice()` also deletes finished reports that were not uploaded yet, and stops the SDK first. Use `DeleteScope.CaptureAndIntermediate` to keep them. See [Lifecycle & status](/sdk/unity/lifecycle#delete-collected-data). +- **`IReport.Severity` is `IssueSeverity?`.** `null` is unset. +- **Typed options.** Android options such as `MaxDataSize` and iOS options such as `CrashSignals`, `CaptureOnDeviceSymbolication`, `CrashSwiftAsyncStackTraces`, `CrashFillEmptyExceptionStacks` and `CaptureWebSocket` have typed properties and `Options` constants. They were reachable only through `SetCustomOption`. +- **`CaptureUnobservedTaskExceptions`.** A Unity-only option, `true` by default, that needs `CaptureManagedExceptions`. Set it to `false` to stop reporting `TaskScheduler.UnobservedTaskException` as a handled error. +- **`Bugsee.ApplyDefaultNetworkSanitizer`** runs the SDK's built-in network redaction on an event, on Android and now on iOS (it returns `false` in the Editor). Call it first in a network filter to keep the redaction. See [Network events](/sdk/unity/network). +- **iOS native early launch** (opt-in, off by default). With `BUGSEE_IOS_EARLY_LAUNCH=1` and `BUGSEE_IOS_APP_TOKEN`, or **Bugsee > iOS > Early Launch**, the iOS SDK starts at app launch, before Unity's first scene, and the first `Bugsee.Launch` adopts that session. The SDK then starts before any C# consent check. See [Lifecycle & status](/sdk/unity/lifecycle#ios-early-launch). +- **iOS Crash Report Extension.** On Xcode 27 and later the iOS export adds a `BugseeCrashReport` extension target, so that devices on iOS 27 and later report foreground (crash) and background (non-fatal) out-of-memory kills and exits. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). +- **Built-in module declarations.** The package declares the Unity modules `com.unity.modules.androidjni`, `jsonserialize` and `ui`. Without them, a project that had those modules disabled failed to compile. `com.unity.modules.screencapture` stays optional. + +**Changed** + +- **Native SDKs moved to Android SDK 7.6.0 and iOS SDK 7.1.0.** Their option defaults changed: see the shake and notification-bar item under Breaking changes. +- **Feedback is opt-in and works when on.** Add the scripting define `BUGSEE_FEEDBACK` (or set the environment variable `BUGSEE_FEEDBACK=1` for the export) to link the feedback add-on. See [Feedback](/sdk/unity/feedback). +- **Android symbols.** The Editor's upload of Unity's `symbols.zip` now gives `libunity.so`, `libil2cpp.so` and `libmain.so` the unwind tables that Unity strips from that copy, taken from the same-build-id libraries in the built APK or AAB. +- **Android launch and iOS launch options** are checked against the option manifests the native SDKs publish. +- **`Relaunch` and `RelaunchAsync` replace the whole option set** on both platforms. Pass the full set again. See [Lifecycle & status](/sdk/unity/lifecycle). +- **Breadcrumbs and log lines.** `CaptureBreadcrumbs` is off by default on both native SDKs, so `Bugsee.AddBreadcrumb` records nothing until you set it. `Bugsee.Log(message, level)` lines skip the log filter on both platforms. +- **`ResetVideoCapturePermission()` on iOS** logs a warning once, because iOS has no capture permission to reset. +- **`Bugsee.SetAttribute` in the Editor and on unsupported platforms** applies the same validation as on a device and throws `ArgumentException` for an invalid key or value. It still stores nothing. +- **The iOS Simulator.** The SDK logs a warning once at the first launch on the iOS or tvOS Simulator: its build has no crash reporter, so crashes, hangs and managed exceptions are reported only from a device. +- **`Bugsee.IsBlackout` on iOS** reads the state from the iOS SDK. + +**Fixed** + +- The Android Mono Portable PDB upload fetches `bugsee-cli` 0.9.0 when the installed CLI is older. Before, a machine with CLI 0.8.1 or 0.8.2 got a warning and no mapping, and managed frames stayed IL offsets. +- iOS: `xcodebuild` of an export with `BUGSEE_APP_TOKEN` and the Crash Report Extension on no longer fails with `Cycle inside Unity-iPhone`. +- iOS: an Append export no longer lists the Run Script phase twice after the IL2CPP arguments change. +- iOS: the symbol upload Run Script no longer passes an empty `--version` or `--build` when the export has no `MARKETING_VERSION` or `CURRENT_PROJECT_VERSION`. The values come from `BUGSEE_VERSION` and `BUGSEE_BUILD`, then from the built app. +- Android, Export Project: `assembleRelease` no longer fails in `:unityLibrary:buildIl2Cpp` on Unity 6 and 2021.3 because of the IL2CPP line map arguments. +- Android, Unity 6: a Minify build no longer stops in `:launcher:minifyReleaseWithR8` with a missing class such as `android.telephony.satellite.SatelliteManager`. +- Android: native (NDK) crash capture is set up on a Unity 6 build with AGP 9.0.0. +- Android, Windows: a build output under a path over 260 characters no longer breaks the symbol upload's reads or uploads a mapping under a wrong build id. +- The Bugsee Editor assembly compiles in an Editor without iOS Build Support. +- The build-output scans no longer stop at one bad folder or hide it silently. +- `BUGSEE_NO_SYMBOL_UPLOAD` also turns off the IL2CPP line map upload, on iOS as well, as it does for the R8 mapping and native symbol uploads. +- The symbol upload also sends the native libraries that Unity's `symbols.zip` does not hold, when they are the build's own and still carry symbols. +- The client signature of a managed exception no longer depends on the Java call site on Android, and is the same recipe on both platforms. +- `Bugsee.Trace` with a map, list or array records the same JSON on both platforms (at most 8192 UTF-16 units). On Android, maps, lists and arrays you pass to the SDK are sent as JSON text and not as their type name. +- `AddAttachmentFile` on a report from `CreateReport` copies the file under the app's cache directory, not `/data/local/tmp`, which some Android 11 devices do not let the app write. +- Values that cross to native or become identifiers no longer follow the device's culture: a device with a decimal comma wrote `1,5`, and a bool was `"True"`. +- iOS: lifecycle events that arrive before the managed callback is registered are held (up to 128) and replayed in order after the registering `Launch` or `Relaunch` call, as on Android. A lifecycle payload that is a dictionary reaches your listener as a `Dictionary`. +- Managed exceptions the SDK reports from Unity's log text no longer forward a hex value found in that text as a frame address. + +**Known issues** + +- Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public (symbol table only). Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. See [Symbolication: Android](/sdk/unity/symbolication/android#public-and-debugging-symbols). +- Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). +- After an iOS launch that ended before the app became active, the next launch may block the main thread for up to about 8 seconds while the crash report uploads. The fix is in the native iOS SDK and is not released yet. Normal Unity launches do not hit it, because the SDK starts while the app is active. The opt-in iOS native early launch starts the SDK at app launch, before the app is active, so an app that uses it can hit this. + +**Compatibility** + +- Unity 2021.3 or later. iOS 15.0 or later, Android API 21 or later. +- Android: Bugsee Android SDK 7.6.0 (with `bugsee-android-ndk` 7.6.0), Bugsee Gradle plugin 4.1.1. +- iOS: Bugsee iOS SDK 7.1.0. +- `bugsee-cli` 0.9.0. + +## Earlier releases + +The 6.x release history is in the [6.x release notes](/sdk/unity/v6/release-notes). diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx index cd13d7ab..c8ecf656 100644 --- a/docs/sdk/unity/report-handler.mdx +++ b/docs/sdk/unity/report-handler.mdx @@ -1,6 +1,6 @@ --- title: "Report handler" -description: "TODO(writer-B): Report handler for the Bugsee Unity SDK 7.x." +description: "Inspect and change every Bugsee report before it is uploaded from a Unity game: the IReportHandler callbacks, threading and timeouts per platform, attachments and screenshots." sidebar_position: 6 slug: "/sdk/unity/report-handler" --- @@ -9,4 +9,190 @@ slug: "/sdk/unity/report-handler" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-B) +A **report handler** is the one place to inspect or rewrite a report before Bugsee uploads it. It runs for the reports the SDK is about to upload, except those it files while the process is exiting (see below). Use it to tag reports with your build, raise the severity of a subset, attach a file, or remove text a player typed into the form. + +The handler wraps the report handler of the native SDK. See the native pages for the parts that are not Unity specific: [Android report handler](/sdk/android/report-handler) and [iOS report handler](/sdk/ios/report-handler). + +## Register a handler + +Implement `IReportHandler`, or derive from `ReportHandlerBase`, which implements both callbacks as "continue unchanged". Register one handler for the whole app with `Bugsee.SetReportHandler`: + +```csharp +using System; +using Bugsee.Contracts.Reporting; +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +sealed class MyReportHandler : ReportHandlerBase +{ + public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) + { + report.AddLabel(Debug.isDebugBuild ? "debug" : "release"); + report.SetAttribute("app_version", Application.version); + completionCallback(); + } +} + +// At startup: +BugseeSdk.SetReportHandler(new MyReportHandler()); +``` + +- A new handler replaces the previous one. `SetReportHandler(null)` removes it. +- Register the handler before you call `Bugsee.Launch`. The native iOS SDK files the crash of the previous run while it launches, and a handler registered later does not see that report. +- In the Unity Editor there is no report handler, so nothing calls yours. + +`IReportHandler` has two methods, and both have the signature `(IReport report, bool isTerminating, Action completionCallback)`: + +| Callback | When it runs | +| --- | --- | +| `OnBeforeReportCreated` | First, before the report is assembled. For a report from the dialog, before the dialog opens on iOS. | +| `OnAfterReportCreated` | Later in the pipeline, before upload. For a dialog report on iOS, after the player sends it. | + +The exact order differs a little between platforms: see the native pages above. Use the "before" callback to change summary, description, severity, labels and attributes. Use the "after" callback to add attachments. + +## Complete the callback + +The pipeline waits for you. **Call `completionCallback` exactly once** when you are done, also on the paths where you change nothing. If you override a method of `ReportHandlerBase` and do not call the base method, call `completionCallback` yourself. + +- The wrapper honors the first call and ignores later ones. +- Call `completionCallback` from Unity's main thread. If you do work on another thread, return to the main thread before you call it. +- Changes you make after the callback has completed are ignored. On Android the report object stops accepting edits. + +### Threading + +Both callbacks run on Unity's main thread, on Android and on iOS. On Android the SDK calls the handler on its own thread, and the wrapper hands the call to the main thread. Keep the callbacks short. Slow work (file reads, compression, network calls) belongs on your own thread, with the completion called when it is done. + +While the game is in the background, Unity's main loop is paused. On Android a handler then waits until the loop resumes, and can miss its deadline: see below. + +### Reports that are not handled + +When `isTerminating` would be `true`, which means the process is about to exit, the wrapper does not call your handler. It completes the report unchanged at once. `isTerminating` is therefore always `false` in your callbacks. + +### Timeouts + +The native SDK carries on with the report unchanged when a handler is too slow. The wrapper follows the same clock, which starts when the SDK calls it. + +| | Android | iOS | +| --- | --- | --- | +| Time allowed per callback | `ReportHandlerCallbackTimeout` seconds, default 30. | 30 seconds. The option is not read. | +| Value `0` | Disables the per-handler timer. The SDK still ends the chain after 60 seconds. | Not applicable. | +| A callback that cannot start in time | A "before" callback is skipped, with a warning in the Unity log. An "after" callback still runs, with a completion that only acknowledges. | The callback is skipped. | +| A reply after the deadline | Acknowledged without applying your edits. | Acknowledged without applying your edits. | +| A handler that never completes | Abandoned one second after the deadline, with a warning. The report continues unchanged. | The same. | + +All callbacks for one report share an overall budget of 60 seconds on iOS. + +`ReportHandlerCallbackTimeout` is an Android option. Set it in the launch options: + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +var options = new AndroidLaunchOptions { ReportHandlerCallbackTimeout = 10 }; +BugseeSdk.Launch("", options); +``` + +### If your handler throws + +An exception thrown from a callback is logged with `Debug.LogException`, and the report continues. On Android, the edits you made before the exception stay. On iOS, edits other than screenshots travel in the callback's result and are dropped. + +## What you can change + +`IReport` is the report about to be uploaded: + +| Area | Members | +| --- | --- | +| Identity | `Id`, `Type` (`Bug`, `Crash` or `Error`) | +| Text | `Summary`, `Description`, `Email` (get and set) | +| Severity | `Severity` (`IssueSeverity?`, get and set) | +| Labels | `Labels`, `AddLabel`, `SetLabels`, `ClearLabels` | +| Attributes | `Attributes`, `GetAttribute`, `SetAttribute`, `RemoveAttribute`, `ClearAllAttributes` | +| Attachments | `Attachments`, `AddAttachmentFile`, `AddAttachmentBytes`, `ClearAttachments` | +| Screenshots | `ScreenshotDisplayIds`, `GetScreenshotPng`, `SetScreenshotPng`, `IsScreenshotChanged` | + +Attributes you set here apply to this report only. For values that belong on every report, see [User & session data](/sdk/unity/user-session-data). Use `report.Type` to limit a change to one kind of report: + +```csharp +using System; +using Bugsee.Contracts.Options; +using Bugsee.Contracts.Reporting; + +public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) +{ + if (report.Type == IssueType.Error && report.Severity == null) + report.Severity = IssueSeverity.Medium; + + // Remove text a player typed into the form. + if (report.Description != null) + report.Description = System.Text.RegularExpressions.Regex.Replace(report.Description, @"\d{16}", "[CARD]"); + + completionCallback(); +} +``` + +`Severity` is `null` when it is unset. `Email` on a report from `CreateReport` is only used on Android: see [Bug reporting](/sdk/unity/manual/bug-reporting#build-a-report-in-code). + +## Attachments + +Add attachments from `OnAfterReportCreated`: + +```csharp +using System; +using System.Text; +using Bugsee.Contracts.Reporting; + +public override void OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback) +{ + var settings = Encoding.UTF8.GetBytes("{\"quality\":\"high\"}"); + report.AddAttachmentBytes(settings, "settings.json", "application/json"); + + // An existing file: + // report.AddAttachmentFile(path, "save-slot-2", "application/octet-stream"); + + completionCallback(); +} +``` + +- `AddAttachmentBytes(data, name, mimeType)` returns `null` when `data` is `null`. +- `AddAttachmentFile(path, name, mimeType)` returns `null` when `path` is empty. On iOS it also returns `null` when the file does not exist or cannot be copied: there the wrapper copies the file into the app's private cache when you call it, and deletes the copy after the report is handled. +- The `IAttachment` you get back has `Name`, `Filename` and `MimeType` properties and `SetData(byte[])` and `SetData(string)` methods. +- The size and count limits are those of the native SDKs and differ per platform: Android holds at most 1000 attachments per report, and iOS accepts up to three attachments of at most 3 MB each per source. See [Android report handler](/sdk/android/report-handler#attachments) and [iOS report handler](/sdk/ios/report-handler#attachments). Keep attachments small: they travel with the report on the player's connection. +- An attachment cannot remove, replace or redact the screenshot of the report. + +## Screenshots + +In a handler, you can list, read, replace and remove the per-display screenshots of the report as PNG bytes: + +```csharp +using System; +using Bugsee.Contracts.Reporting; + +public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) +{ + foreach (int display in report.ScreenshotDisplayIds) // usually 0 + { + byte[] png = report.GetScreenshotPng(display); + // report.SetScreenshotPng(display, redactedPng); // replace + // report.SetScreenshotPng(display, null); // remove + } + completionCallback(); +} +``` + +- It works in both callbacks, on Android and on iOS, on the report a handler receives. A report from `Bugsee.CreateReport` holds no screenshots. +- Call these members on Unity's main thread, inside the callback. After the callback has completed, the getters return nothing and `SetScreenshotPng` returns `false`, with a one-time warning. +- `GetScreenshotPng` blocks the main thread while the SDK produces the PNG, and has no timeout of its own. +- `GetScreenshotPng` returns `null` in two cases: the display is not in `ScreenshotDisplayIds`, or it is listed and its screenshot cannot be read (over 32 MiB as PNG, or the platform cannot encode it). In the second case a warning says so. A `null` for a listed display does not mean there is nothing to redact: replace or remove it. +- `SetScreenshotPng(display, png)` returns `true` when the report took the change. It returns `false`, with a warning, for data that is not a PNG, a PNG over 32 MiB, a PNG with a side over 8192 pixels or more than 33,554,432 pixels in total, or a PNG the platform cannot decode. `null` removes the screenshot. +- `IsScreenshotChanged` becomes `true` once a screenshot the report held is replaced or removed. Adding a screenshot to a display that held none does not set it. +- On iOS a screenshot edit reaches the native report at once, so it stays even if the handler later throws or answers after the deadline. + +:::warning[Screenshots can contain personal data] +A screenshot is the screen as captured. It can show personal data and content you marked secure. A screenshot you set replaces the captured one, and nothing redacts it for you. Do not log the bytes or send them anywhere the report does not go. To send no screenshot at all, set the launch option `CaptureScreenshot` to `false`. See [Privacy: Report](/sdk/unity/privacy/report). +::: + +## Related pages + +- [Bug reporting](/sdk/unity/manual/bug-reporting): the reports a handler receives. +- [Crash & error reporting](/sdk/unity/manual/crash-error-reporting): severity defaults for crashes and errors. +- [Privacy: Report](/sdk/unity/privacy/report): what a report contains and how to limit it. diff --git a/docs/sdk/unity/symbolication/android.mdx b/docs/sdk/unity/symbolication/android.mdx index af059d00..0240184b 100644 --- a/docs/sdk/unity/symbolication/android.mdx +++ b/docs/sdk/unity/symbolication/android.mdx @@ -1,6 +1,6 @@ --- title: "Symbolication: Android" -description: "TODO(writer-E): Symbolication: Android for the Bugsee Unity SDK 7.x." +description: "Set up native, IL2CPP, Mono and R8 symbol uploads for a Unity Android build with the Bugsee Unity SDK 7.x, and choose between Public and Debugging symbols." sidebar_position: 2 slug: "/sdk/unity/symbolication/android" --- @@ -9,4 +9,109 @@ slug: "/sdk/unity/symbolication/android" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-E) +After an Android build, the Bugsee package uploads the debug files of that build from the Unity Editor. This page lists what it uploads, how to choose the native symbol level, and how to upload by hand from CI or an exported project. For the overview and the build token, see [Symbolication overview](/sdk/unity/symbolication/overview). + +## What the Editor uploads + +When `BUGSEE_APP_TOKEN` is set in the Editor's environment and `BUGSEE_NO_SYMBOL_UPLOAD` is not, the package runs `bugsee-cli` after an APK or AAB build: + +| Step | What is uploaded | Type | +| --- | --- | --- | +| Native symbols | Unity's `symbols.zip`, with the unwind data added (see [Unwind data](#unwind-data-for-the-android-11-minidump-path)). Without a zip, the folders that hold `libil2cpp.so`. | `elf` | +| Plugin libraries | The `.so` files of your own `Assets/Plugins/Android` folders and of merged AARs that still carry a symbol table or debug info and are not already in Unity's zip | `elf` | +| R8 mapping | The `mapping.txt` of the build, when Minify is on and Gradle wrote one | `proguard` | +| IL2CPP line map | `LineNumberMappings.json` with `MethodMap.tsv`, for an IL2CPP build | `il2cpp-linemap` | +| C# mapping | Managed-code mapping, for a Mono Release build | `portable-pdb` | + +The last two are covered in [Symbolication: C# code](/sdk/unity/symbolication/managed-code). A library that carries only dynamic symbols is not uploaded. That includes the Bugsee SDK's own native libraries and most third-party AARs, so a frame inside such a library stays a module name and an offset. + +The upload never fails the build. A missing token, a missing CLI or a failed upload logs a warning and the build continues. + +## Public and Debugging symbols + +Unity's **Create symbols.zip** setting decides what the native symbols file holds. Unity 6 names the levels **None**, **SymbolTable** and **Full**, and has a separate format that must include **Zip**. Earlier Unity versions name them **Disabled**, **Public** and **Debugging**. This page uses Public for SymbolTable and Debugging for Full. + +| Level | What the zip holds | What a crash or exception frame resolves to | +| --- | --- | --- | +| Disabled (None) | No zip | No native symbols to upload | +| Public (SymbolTable) | Symbol tables only | Function names, no file and line | +| Debugging (Full) | Symbol tables and DWARF line information | Function names, files and lines | + +C# file and line from an IL2CPP build needs the **Debugging** level and the IL2CPP line map. With Public symbols, a Release IL2CPP build gets function names but no C# file and line for handled exceptions. + +When a token is set and the level is Public or Disabled (or Debugging without the Zip format), the build prints a warning that names the consequence. To change the level, either set Create symbols.zip to Debugging in Player Settings, or use the Bugsee opt-in below. + +### Use Debugging symbols for the upload only + +The opt-in builds with the Debugging level and a symbols zip for one build, then puts your Player Settings back: + +- In the Unity menu, choose **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload**. The item is a toggle. +- In CI, set `BUGSEE_ANDROID_FULL_SYMBOLS=1` in the Editor's environment. + +The opt-in does not change anything when the level is already Debugging with the Zip format. If you change the level yourself while the opt-in is on, the package keeps your setting and forgets its own saved state. + +The Debugging symbols file is larger than the Public one. The build warning mentions Google Play's size limits for the symbols file, so check yours before you ship with Debugging. + +### Known issues + +- Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public. Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. +- Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). Choose the symbol level before the first upload of a build, or change the code so the build id changes. + +The server skips a symbol it already has for a build id, and the CLI replaces a symbol table with debug information for the same build id only from CLI 0.8.1. See [Uploading debug information files](/cli/debug-files#native-elf). The package never passes `--force`. + +## Unwind data for the Android 11 minidump path + +On Android 11 and older, native crashes are reported through a minidump, which needs unwind tables to walk the stack. Unity's `symbols.zip` keeps the symbol table and the build id of `libunity.so`, `libil2cpp.so` and `libmain.so`, but not their unwind sections. + +Before the upload, the Editor opens the built APK or AAB and copies the `.eh_frame` and `.eh_frame_hdr` sections of each library from the copy in the app into a temporary copy of the zip. The copy is accepted only when the ABI, the file name, the build id and the section address and size match. The upload then carries names and unwind data in one file, and the temporary copy is deleted afterwards. When the unwind data cannot be added, the Editor uploads Unity's zip as written. + +Limits: + +- It needs an APK or AAB. An Export Project has none, so no unwind data is added. +- It applies to the Editor's upload. The Bugsee Gradle plugin's own native symbol upload in an exported project sends the Android Gradle plugin's `native-debug-symbols.zip` as it is. + +## The Gradle plugin and your Unity version + +The package patches the generated Gradle project; you do not add a Gradle template. + +| Unity and Android Gradle plugin (AGP) | What the package does | +| --- | --- | +| Unity 6 with AGP 8.6 or newer | Applies the Bugsee Gradle plugin 4.1.1 with `ndk { enabled = true }`. | +| AGP below 8.6, for example Unity 2021.3 and 2022.3 | Does not apply the plugin, which needs AGP 8.6 or newer. On AGP 7.4.x and 8.0 to 8.5 it adds a small build-id block to the launcher instead. | + +In a build the Editor runs itself, the Gradle plugin finds no app token (the app gets its token from `Bugsee.Launch`), so its own uploads skip. The Editor's uploads in the table above do the work for every Unity version. See [Android build setup](/sdk/unity/build-setup/android) for the Player Settings checklist and the Gradle file layouts the patching understands. + +Both paths key the R8 mapping by the build id the built app reports. The Editor reads it from the APK or AAB (`assets/bugsee_build_id.properties`). When the app carries none, the SDK derives its own id from the app token, the version name and the version code, and the Editor uses that id with a warning. + +## Export Project + +Unity does not run Gradle for an Export Project, so the Editor has no APK, AAB, `mapping.txt` or merged native libraries to upload. Build the exported project with Gradle: + +- With AGP 8.6 or newer, the exported project carries the Bugsee Gradle plugin. It uploads the R8 mapping and the native symbols when `BUGSEE_APP_TOKEN` is set in the environment of that Gradle build. The package writes no token into the project. `BUGSEE_ENDPOINT`, `BUGSEE_CLI_PATH` and `BUGSEE_NO_SYMBOL_UPLOAD` are read from the same environment. +- With an older AGP, or when the launcher already has a `bugsee { }` block of its own, upload by hand after the Gradle build. The build log says which case applies. + +The Editor logs a warning for a Minify build that has no mapping to upload, and names the command below. + +## Upload by hand + +Use these commands from CI or after an Export Project. Set `BUGSEE_APP_TOKEN` first, and pass the version name and version code of the build. The [CLI page](/cli/debug-files) has every option. + +```bash +export BUGSEE_APP_TOKEN="your-app-token" + +# R8 mapping +bugsee-cli debug-files upload --type proguard \ + --version --build + +# Native symbols (the --uuid is required for elf) +bugsee-cli debug-files upload --type elf \ + --version --build --uuid +``` + +For an app built with the Gradle plugin, the build id is in `assets/bugsee_build_id.properties` (`bugsee.build_id`) inside the APK. Pass the same id to the mapping upload with `--uuid` so it matches the app. For an exported project, the plugin's own upload covers both files when it has a token. + +To upload the IL2CPP line map from a later job, keep the folder `_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/Symbols/`. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#upload-the-il2cpp-line-map-from-ci). + +## Mono + +IL2CPP is the supported scripting backend for fully symbolicated native crashes. With Mono, native frames inside the Mono runtime (`libmonobdwgc-2.0.so`, `libmono-native.so`, `libMonoPosixHelper.so`) cannot be symbolicated: Unity 2021.3 has no Mono ARM64 build, and those libraries have no GNU build id. Frames in `libunity.so` and `libmain.so` still resolve. A Mono Android build prints a one-time warning at build time and is never failed. For C# frames on Mono, see [Symbolication: C# code](/sdk/unity/symbolication/managed-code#mono-on-android-release-builds). diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index 0335cebe..196ccfa7 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -1,6 +1,6 @@ --- title: "Build environment variables" -description: "TODO(writer-E): Build environment variables for the Bugsee Unity SDK 7.x." +description: "Every environment variable and Unity Editor setting the Bugsee Unity SDK 7.x package reads at build time, with its default, platform and effect." sidebar_position: 5 slug: "/sdk/unity/symbolication/environment-variables" --- @@ -9,4 +9,84 @@ slug: "/sdk/unity/symbolication/environment-variables" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-E) +The package reads these variables in the Unity Editor and in the Xcode Run Script, not in the player. The Runtime code reads none of them. Set them in the environment of the process that does the work: the Unity Editor or its batch-mode command line for the Editor variables, and Xcode or `xcodebuild` for the iOS Run Script variables. + +A "flag" below means the variable counts as set when it exists in the environment with any value. Unless a row says otherwise, you do not need to set a value. + +A Unity Editor started from the Hub or the Finder does not inherit your shell's environment. Start it from a terminal that has the variables, or set them in your CI job. + +## Symbol upload + +| Variable | Platform | Default | What it does | +| --- | --- | --- | --- | +| `BUGSEE_APP_TOKEN` | Android, iOS | Unset | Turns the symbol upload on. The Editor uses it after an Android build. The iOS Run Script reads it from the Xcode environment. In an Export Project, the Gradle plugin reads it from the Gradle build's environment. | +| `BUGSEE_NO_SYMBOL_UPLOAD` | Android, iOS | Unset | Flag. Turns every symbol upload off, including the Run Script's and the Gradle plugin's in an exported project, even with a token. | +| `BUGSEE_ENDPOINT` | Android, iOS | The CLI's own default, `https://api.bugsee.com` | The Bugsee API endpoint that `bugsee-cli` uploads to. The Editor passes it to the CLI. The Gradle plugin of an exported project reads it too. | +| `BUGSEE_VERSION` | Android, iOS | Player Settings **Version** (`0.0.0` if empty) on Android; the built app's `Info.plist` on iOS | The app version the upload carries. On iOS, the Run Script reads it from the Xcode environment. | +| `BUGSEE_BUILD` | Android, iOS | The Android version code; the iOS build number, else a UTC timestamp (`yyyyMMddHHmmss`) from the Editor; the built app's `Info.plist` for the Run Script | The build number the upload carries. On iOS, the Run Script reads it from the Xcode environment. | +| `BUGSEE_BUILD_UUID` | Android | Unset | The build id of the app. For the R8 mapping it is used only when the built app has no `bugsee_build_id.properties` and the value is a UUID. Any non-empty value keys the native symbols upload. It never overrides the id the app carries. | +| `BUGSEE_NO_TOKEN_CHECK` | Android, iOS | Unset | Flag. Records no token fingerprint in the build, so `Bugsee.Launch` never warns about a different token. On iOS, set it in the Xcode environment. See [the build token and the launch token](/sdk/unity/symbolication/overview#the-build-token-and-the-launch-token). | + +## Bugsee CLI + +| Variable | Platform | Default | What it does | +| --- | --- | --- | --- | +| `BUGSEE_CLI_PATH` | Android, iOS | Unset | The `bugsee-cli` binary to use, as a path or a command name on `PATH`. The Editor, the iOS Run Script and the Gradle plugin of an exported project all read it. The Editor warns when the CLI it names is older than 0.8.1. | +| `BUGSEE_CLI_VERSION` | Android, iOS | `0.9.0` | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first. | +| `BUGSEE_NO_CLI_DOWNLOAD` | Android | Unset | Flag. The Editor does not download a CLI. Without a token the Editor never downloads. | +| `BUGSEE_CLI_BASE_URL` | Android | `https://download.bugsee.com/cli` | A mirror to download the CLI from. HTTPS only. | + +## IL2CPP line map and iOS dSYMs + +| Variable | Platform | Default | What it does | +| --- | --- | --- | --- | +| `BUGSEE_NO_IL2CPP_MAPPING` | Android, iOS | Unset | Flag. Turns off the IL2CPP line map flags and the line map upload. The iOS Run Script reads it too, and still uploads the dSYMs. | +| `BUGSEE_IL2CPP_MAPPING` | Android, iOS | Unset | Path to a `LineNumberMappings.json` of your own to upload instead of the build's. A missing file gives a warning and no upload. | +| `BUGSEE_IL2CPP_UUIDS` | Android, iOS | Read from the build | The IL2CPP module UUIDs, comma separated, for the line map upload. The iOS Run Script reads it from the Xcode environment. | +| `BUGSEE_SKIP_UPLOAD_ON_DEBUG` | iOS | Unset | Set to `1` in the Xcode environment to skip the upload for the Debug configuration. | +| `BUGSEE_NO_DSYM_FORCE` | iOS | Unset | Flag. The export keeps Unity's `DEBUG_INFORMATION_FORMAT` and does not force `dwarf-with-dsym`. The Debug configuration then has no dSYM. | + +## Android Gradle setup + +| Variable | Platform | Default | What it does | +| --- | --- | --- | --- | +| `BUGSEE_ANDROID_FULL_SYMBOLS` | Android | Unset | Set to exactly `1` to build with the Debugging symbol level and a symbols zip, then restore your Player Settings. The same as the **Use Full Native Symbols** menu item. See [Public and Debugging symbols](/sdk/unity/symbolication/android#public-and-debugging-symbols). | +| `BUGSEE_NO_GRADLE_BUILD_ID` | Android | Unset | Flag. The package does not add its build-id block to the launcher's Gradle file (and removes one an earlier build added). The SDK then derives its own build id. | +| `BUGSEE_NO_GRADLE_REPO_INJECTION` | Android | Unset | Flag. The package does not add Maven Central to the project's plugin or buildscript repositories. If the Bugsee Gradle plugin then cannot resolve from your repositories, it is not applied and the build warns. | + +## Feedback and iOS add-ons + +| Variable | Platform | Default | What it does | +| --- | --- | --- | --- | +| `BUGSEE_FEEDBACK` | Android, iOS | Unset | Set to `1` or `true` in the Editor process that exports the build to link the Feedback add-on. Adding the scripting define `BUGSEE_FEEDBACK` in Player Settings does the same. See [Feedback](/sdk/unity/feedback). | +| `BUGSEE_IOS_CRASH_EXTENSION` | iOS | Auto | `auto`, `1` (also `on`, `true`, `yes`, `enable`, `enabled`) or `0` (also `off`, `false`, `no`, `disable`, `disabled`). Any other value means auto. Overrides the **Bugsee > iOS > Crash Report Extension** menu. See [Crash report extension](/sdk/unity/issue-detection/crash-report-extension). | +| `BUGSEE_IOS_APP_GROUP` | iOS | `group.` | The App Group id of the Crash Report Extension. It wins over `BugseeIosCrashExtensionPostProcess.AppGroupOverride` set in a build script. | +| `BUGSEE_IOS_EARLY_LAUNCH` | iOS | Off | `1` (also `on`, `true`, `yes`) turns native early launch on. Any other value is off. Overrides the Early Launch window. See [Issue detection](/sdk/unity/issue-detection/overview). | +| `BUGSEE_IOS_APP_TOKEN` | iOS | Unset | The iOS app token that early launch writes into the app's `Info.plist`. Overrides the Early Launch window. | +| `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS` | iOS | Unset | A JSON object of launch options, with the same keys as the C# options, for the early session. Overrides the Early Launch window. | + +## Other variables the package reads + +| Variable | What the package does with it | +| --- | --- | +| `PATH` | Looks for `bugsee-cli` in the Editor's `PATH`. | +| `LOCALAPPDATA` | On Windows, finds the CLI install directory and the download cache. | +| `XDG_CACHE_HOME` | On Linux, the CLI download cache is `$XDG_CACHE_HOME/bugsee/cli`, else `~/.cache/bugsee/cli`. | +| `IL2CPP_ADDITIONAL_ARGS` | The Editor sets it for the build (adding the line map flags to any value it already has) and restores the earlier value afterwards. | + +## Editor settings + +These are stored with Unity's `EditorPrefs` on your machine. A variable above overrides the matching setting, where one exists. + +| Menu item | Platform | Default | What it does | +| --- | --- | --- | --- | +| **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload** | Android | Off | Builds with the Debugging level and a symbols zip, then restores your setting. A toggle. Preference `Bugsee.Android.FullNativeSymbols`. | +| **Bugsee > Android > Force Gradle Plugin On Older AGP (unsupported)** | Android | Off | Applies the Bugsee Gradle plugin on an AGP older than 8.6. Plugin 4.x needs AGP 8.6 or newer, so this will likely fail Gradle configuration. A toggle. Preference `Bugsee.Android.ForceGradlePlugin`. | +| **Bugsee > Android > Remove Legacy Gradle Templates** | Android | none | Checks `Assets/Plugins/Android` for Gradle templates that earlier package versions wrote. An action, not a setting. | +| **Bugsee > iOS > Keep Xcode Debug Info Format (skip dSYM force)** | iOS | Off | The same as `BUGSEE_NO_DSYM_FORCE`. A toggle, applied at the next iOS export. Preference `Bugsee.Ios.NoDsymForce`. | +| **Bugsee > iOS > Crash Report Extension > Auto, On, Off** | iOS | Auto | Whether the export adds the Crash Report Extension target. Preference `Bugsee.Ios.CrashExtension`. | +| **Bugsee > iOS > Early Launch...** | iOS | Off | A window with the early launch switch, the iOS app token and the launch options JSON. Preferences `Bugsee.Ios.EarlyLaunch`, `Bugsee.Ios.EarlyLaunch.Token` and `Bugsee.Ios.EarlyLaunch.Options`. | + +## Scripting defines set by the package + +The package's runtime assembly defines `BUGSEE_HAS_SCREENCAPTURE` (when Unity's screen capture module is present) and `BUGSEE_UNITY_CAPTURE` (on Unity 2022.2 or newer). Do not define them yourself. They are not environment variables. `BUGSEE_FEEDBACK` is both a scripting define and an environment variable, as listed above. diff --git a/docs/sdk/unity/symbolication/ios.mdx b/docs/sdk/unity/symbolication/ios.mdx index aced9a0c..69df251c 100644 --- a/docs/sdk/unity/symbolication/ios.mdx +++ b/docs/sdk/unity/symbolication/ios.mdx @@ -1,6 +1,6 @@ --- title: "Symbolication: iOS" -description: "TODO(writer-E): Symbolication: iOS for the Bugsee Unity SDK 7.x." +description: "Upload dSYMs and the IL2CPP line map for a Unity iOS build with the Run Script phase the Bugsee Unity SDK 7.x adds to the exported Xcode project." sidebar_position: 3 slug: "/sdk/unity/symbolication/ios" --- @@ -9,4 +9,112 @@ slug: "/sdk/unity/symbolication/ios" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-E) +On iOS the debug files exist only after Xcode builds the app, so the upload runs inside Xcode, not in the Unity Editor. The Unity export adds a Run Script phase to the Xcode project. When you build or archive in Xcode, the phase uploads the dSYMs and the IL2CPP line map of that build. For the overview and the build token, see [Symbolication overview](/sdk/unity/symbolication/overview). + +## What the export adds + +Every iOS export from Unity: + +- Writes `BugseeScripts/upload-symbols.sh` into the Xcode project folder. +- Adds a Run Script phase named `Bugsee Upload Symbols` to the `Unity-iPhone` target, last in the target's build phases. It runs the script through `/bin/sh`. +- Sets `ENABLE_USER_SCRIPT_SANDBOXING = NO` on the `Unity-iPhone` target. With the sandbox on, Xcode refuses to start the script ("Operation not permitted") and nothing is uploaded. +- Sets `DEBUG_INFORMATION_FORMAT = dwarf-with-dsym` on every configuration of `Unity-iPhone` and `UnityFramework`, so a Debug build has a dSYM too. + +An Append export refreshes the script and the phase an earlier package version added, so re-export with the current package after you update it. + +The script never fails your build. It reports each problem as a `warning:` line in the Xcode build log and always exits 0. It also rewrites the text `error:` in the CLI's own output to `error -`, because Xcode fails an archive whose log has an `error:` line, even when the script exits 0. + +## Give Xcode the token + +Set `BUGSEE_APP_TOKEN` where Xcode runs the build. The export never writes the token into the project. A build started from the Xcode GUI does not see your shell's environment, so use one of these: + +- **The environment (preferred).** In CI or Xcode Cloud, set it in the job. Locally, run `export BUGSEE_APP_TOKEN=...` before `xcodebuild`, or `launchctl setenv BUGSEE_APP_TOKEN ...` and restart Xcode. A plain environment variable is not printed into the build log. +- **A user-defined build setting** named `BUGSEE_APP_TOKEN` on the `Unity-iPhone` target. Xcode exports build settings to Run Script phases as environment variables. The value is stored in the Xcode project, so do not commit the project after you add it. A Unity export in Replace mode regenerates `project.pbxproj`, so add the setting again after each export. Xcode prints build settings into the build log, so such a log holds the token. + +Without a token, an archive prints `warning: Bugsee: BUGSEE_APP_TOKEN unset` and uploads nothing. A build that is not an archive prints `note:` instead. + +## What the script uploads + +| Upload | What | `bugsee-cli` type | +| --- | --- | --- | +| dSYMs | Every dSYM in the build's `DWARF_DSYM_FOLDER_PATH`: the app's, `UnityFramework`'s, and the dSYMs of embedded xcframeworks such as `Bugsee.framework.dSYM` | `dsym` | +| IL2CPP line map | `LineNumberMappings.json` of this export, with `MethodMap.tsv` and `il2cppFileRoot.txt` beside it when they are current, keyed by the Mach-O UUID of `UnityFramework` | `il2cpp-linemap` | + +The script uploads for every Xcode configuration, Debug included, so a crash from a development build is symbolicated. It runs on every build that has the token in its environment, not only on archives. + +If a configuration has no dSYM, the script prints `warning: Bugsee: no dSYM for ` and names `DEBUG_INFORMATION_FORMAT = dwarf-with-dsym` as the fix. The `dsymutil` step adds time to each Debug build. To keep Unity's own setting, choose **Bugsee > iOS > Keep Xcode Debug Info Format (skip dSYM force)** in the Unity menu, or set `BUGSEE_NO_DSYM_FORCE` in the Editor's environment for the export. A Debug build then has no dSYM to upload. + +The line map file comes from the IL2CPP arguments the package adds to every IL2CPP build (`--emit-source-mapping --emit-method-map`), with or without a token. Nothing to enable in Player Settings. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code). + +### Version and build number + +The script passes `--version` and `--build` from, in order: + +1. `BUGSEE_VERSION` and `BUGSEE_BUILD`. +2. The built app's `Info.plist` (`CFBundleShortVersionString` and `CFBundleVersion`), which is what the SDK reports. +3. The `MARKETING_VERSION` and `CURRENT_PROJECT_VERSION` build settings. + +A flag with no value is left out, and the script says so. + +## Turn parts of it off + +| Variable | Effect on the Run Script | +| --- | --- | +| `BUGSEE_SKIP_UPLOAD_ON_DEBUG=1` | Skips the upload for the Debug configuration, for example for local Xcode runs. | +| `BUGSEE_NO_SYMBOL_UPLOAD` (any value) | Uploads nothing, even with a token. Read when Xcode runs the script. | +| `BUGSEE_NO_IL2CPP_MAPPING` (any value) | Skips the line map and still uploads the dSYMs. | +| `BUGSEE_IL2CPP_UUIDS` | Uses this module UUID for the line map instead of reading it from `UnityFramework`. | + +Set these in the Xcode environment, not only in the Unity Editor: the script reads them when Xcode runs it. + +## How the Run Script finds bugsee-cli + +Xcode runs build phases with a minimal `PATH`, so the script cannot use the Editor's lookup. It never downloads a CLI. It uses the first of these: + +1. `BUGSEE_CLI_PATH`, as given. +2. The CLI the Unity Editor found when it exported the project, baked into the script as an absolute path. This happens only on a macOS Editor, with `BUGSEE_APP_TOKEN` set and `BUGSEE_NO_SYMBOL_UPLOAD` unset. +3. A CLI that runs, prints a version, and is 0.8.0 or newer, from the build phase's `PATH`; then `/opt/homebrew/bin`, `/usr/local/bin`, `~/.local/bin`, `~/.cargo/bin` and `~/.bugsee/bin`; then the package's cache (`~/Library/Caches/Bugsee/cli`, `$XDG_CACHE_HOME/bugsee/cli` or `~/.cache/bugsee/cli`). + +If none qualifies, the script prints `warning: Bugsee: bugsee-cli was not found`, names every path it tried and why it passed each over, uploads nothing, and the build continues. Install the CLI with `curl --proto '=https' --tlsv1.2 -sSfL https://download.bugsee.com/cli/install.sh | sh`, or see [Installation](/cli/installation). + +The baked path contains the exporting user's home directory. If you commit the exported Xcode project, unset `BUGSEE_APP_TOKEN` or set `BUGSEE_NO_SYMBOL_UPLOAD` before you export, and nothing is baked. + +## When an upload fails + +A failed upload prints one line and the build continues: + +```text +warning: Bugsee: symbol upload failed (exit 31): the Bugsee server could not be reached (network). Not uploaded: (the build continues). +``` + +| Exit code | Meaning | +| --- | --- | +| 1 | `bugsee-cli` hit an unexpected error | +| 2 | `bugsee-cli` rejected its arguments (a CLI older or newer than the package expects) | +| 10 | The file to upload was not found | +| 11 | The file is not a usable symbol file | +| 20 | `bugsee-cli` found its configuration invalid | +| 21 | The server rejected the app token: check `BUGSEE_APP_TOKEN` | +| 30 | The Bugsee server returned an error | +| 31 | The Bugsee server could not be reached | +| 50 | The CLI failed after it sent the request, so the upload may have been applied: check the dashboard and do not re-run blindly | +| 126, 127 | `bugsee-cli` could not be run | + +After any failure the script ends with `warning: Bugsee: some symbols were NOT uploaded; crashes from this build may stay unsymbolicated`. The same codes are in the [CLI exit codes](/cli/exit-codes). + +## Upload by hand + +Upload a dSYM you kept, or the files of a build that had no token, with the CLI: + +```bash +export BUGSEE_APP_TOKEN="your-app-token" + +bugsee-cli debug-files upload "$ARCHIVE/dSYMs" --type dsym \ + --version --build +``` + +For the line map, see [Upload the IL2CPP line map from CI](/sdk/unity/symbolication/managed-code#upload-the-il2cpp-line-map-from-ci). The native iOS SDK has the same instructions for dSYMs: [iOS symbolication](/sdk/ios/symbolication#manual-dsym-upload). + +## Script Debugging and dSYMs + +IL2CPP stack trace information and **Script Debugging** control how much file and line the managed stack text carries. The line map and the dSYM do a different job: the dSYM resolves a native address to C++ file and line, and the line map turns that into C# file and line. For C# file and line from a native crash, upload both. The Run Script does both when it has a token. diff --git a/docs/sdk/unity/symbolication/managed-code.mdx b/docs/sdk/unity/symbolication/managed-code.mdx index 119acb70..035a0f90 100644 --- a/docs/sdk/unity/symbolication/managed-code.mdx +++ b/docs/sdk/unity/symbolication/managed-code.mdx @@ -1,6 +1,6 @@ --- title: "Symbolication: C# code" -description: "TODO(writer-E): Symbolication: C# code for the Bugsee Unity SDK 7.x." +description: "Get C# method names, files and lines in crash and exception reports from Unity IL2CPP and Mono builds with the Bugsee Unity SDK 7.x." sidebar_position: 4 slug: "/sdk/unity/symbolication/managed-code" --- @@ -9,4 +9,106 @@ slug: "/sdk/unity/symbolication/managed-code" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-E) +A C# method in a Release player does not show up with its file and line by itself. What you get depends on the scripting backend and on what you upload. This page covers the C# frames of crashes and of exceptions you report with `Bugsee.LogException`. For native frames, see [Symbolication: Android](/sdk/unity/symbolication/android) and [Symbolication: iOS](/sdk/unity/symbolication/ios). + +## What each build gives you + +| Build | The app sends | What resolves the C# file and line | +| --- | --- | --- | +| Mono on Android, Development Build | A stack text with file and line, because the player ships the `.pdb` files | The text itself | +| Mono on Android, Release | A method, an IL offset and a module id, for example `[0x0000b] in :0` | The mapping the Editor uploads from your portable `.pdb` files. See [Mono on Android Release builds](#mono-on-android-release-builds). | +| IL2CPP with IL2CPP line information (**Method Name, File Name, and Line Number**) | A stack text with file and line where Unity provides it | The text itself | +| IL2CPP Release without line information | Native addresses and the module UUID | The IL2CPP line map plus native symbols with line information: Debugging on Android, a dSYM on iOS. See [The IL2CPP line map](#the-il2cpp-line-map). | + +A managed plug-in `.dll` without a `.pdb` stays at IL offsets on Mono. + +## The IL2CPP line map + +IL2CPP turns your C# into C++. The line map records which C++ line came from which C# file and line. With it, Bugsee takes a native address from a crash or an exception, finds the C++ line in the native symbols, and maps that to your C#. + +The package adds `--emit-source-mapping --emit-method-map` to the IL2CPP arguments of every IL2CPP build, through the Editor process's `IL2CPP_ADDITIONAL_ARGS` for the build only. It does not change Player Settings. The build writes `LineNumberMappings.json` and `MethodMap.tsv`, with or without a token. + +- Set `BUGSEE_NO_IL2CPP_MAPPING` to turn the emission and the upload off. +- Set `BUGSEE_IL2CPP_MAPPING` to the path of a `LineNumberMappings.json` of your own to upload that file instead. The arguments are still added. +- Set `BUGSEE_IL2CPP_UUIDS` to the module UUIDs, comma separated, to skip reading them from the build output. +- `BUGSEE_NO_SYMBOL_UPLOAD` turns the upload off but still writes the files. + +The first build after you update the package, and every toggle of `BUGSEE_NO_IL2CPP_MAPPING`, compiles all the generated C++ again once. The flags add `//` comments with absolute source paths to the generated C++. Set `BUGSEE_NO_IL2CPP_MAPPING` if you hand the generated C++ or an Xcode export to other people. + +On Android the Editor uploads the line map after the build, when `BUGSEE_APP_TOKEN` is set. On iOS the Xcode Run Script uploads it, keyed by the UUID of `UnityFramework`. If the Editor cannot find the UUID at export, it leaves the upload to the Run Script. + +The line map alone does not symbolicate. You also need the native symbols of the same build with line information: + +- Android: **Create symbols.zip** set to Debugging. See [Public and Debugging symbols](/sdk/unity/symbolication/android#public-and-debugging-symbols). +- iOS: the dSYMs the Run Script uploads. + +### Known issues + +- Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public. Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. +- Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). + +An exception that is rethrown through `await` has a stack text in two parts, joined by `--- End of stack trace from previous location ---`. On IL2CPP the frames before the separator get no address, so they stay unresolved. Only the frames after it, the live stack, resolve. + +### Upload the IL2CPP line map from CI + +The build writes the line map next to the generated C++, even without a token. Keep the folder as a build artifact and upload after the build: + +| Platform | Where `LineNumberMappings.json` is | +| --- | --- | +| Android, APK or AAB | `_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/Symbols/`. Keep this folder: the next build overwrites the copy under `Library/Bee`. | +| Android, Export Project | In the exported project folder: search it for `LineNumberMappings.json` | +| iOS | `/Il2CppOutputProject/Source/il2cppOutput/Symbols/` | + +```bash +export BUGSEE_APP_TOKEN="your-app-token" + +bugsee-cli debug-files upload /LineNumberMappings.json \ + --type il2cpp-linemap \ + --version --build \ + --uuid +``` + +`MethodMap.tsv` and `il2cppFileRoot.txt` beside the JSON are sent with it. `il2cppFileRoot.txt` is written by Unity and is not required. The module UUIDs are those of the IL2CPP module: + +- Android: the GNU build id of each `libil2cpp.so`, one per ABI, comma separated. Read it with `llvm-readelf -n` from the NDK on `lib//libil2cpp.so` in the APK, or on the copy in `symbols.zip`. +- iOS: the Mach-O UUID of `UnityFramework`, from `dwarfdump --uuid` on the built `UnityFramework.framework/UnityFramework` or its dSYM. + +The version and the build number must match the build's. Upload the matching native symbols (`elf` or `dsym`) too. See [Uploading debug information files](/cli/debug-files#unity-il2cpp). + +## Mono on Android Release builds + +A Mono build that is not a Development Build ships no `.pdb`, so the dashboard has an IL offset and a module id for each C# frame. After such a build, the Editor has `bugsee-cli` convert your assemblies and their portable `.pdb` files into Bugsee's BMF mapping and upload that. The CLI does not upload the `.pdb` files themselves. The mapping is keyed by method signature and IL offset, and registered under the module id of the assembly the app ships. + +The Editor runs this step when: + +- The build target is Android with the Mono scripting backend and is not a Development Build. +- `BUGSEE_APP_TOKEN` is set in the Editor's environment and `BUGSEE_NO_SYMBOL_UPLOAD` is not. + +It does not run for IL2CPP or on iOS. With no token or with `BUGSEE_NO_SYMBOL_UPLOAD` set, the Editor warns once with the manual command and continues. + +### CLI version + +This step needs `bugsee-cli` 0.9.0 or newer. If the CLI the shared lookup found is older, the Editor looks for the first CLI of 0.9.0 or newer in the lookup order, and otherwise uses the package's cached or downloaded 0.9.0 release (or the release in `BUGSEE_CLI_VERSION`, when that is 0.9.0 or newer; a lower value is ignored for this step). It logs which CLI it took. A `BUGSEE_CLI_PATH` that names an older CLI is not replaced: the Editor warns and skips the step. The same warning appears when no CLI of 0.9.0 or newer is found and downloading is not possible (`BUGSEE_NO_CLI_DOWNLOAD` is set, an earlier download failed, or no release exists for the host). The build continues in every case. + +### Where the files come from + +The Editor reads the compiler output in `Library/Bee/artifacts/P.dag`, the newest folder compiled for Android, and the linked assemblies in `Library/Bee/artifacts/Android/ManagedStripped`. Managed stripping at Low or higher gives each assembly a new module id, so the mapping must be registered under the stripped assemblies' ids. If the `ManagedStripped` folder is missing or older than the compiler output, the upload still runs under the compiler's module ids, the Editor warns, and the result matches the app only with managed stripping Disabled. If several Android release folders exist, the Editor warns and names them. Delete the folders you no longer build with. + +A failure, a missing folder or a non-zero exit is a warning, never a failed build. + +### Upload by hand + +```bash +export BUGSEE_APP_TOKEN="your-app-token" + +bugsee-cli debug-files upload Library/Bee/artifacts/P.dag \ + --type portable-pdb \ + --shipped-dir Library/Bee/artifacts/Android/ManagedStripped \ + --version --build +``` + +Use `debug-files convert ... --to bmf --output ` to write the same BMF files locally without uploading. The CLI exits with 11 when a `.pdb` does not belong to its assembly, or when two different assemblies map to one module id, so name one `.dag` folder and not its parent. See [Unity Mono](/cli/debug-files#unity-mono) for every option. + +### Limits on Android Mono + +Unity 2021.3 has no Mono ARM64 build, and frames inside the Mono runtime libraries stay unsymbolicated. See [Mono](/sdk/unity/symbolication/android#mono). diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx index 332b993e..b28634cd 100644 --- a/docs/sdk/unity/symbolication/overview.mdx +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -1,6 +1,6 @@ --- title: "Symbolication overview" -description: "TODO(writer-E): Symbolication overview for the Bugsee Unity SDK 7.x." +description: "What Bugsee needs to turn Unity 7.x crash and exception frames back into your own method names, files and lines, and which build step uploads each piece." sidebar_position: 1 slug: "/sdk/unity/symbolication/overview" --- @@ -9,4 +9,95 @@ slug: "/sdk/unity/symbolication/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-E) +A Release player ships stripped native libraries, and IL2CPP turns your C# into C++. A crash or exception from that build carries addresses and generated names. To show your own methods, files and lines, Bugsee needs the debug files of that exact build. The Unity package uploads them for you while the build runs, when you give the build an app token. + +This page explains what is uploaded, by which step, and what to check. The platform pages have the setup: + +- [Symbolication: Android](/sdk/unity/symbolication/android) +- [Symbolication: iOS](/sdk/unity/symbolication/ios) +- [Symbolication: C# code](/sdk/unity/symbolication/managed-code) +- [Build environment variables](/sdk/unity/symbolication/environment-variables) + +## What gets uploaded + +| Debug file | Platform | When it is uploaded | `bugsee-cli` type | +| --- | --- | --- | --- | +| Native symbols: Unity's `symbols.zip` (`libil2cpp.so`, `libunity.so`, `libmain.so`) | Android | After the Unity build, from the Editor | `elf` | +| Native libraries of your plugins and AARs that still carry symbols | Android | After the Unity build, from the Editor | `elf` | +| R8/ProGuard `mapping.txt` | Android | After the Unity build, from the Editor, when the build has one | `proguard` | +| IL2CPP line map (`LineNumberMappings.json`, with `MethodMap.tsv`) | Android | After the Unity build, from the Editor | `il2cpp-linemap` | +| Managed-code mapping made from the portable `.pdb` files | Android, Mono scripting backend, not a Development Build | After the Unity build, from the Editor | `portable-pdb` | +| dSYM bundles | iOS | While Xcode builds, from the `Bugsee Upload Symbols` Run Script phase | `dsym` | +| IL2CPP line map | iOS | While Xcode builds, from the same Run Script phase | `il2cpp-linemap` | + +The package adds `--emit-source-mapping --emit-method-map` to the IL2CPP arguments of every IL2CPP build unless `BUGSEE_NO_IL2CPP_MAPPING` is set, so the line map is written whether or not you set a token. The token only decides whether it is uploaded. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code). + +## Turn the upload on + +The upload is opt-in. Set `BUGSEE_APP_TOKEN` in the environment of the process that builds: + +- **Android:** the Unity Editor process (or the batch-mode command line). The Editor runs `bugsee-cli` after the build. +- **iOS:** the environment of Xcode or `xcodebuild`. The Unity export never writes the token into the Xcode project, and the Run Script phase reads it when Xcode builds. + +```bash +export BUGSEE_APP_TOKEN="your-app-token" +``` + +A Unity Editor started from the Hub or the Finder does not inherit your shell's environment. Start the Editor from a terminal that has the variable, or set it in your CI job. + +Set `BUGSEE_NO_SYMBOL_UPLOAD` to any value to turn every upload off. [Build environment variables](/sdk/unity/symbolication/environment-variables) lists all the variables and Editor settings. + +## An upload never fails your build + +The package treats every symbol upload as best effort. A missing token, a missing `bugsee-cli`, a missing map or a failed upload prints a warning in the Unity Console (Android) or the Xcode build log (iOS), and the build continues. Read the log of a release build once to see that the uploads ran. + +The Android upload logs lines that start with `Bugsee: uploading`. The iOS Run Script prints `Bugsee: uploading dSYM` for each dSYM, and a `warning:` line for each problem. + +## The build token and the launch token + +Symbols follow the token in `BUGSEE_APP_TOKEN` at build time. Crashes follow the token you pass to `Bugsee.Launch`. When the two name different apps, the symbols sit in another app than the crashes and nothing in the dashboard says so. + +To catch this, the build records a fingerprint of the token (the first 8 bytes of the SHA-256 of the trimmed token, as 16 hex characters, never the token itself): + +- On Android, the Editor adds it as the Resources asset `BugseeBuildTokenFingerprint` while the build runs and removes it afterwards, only when an Android symbol upload is on. +- On iOS, the Run Script writes it as the key `BugseeBuildTokenFingerprint` of the built app's `Info.plist`. + +`Bugsee.Launch` in a player logs one warning, naming both fingerprints, when its token has a different fingerprint. It stays silent in the Editor and for a build that recorded none. + +Set `BUGSEE_NO_TOKEN_CHECK` for the build when you choose the token at run time, for example a staging app and a production app from one build. On iOS, set it in the Xcode environment. Setting it in the Unity Editor at export does nothing for the Run Script. + +## Where `bugsee-cli` comes from + +The Editor uploads run the [Bugsee CLI](/cli). A Unity Editor started from the Hub or the Finder does not have your shell's `PATH`, so the package looks for the CLI in this order: + +1. `BUGSEE_CLI_PATH`. +2. The Editor's `PATH`. +3. The directories the installers use: `/opt/homebrew/bin`, `/usr/local/bin`, `~/.local/bin`, `~/.cargo/bin`, `~/.bugsee/bin` and, on Windows, `%LOCALAPPDATA%\Bugsee\bin`. +4. The package's download cache: `~/Library/Caches/Bugsee/cli` on macOS, `$XDG_CACHE_HOME/bugsee/cli` or `~/.cache/bugsee/cli` on Linux, `%LOCALAPPDATA%\Bugsee\cache\cli` on Windows, else `Library/Bugsee/cli` in the project. + +An installed CLI older than 0.8.1 is passed over. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads CLI 0.9.0 from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. + +The upload of managed-code mappings for Mono needs CLI 0.9.0 or newer. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#mono-on-android-release-builds). + +The iOS Run Script has its own lookup and never downloads. See [Symbolication: iOS](/sdk/unity/symbolication/ios#how-the-run-script-finds-bugsee-cli). + +## Version and build number + +Every upload carries a version and a build number, and Bugsee matches them to the app that reports the crash. The package reads them from Player Settings and the built app. Set `BUGSEE_VERSION` and `BUGSEE_BUILD` to override them for a build, for example in CI. + +## Which setting gives which result + +| You want | Do this | +| --- | --- | +| C# file and line for a crash or exception on Android IL2CPP | Create symbols.zip set to Debugging and the IL2CPP line map uploaded. See [Symbolication: Android](/sdk/unity/symbolication/android#public-and-debugging-symbols). | +| C# file and line on Android Mono (Release) | `BUGSEE_APP_TOKEN` and CLI 0.9.0 or newer. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code). | +| C# file and line on iOS | A dSYM and the line map, uploaded by the Run Script. See [Symbolication: iOS](/sdk/unity/symbolication/ios). | +| An upload from a CI job after the build | `bugsee-cli debug-files upload`. See [Uploading debug information files](/cli/debug-files). | +| No uploads from a build | `BUGSEE_NO_SYMBOL_UPLOAD`, or leave `BUGSEE_APP_TOKEN` unset. | + +## Known issues in 7.0.0-beta.1 + +- Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file:line) when the symbols are Public (symbol table only). Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. +- Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). + +Details are in [Symbolication: Android](/sdk/unity/symbolication/android#public-and-debugging-symbols) and [Symbolication: C# code](/sdk/unity/symbolication/managed-code). diff --git a/docs/sdk/unity/user-session-data.mdx b/docs/sdk/unity/user-session-data.mdx index 34961f2f..8641bfcc 100644 --- a/docs/sdk/unity/user-session-data.mdx +++ b/docs/sdk/unity/user-session-data.mdx @@ -1,6 +1,6 @@ --- title: "User & session data" -description: "TODO(writer-C): User & session data for the Bugsee Unity SDK 7.x." +description: "Attach a user identifier and custom attributes to every Bugsee report in the Unity SDK 7.x: SetUserIdentifier, SetAttribute, GetAllAttributes, accepted value types and limits." sidebar_position: 11 slug: "/sdk/unity/user-session-data" --- @@ -9,4 +9,106 @@ slug: "/sdk/unity/user-session-data" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +When you know who is using the game, or something about the session, attach it to every report. Issues in the dashboard can be searched by these values. + +## User identity + +Set a user identifier, such as an account id or an email address, and Bugsee adds it to every report from then on. If the value is an email address, the server may link the report to an existing user. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + + +BugseeSdk.SetUserIdentifier("name@example.com"); + +// null when none is set +string identifier = BugseeSdk.GetUserIdentifier(); + +BugseeSdk.ClearUserIdentifier(); +``` + +- `Bugsee.SetUserIdentifier(string)` with `null` or an empty string clears the identifier, like `ClearUserIdentifier`. +- `Bugsee.GetUserIdentifier()` returns `null` when no identifier is set. +- There is no separate email API on the `Bugsee` class in 7.x. The identifier replaces the 6.x email calls. To set the email of a single report, use `IReport.Email` in a [report handler](/sdk/unity/report-handler). +- On iOS the identifier persists across launches until you clear it. For Android, see [Android user & session data](/sdk/android/user-session-data). + +## User and session attributes + +Attributes are arbitrary key-value pairs, such as a plan name, a feature flag or a count, attached to every report. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + + +BugseeSdk.SetAttribute("name", "John Doe"); +BugseeSdk.SetAttribute("age", 23); +BugseeSdk.SetAttribute("married", true); +BugseeSdk.SetAttribute("score", 12.5); + +object age = BugseeSdk.GetAttribute("age"); // 23L, null when not set +``` + +### Accepted values + +`Bugsee.SetAttribute(string key, object value)` accepts: + +| Value | Limit | +| --- | --- | +| `string` | At most 1024 UTF-16 units. | +| `bool` | None. | +| Integer types (`sbyte`, `byte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`) | Within the signed 64-bit range. | +| `float`, `double`, `decimal` | Finite and below 2^63 in magnitude. | + +The key must not be empty. Any other value, including `null`, throws `ArgumentException`. The call also throws `ArgumentException` if the SDK drops the attribute after you set it, for example because it exceeds the native size limits. + +Native limits apply on top. Each attribute is limited to about 1 KB and all attributes together to about 25 KB. See [Android user & session data](/sdk/android/user-session-data) and [iOS user & session data](/sdk/ios/user-session-data). + +:::note[Attribute values read back as `long` and `double`] +`Bugsee.GetAttribute` returns the kind that was set: `string`, `bool`, `long` or `double`. Every integer reads back as `long` and floating-point values as `double`, on both platforms, whatever width you set. A value set as `1.0` stays floating. In 7.0.0-beta.1 Android returns `long` and `double` as iOS does. Replace `(int)` unboxing with `Convert.ToInt32` or `(long)`. +::: + +### Read attributes + +```csharp +using System.Collections.Generic; +using BugseeSdk = Bugsee.Bugsee; + +// A read-only snapshot, never null, empty when no attribute is set. +IReadOnlyDictionary all = BugseeSdk.GetAllAttributes(); + +foreach (var pair in all) +{ + UnityEngine.Debug.Log(pair.Key + " = " + pair.Value); +} +``` + +`Bugsee.GetAllAttributes()` returns each value typed as `GetAttribute` reads it. The snapshot does not change when attributes change later. A container set natively reads as a nested dictionary or list on Android and as JSON text on iOS. + +### Clear attributes + +```csharp +using BugseeSdk = Bugsee.Bugsee; + + +// One attribute +BugseeSdk.ClearAttribute("name"); + +// All of them +BugseeSdk.ClearAllAttributes(); +``` + +Attributes persist across launches until you clear them or the app is uninstalled. + +### Attributes on a single report + +The calls above set attributes on every report. To set one on a single report, use `IReport.SetAttribute` on the report itself, in a [report handler](/sdk/unity/report-handler) or on a report you build with `Bugsee.CreateReport()`. See [Bug reporting](/sdk/unity/manual/bug-reporting). + +## In the Editor + +In the Unity Editor, and on platforms other than Android and iOS, the calls do not reach an SDK. `SetAttribute` still validates its arguments and throws for a bad key or value. `GetAttribute` returns `null` and `GetAllAttributes` returns an empty dictionary. + +## Related pages + +- [Custom events & traces](/sdk/unity/events-and-traces) +- [Report handler](/sdk/unity/report-handler) +- [Breadcrumbs](/sdk/unity/breadcrumbs) diff --git a/docs/sdk/unity/video-capture.mdx b/docs/sdk/unity/video-capture.mdx index 3d704c2e..cab76021 100644 --- a/docs/sdk/unity/video-capture.mdx +++ b/docs/sdk/unity/video-capture.mdx @@ -1,6 +1,6 @@ --- title: "Video capture" -description: "TODO(writer-C): Video capture for the Bugsee Unity SDK 7.x." +description: "Configure screen video in the Bugsee Unity SDK 7.x: the video options, the Android capture modes, the experimental DirectBuffers frame pusher, blackout and secure rectangles." sidebar_position: 13 slug: "/sdk/unity/video-capture" --- @@ -9,4 +9,243 @@ slug: "/sdk/unity/video-capture" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Bugsee records the screen and attaches the last part of the recording to every report. In the Unity SDK, the native Bugsee SDKs record the video by default. On Android you can instead opt in to an experimental mode where Unity supplies the frames. + +In the Unity Editor, and on platforms other than Android and iOS, video options have no effect. + +## Options + +Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [Configuration](/sdk/unity/configuration) for the full tables. The defaults are those of the native SDKs the package pins. + +### Both platforms + +| Option | Type | Default | What it does | +| --- | --- | --- | --- | +| `CaptureVideo` | `bool` | `true` | Record the screen. Set it to `false` to record no video. | +| `CaptureVideoQuality` | `VideoQuality` | `Default` | Quality of the recorded video: `Default`, `Medium` or `High`. | +| `CaptureVideoFrameRate` | `FrameRate` | `High` | How often frames are captured: `Low`, `Medium` or `High`. `Raw` removes the cap and is meaningful only with `VideoMode.DirectBuffers`. | +| `CaptureVideoScale` | `float` | `1.0` | Scale applied to the recorded frames. A value below `1.0` records smaller frames. | +| `CaptureVideoAdaptive` | `bool` | `false` on Android, `true` on iOS | Skip capturing new frames while nothing on screen has been redrawn. A frame is still taken at least once per second. | + +`CaptureScreenshot` (default `true`) controls the report screenshot and is independent of `CaptureVideo`. + +### Android + +| Option | Type | Default | What it does | +| --- | --- | --- | --- | +| `CaptureVideoMode` | `VideoMode` | `V2` | The capture engine. See [Android capture modes](#android-capture-modes). | +| `CaptureVideoSecureScrolling` | `bool` | `false` | In `VideoMode.V1`, skip more frames while secure views are on screen. | +| `CaptureVideoUsingCustomMuxer` | `bool` | `false` | Use Bugsee's MP4 muxer instead of Android's `MediaMuxer`. | +| `CaptureVideoFullscreenRememberUserDecision` | `bool` | `true` | In `VideoMode.Fullscreen`, remember the user's screen-capture consent across launches. | +| `CaptureVideoFullscreenKeepRunning` | `bool` | `true` | In `VideoMode.Fullscreen`, keep the capture session running in the background. This shows a persistent foreground-service notification. With `false`, the session stops in the background and Android 14 and later prompt again on return. | +| `CaptureRespectFlagSecure` | `bool` | `true` | Blank windows that set the Android `FLAG_SECURE` flag in video and screenshots. Set it to `false` to keep recording them. | + +### iOS + +| Option | Type | Default | What it does | +| --- | --- | --- | --- | +| `CaptureVideoPrivacyBlur` | `bool` | `true` | Blur the frames of a screen transition. With `false`, the video freezes for the transition instead. | +| `CaptureVideoMinFrameRate`, `CaptureVideoMaxFrameRate` | `int` (fps) | `0` | Lowest and highest capture frame rate. `0` uses the rate that `CaptureVideoFrameRate` picks. | + +The Unity package has a typed property for `CaptureVideoAdaptive` on `AndroidLaunchOptions` only. On iOS, set the key with `SetCustomOption(Options.CaptureVideoAdaptive, false)`. + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions +{ + CaptureVideo = true, + CaptureVideoQuality = VideoQuality.Medium, + CaptureVideoFrameRate = FrameRate.Medium, + CaptureVideoScale = 0.75f, +}; +#elif UNITY_IOS +var options = new IOSLaunchOptions +{ + CaptureVideo = true, + CaptureVideoQuality = VideoQuality.Medium, + CaptureVideoFrameRate = FrameRate.Medium, + CaptureVideoScale = 0.75f, +}; +#endif + +BugseeSdk.Launch("", options); +``` + +The package drops the Android-only options before an iOS launch, and the iOS-only options before an Android launch. + +## Android capture modes + +`AndroidLaunchOptions.CaptureVideoMode` takes a `VideoMode`: + +| Value | Meaning | +| --- | --- | +| `None` | Selects no capture engine. To turn video off, set `CaptureVideo` to `false`. | +| `V1` | A built-in capture engine of the Android SDK. | +| `V2` | The default capture engine of the Android SDK. The default. | +| `Fullscreen` | Android screen capture (MediaProjection). It asks the user for consent. See the `CaptureVideoFullscreen*` options above. | +| `DirectBuffers` | The app supplies the frames. In Unity this is the experimental [frame pusher](#experimental-unity-frame-pusher-android). | + +The 6.x modes `V3` and `V4` no longer exist. + +In `VideoMode.Fullscreen`, call `Bugsee.ResetVideoCapturePermission()` to forget the stored consent so that the next capture start asks again. It has no effect before launch and does not change a session that is already capturing. On iOS the call does nothing and logs a warning once, because the iOS SDK needs no capture permission. + +For the Android SDK's own description of the modes, see [Android configuration](/sdk/android/configuration) and [Android privacy: video](/sdk/android/privacy/video). + +## Experimental: Unity frame pusher (Android) + +:::caution[Experimental] +The frame pusher is experimental and Android only. It is off unless you opt in. Evaluate it in your own app before you ship it. +::: + +By default the Android SDK captures the window itself (`VideoMode.V2`). With `VideoMode.DirectBuffers`, Unity captures the final rendered frame and hands the pixels to the SDK instead. Nothing changes unless a launch asks for `VideoMode.DirectBuffers` or you call `BugseeFrameCapturer.Enable()` yourself. + +### Requirements + +- An Android player build on a release build (channel `f` or `p`) of Unity 2022.2.0f1 or newer. Alpha and beta builds are not supported. Unity 2021.3 and 2022.1 are not supported. +- The Screen Capture module (`com.unity.modules.screencapture`) in the project. The package does not require it, and without it the frame pusher is not compiled in. +- A device that supports `AsyncGPUReadback`. +- A graphics API whose pixel row order the package knows: Vulkan or OpenGLES3. For another API, see [Row order](#row-order). + +### Turn it on + +Ask for it with the launch option alone. You do not need to call `Enable()`. + +```csharp +using Bugsee.Capture; +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID && !UNITY_EDITOR +// Optional. Set before launching. +BugseeFrameCapturer.DefaultOptions = new BugseeFrameCapturerOptions +{ + TargetFps = 5, + MaxDimension = 640, +}; + +BugseeSdk.Launch("", new AndroidLaunchOptions +{ + CaptureVideo = true, + CaptureVideoMode = VideoMode.DirectBuffers, +}); +#endif +``` + +`Bugsee.Launch` and `Bugsee.Relaunch` start the capturer with `BugseeFrameCapturer.DefaultOptions` when the options ask for `VideoMode.DirectBuffers`. + +| `BugseeFrameCapturerOptions` field | Type | Default | What it does | +| --- | --- | --- | --- | +| `TargetFps` | `int` | `5` | Frames per second to capture, from 1 to 30. The SDK also caps pushed frames by `CaptureVideoFrameRate`, so it drops a higher `TargetFps`. | +| `MaxDimension` | `int` | `640` | The longer side of the captured frame, in pixels. The screen is scaled down to this and never up. | +| `RowOrder` | `VideoFrameRowOrder?` | `null` | The row order of the pixel buffer read from the GPU, `TopDown` or `BottomUp`. See [Row order](#row-order). | +| `LogStats` | `bool` | `false` | Log the capture counters every 10 seconds. | +| `LogOrientationProbe` | `bool` | `false` | Log the colors of the first and last pixel rows for the first few frames, to check the row order. | + +`VideoFrameRowOrder` is in the `Bugsee.Contracts.Capture` namespace. + +`BugseeFrameCapturer.Stats` returns the counters `Requested`, `Pushed`, `Failed`, `DroppedInFlight` and `DroppedBlackoutOrStopped`. `BugseeFrameCapturer.IsEnabled` tells whether the pusher is running. `BugseeFrameCapturer.Disable()` stops it. + +`BugseeFrameCapturer.Enable(options)` starts the pusher without a launch option. It returns `false` and does nothing off Android, in the Editor, on an unsupported Unity version, without the Screen Capture module, or on a device that cannot read pixels back from the GPU asynchronously. Called off the main thread, it is queued and returns `true` before it ran: check `IsEnabled`. Frames are skipped until the SDK is launched. + +### When it falls back to the default capture + +`VideoMode.DirectBuffers` means that the app pushes the frames, and in Unity the only frame source is this capturer. When it cannot run, the package replaces `DirectBuffers` with `VideoMode.V2` before the options reach the native SDK, and logs one warning with the reason. The session never runs in `DirectBuffers` without a frame source, which would record no real video. + +The reasons are: + +- The player was not probed yet: the launch came from another thread before Unity finished starting. +- The Unity version is not a release build of 2022.2.0f1 or newer. +- The project has no Screen Capture module. +- The device does not support `AsyncGPUReadback`. +- The graphics API's pixel row order is not known and you did not set `RowOrder`. +- The capturer failed to start after the SDK accepted the launch. The package then relaunches with the default capture, unless a newer `Launch` or `Relaunch` is waiting, which then decides. + +Other video modes are never changed. An app that pushes frames itself through the native `getVideoFrameConsumer()` is affected too: use a native mode there, or this fallback applies. + +### Row order + +The pusher knows the pixel row order of Vulkan and OpenGLES3. For another graphics API, such as OpenGLES2, the launch falls back to the default capture, and a capturer started with `Enable()` blanks every frame completely while a secure rectangle is registered. + +To use another API, check the order on your device with `LogOrientationProbe`, then set `RowOrder` to the order you found. Setting it declares the order verified. + +### How it works + +At the end of each due frame the capturer calls `ScreenCapture.CaptureScreenshotIntoRenderTexture`, scales into a small render texture, and reads it back with `AsyncGPUReadback`. It never reads synchronously. + +- One request is in flight at a time. Frames that come due meanwhile are dropped, not queued. +- The pixels are copied once into a persistent native buffer. Secure rectangles are blanked in place. A push thread wraps that memory as a Java direct `ByteBuffer` and hands it to the SDK with the SDK's own clock as the timestamp. +- The package writes no frame to disk. The SDK still writes its recorded video as usual. +- After 5 failed pixel reads in a row the pusher turns itself off. It never falls back to a synchronous read. + +### What it records and what it does not + +- It records Unity's final composite, including screen-space overlay UI. Native Android views, such as WebViews, dialogs and system UI, are not in the video. +- The SDK does not mask frames pushed this way: no secure views, no secure WebViews and no pixelation. The pusher blanks the rectangles you register with `Bugsee.AddSecureRectangle`. See [Secure rectangles](#secure-rectangles). +- Blackout is honored by the SDK. +- `Bugsee.AddSecureWebView` has no effect while the pusher is the capture source. + +## Blackout + +A blackout pauses recording until you end it. Use it around screens you do not want in the video. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + + +BugseeSdk.StartBlackout(); +// ... a sensitive screen ... +BugseeSdk.EndBlackout(); + +bool blackedOut = BugseeSdk.IsBlackout; +``` + +`Bugsee.Pause()` and `Bugsee.Resume()` still exist as aliases of `StartBlackout` and `EndBlackout`, and are marked obsolete. + +## Secure rectangles + +A secure rectangle hides a screen region in the captured video and in report screenshots. Register one over any region the game draws that must not be recorded. + +Unity's `Screen`, `Input.mousePosition` and screen-space `Rect` values have the origin at the bottom left. The native SDKs expect the top left. The two Unity APIs differ in which one you pass: + +| API | Space | When to use it | +| --- | --- | --- | +| `Bugsee.AddSecureScreenRectangle(Rect unityScreenRect, int displayId = 0)` | Unity screen space, origin at the bottom left | Preferred. The package flips the y axis, scales it for Android Resolution Scaling or `Screen.SetResolution`, and offsets it by the position of Unity's view. | +| `Bugsee.AddSecureRectangle(RectInt pixelRect)` | Native display pixels, origin at the top left | When you already have native coordinates. The package does not flip, scale or offset the rectangle. On iOS it divides by the screen scale. | + +```csharp +using UnityEngine; +using BugseeSdk = Bugsee.Bugsee; + +// A UI element under a Screen Space - Overlay canvas. +RectTransform rectTransform = GetComponent(); +var corners = new Vector3[4]; +rectTransform.GetWorldCorners(corners); +var screenRect = Rect.MinMaxRect(corners[0].x, corners[0].y, corners[2].x, corners[2].y); + +BugseeSdk.AddSecureScreenRectangle(screenRect); + +// Later, with exactly the same values: +BugseeSdk.RemoveSecureScreenRectangle(screenRect); +``` + +Rules for both: + +- Remove a rectangle with exactly the values you added. Adding the same rectangle twice needs two removals. +- `AddSecureScreenRectangle` is queued and takes effect on the next frame. It remembers the rectangle as a fraction of the screen it was added for, so it follows Resolution Scaling and layouts that scale with the screen. After a rotation or any change that does not scale proportionally, remove the rectangle and add the new one. +- `Bugsee.GetAllSecureRectangles()` returns the rectangles added with `AddSecureRectangle` and not yet removed, as `RectInt[]` in top-left pixels. It does not return screen-space rectangles. +- `Bugsee.RemoveAllSecureRectangles()` removes all of them. +- Display `0` is the main display. + +For WebViews, `Bugsee.AddSecureWebView` and `Bugsee.RemoveSecureWebView` take the native handle of a WebView plugin: an `AndroidJavaObject` on Android and an `IntPtr` to a `WKWebView` on iOS. They mark a native view and do nothing for a page drawn into a Unity texture. Use a secure rectangle for that. + +For the full privacy guidance, see [Privacy: video](/sdk/unity/privacy/video). + +## Related pages + +- [Privacy: video](/sdk/unity/privacy/video) +- [View hierarchy](/sdk/unity/view-hierarchy) +- [Configuration](/sdk/unity/configuration) +- [Lifecycle & status](/sdk/unity/lifecycle) diff --git a/docs/sdk/unity/view-hierarchy.mdx b/docs/sdk/unity/view-hierarchy.mdx index ebada416..b26e0ebc 100644 --- a/docs/sdk/unity/view-hierarchy.mdx +++ b/docs/sdk/unity/view-hierarchy.mdx @@ -1,6 +1,6 @@ --- title: "View hierarchy" -description: "TODO(writer-C): View hierarchy for the Bugsee Unity SDK 7.x." +description: "How the Bugsee Unity SDK 7.x captures the Unity scene hierarchy for reports: what each node holds, node and depth caps, truncation, deadlines, secure rectangles and the CaptureViewHierarchy option." sidebar_position: 12 slug: "/sdk/unity/view-hierarchy" --- @@ -9,4 +9,113 @@ slug: "/sdk/unity/view-hierarchy" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -TODO(writer-C) +Bugsee captures the view hierarchy of the screen with reports, so you can inspect what was on screen behind the screenshot. The native SDKs capture the native view hierarchy. The Unity package adds the Unity scene: when the native SDK asks for it, the package answers with a tree of the active GameObjects, which is stored with the report next to the native hierarchy. + +In the Unity Editor, and on platforms other than Android and iOS, this capture does nothing. + +:::note[Beta coverage] +The managed Unity hierarchy is new in 7.x and still being completed in this beta. How the dashboard viewer presents it, and which Unity versions and scenes it has been tried on, can change between betas. After you enable it, open a test report in the dashboard and check the hierarchy for your Unity version and scenes. +::: + +## Option and API + +| Option | Platform | Type | Default | What it does | +| --- | --- | --- | --- | --- | +| `CaptureViewHierarchy` | Both | `bool` | `true` | Capture the view hierarchy for reports. Set it to `false` to turn the capture off. | + +```csharp +using Bugsee.Contracts.Options; +using BugseeSdk = Bugsee.Bugsee; + +#if UNITY_ANDROID +var options = new AndroidLaunchOptions { CaptureViewHierarchy = true }; +#elif UNITY_IOS +var options = new IOSLaunchOptions { CaptureViewHierarchy = true }; +#endif + +BugseeSdk.Launch("", options); +``` + +The SDK takes a snapshot when it builds a report. To record the hierarchy at a moment of your choosing, for example before a scene transition you want to inspect, call `Bugsee.CaptureViewHierarchy()`. + +```csharp +using BugseeSdk = Bugsee.Bugsee; + +BugseeSdk.CaptureViewHierarchy(); +``` + +The iOS SDK documents these rules for the call: it does nothing while `CaptureViewHierarchy` is `false` or while the SDK is not fully launched, no hierarchy is captured during a blackout, and each snapshot adds to the size of the report. See [iOS events and traces](/sdk/ios/events-and-traces#view-hierarchy). + +## What is captured + +The tree starts at a root node named `UnityPlayer`. Below it is one `Scene` node for each loaded scene, then each scene's root GameObjects and their children. Objects in the `DontDestroyOnLoad` scene are included. The SDK's own helper object is left out. + +Only GameObjects that are active in the hierarchy are captured. Each node holds: + +| Field | What it holds | +| --- | --- | +| `id` | The instance id of the GameObject. | +| `class_name` | The type of the first component that says what the object is, such as `Image` or `Camera`. `RectTransform` or `GameObject` when there is none. | +| `bounds` | A rectangle `[x, y, width, height]` in screen coordinates with the origin at the top left: pixels on Android, points on iOS. | +| `options.name` | The name of the GameObject. | +| `options.components` | The names of the components on the object, at most 8, comma separated. | +| `subitems` | The child nodes. | +| `truncated` | `true` when the walk stopped at this node and left some of its children out. | + +How the bounds are computed: + +- A UI element under a Screen Space - Overlay canvas uses its rectangle corners as screen pixels. +- A UI element under a Screen Space - Camera or World Space canvas, and any object with an enabled `Renderer`, is projected to the screen through the canvas camera or `Camera.main`. +- A box is clamped to one screen of margin on every side. A node whose box cannot be computed has no bounds of its own. Its box is then the union of its children's boxes, or `[0, 0, 0, 0]` when there are none. + +What is not captured: + +- **Text and values.** Only component type names are read. A `Text`, an input field or a TextMeshPro label contributes its class name and never what it shows. +- **A 3D scene graph.** The hierarchy is a tree of named nodes with a 2D screen rectangle each. It does not carry meshes, transforms in world space or a 3D view of the scene. +- **Inactive GameObjects.** + +## Caps and truncation + +The capture is limited so that a large scene cannot slow the game or delay the report. + +- **At most 1500 nodes.** The root counts as one. +- **At most 24 levels deep.** The root is level 1. +- **Deadlines counted from the request.** The walk stops taking nodes at 250 ms. Writing the result stops at 350 ms, and a timer answers with nothing at 400 ms if no reply was sent. The native SDK waits 500 ms from the request and ignores a later reply. The 400 ms is a target: a thread pool that the game has saturated can delay the reply, and the SDK then ignores it. + +When a cap or deadline stops the walk, the result is still valid JSON, and the nodes where it stopped carry `truncated: true`. The report keeps the native hierarchy either way. + +### How the scene is read + +Unity objects can be read only on the main thread. To keep the cost there small: + +- **Main thread: only the read.** The package copies names, component types, instance ids and geometry into plain arrays in short slices, at most 5% of a frame per slice and one slice per frame. At 60 Hz that is about 0.83 ms. When the game's real frames are longer than the display's, the slice is 5% of those, at most 5 ms. +- **Worker thread: everything else.** Building the tree, the secure-rectangle test and the JSON run on a thread-pool thread. The main thread never waits for it. + +Because a large scene is read over several frames: + +- A large scene may be read only in part within the 250 ms walk, and comes back with `truncated` set. +- An object that moves is not captured at one instant. +- A scene loaded or unloaded during the read marks the tree `truncated`. Objects destroyed during the read are skipped. + +Other cases: + +- One capture runs at a time. A request made while one is running joins it and gets the same result. +- When the app pauses, for example because a manual report opens a native screen, the rest of the walk is read at once, still within its deadline. When the player quits, the running capture is answered with nothing. +- A request made while Unity's main thread is inside a synchronous SDK call, such as while it logs an exception, is answered with nothing at once. The report then carries the native hierarchy only. +- On iOS, a scene of at most 48 nodes that the first slice completes is written and answered inside the request. + +In development builds, each capture writes one console line that starts with `[Bugsee] managed view hierarchy:` with the node count, the size of the result, whether it was truncated and how many nodes a secure rectangle protected. + +## Secure rectangles + +The hierarchy follows the same privacy rules as video and screenshots. A node whose box overlaps a secure rectangle registered with `Bugsee.AddSecureRectangle` or `Bugsee.AddSecureScreenRectangle` loses its `options.name` and `options.components`. Its `class_name` and bounds stay. Each node is judged by its own box, so a full-screen container is protected and its far-away children are not. + +A node with no usable bounds counts as covered while any secure rectangle is registered. + +See [Privacy: video](/sdk/unity/privacy/video) and [Video capture](/sdk/unity/video-capture#secure-rectangles) for how to register rectangles. + +## Related pages + +- [Video capture](/sdk/unity/video-capture) +- [Privacy: video](/sdk/unity/privacy/video) +- [Configuration](/sdk/unity/configuration) From e8d22a34af96aae6634daafd6d0fc9266a2369a5 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 20:01:44 +0500 Subject: [PATCH 03/13] docs(unity): fix the findings of the fact-check review Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I256058cff3f8bba04adbd95c5e54792c004571c0 --- docs/sdk/unity/appearance.mdx | 2 +- docs/sdk/unity/breadcrumbs.mdx | 4 +-- docs/sdk/unity/build-setup/android.mdx | 12 +++---- docs/sdk/unity/build-setup/ios.mdx | 20 +++++++---- docs/sdk/unity/configuration.mdx | 11 +++--- docs/sdk/unity/feedback.mdx | 2 +- .../crash-report-extension.mdx | 10 ++++-- docs/sdk/unity/lifecycle.mdx | 6 ++-- docs/sdk/unity/logs.mdx | 8 ++--- docs/sdk/unity/manual/bug-reporting.mdx | 2 +- .../unity/manual/crash-error-reporting.mdx | 7 ++-- docs/sdk/unity/migration.mdx | 36 ++++++++++--------- docs/sdk/unity/network.mdx | 8 ++--- docs/sdk/unity/overview.mdx | 6 ++++ docs/sdk/unity/performance.mdx | 8 ++--- docs/sdk/unity/privacy/cleanup.md | 3 +- docs/sdk/unity/privacy/logs.md | 6 ++-- docs/sdk/unity/privacy/network.mdx | 2 +- docs/sdk/unity/privacy/overview.md | 5 ++- docs/sdk/unity/privacy/report.md | 11 +++--- docs/sdk/unity/privacy/video.mdx | 6 ++++ docs/sdk/unity/release-notes.md | 10 +++--- docs/sdk/unity/symbolication/android.mdx | 6 ++-- .../symbolication/environment-variables.md | 4 +-- docs/sdk/unity/symbolication/ios.mdx | 10 +++--- docs/sdk/unity/symbolication/overview.mdx | 2 +- docs/sdk/unity/video-capture.mdx | 7 ++-- docs/sdk/unity/view-hierarchy.mdx | 14 +++++--- 28 files changed, 135 insertions(+), 93 deletions(-) diff --git a/docs/sdk/unity/appearance.mdx b/docs/sdk/unity/appearance.mdx index d88b9668..c7874f0f 100644 --- a/docs/sdk/unity/appearance.mdx +++ b/docs/sdk/unity/appearance.mdx @@ -43,7 +43,7 @@ Set the colors in your startup code, before a report dialog can open. In the Uni ## Report colors and texts -Keys of `ReportAppearance`. A key that has no iOS equivalent is skipped on iOS: it changes nothing, reads back `null`, and the SDK logs `Appearance property ... has no iOS equivalent; skipped.` once per key. +Keys of `ReportAppearance`. A key that has no iOS equivalent is skipped on iOS: it changes nothing, reads back `null`, and the Bugsee iOS bridge logs `Appearance property ... has no iOS equivalent; skipped.` once per key. | Key | Type | Android | iOS | What it changes | | --- | --- | --- | --- | --- | diff --git a/docs/sdk/unity/breadcrumbs.mdx b/docs/sdk/unity/breadcrumbs.mdx index 6063a177..d2408930 100644 --- a/docs/sdk/unity/breadcrumbs.mdx +++ b/docs/sdk/unity/breadcrumbs.mdx @@ -28,11 +28,11 @@ using BugseeSdk = Bugsee.Bugsee; #if UNITY_ANDROID var options = new AndroidLaunchOptions { CaptureBreadcrumbs = true }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { CaptureBreadcrumbs = true }; +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` In the Unity Editor, and on platforms other than Android and iOS, breadcrumb calls do nothing. diff --git a/docs/sdk/unity/build-setup/android.mdx b/docs/sdk/unity/build-setup/android.mdx index 891100bd..f5c39dee 100644 --- a/docs/sdk/unity/build-setup/android.mdx +++ b/docs/sdk/unity/build-setup/android.mdx @@ -43,15 +43,15 @@ The Bugsee Gradle plugin needs AGP 8.6 and Gradle 8.7 or later. The package read | Generated AGP | Typical Unity version | What the package applies | | --- | --- | --- | | 8.6 or later | Unity 6, for example 6000.0.84f1 with AGP 9.0.0 | The Gradle plugin `4.1.1` and `bugsee { ndk { enabled = true } }` in the launcher module. | -| 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.2, Gradle 7.5.1 in the releases checked) | No plugin. The package adds a small Gradle task to the launcher that writes the build id asset, and the Editor uploads symbols itself. | -| Older than 7.4, or unreadable | The first Unity 2021.3 patch releases ship AGP 4.0.1 | No plugin and no build id task. A warning explains why. | +| 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.2, Gradle 7.5.1 in the releases checked) | No plugin. The package adds a small Gradle task to a Groovy launcher file that writes the build id asset, and the Editor uploads symbols itself. A Kotlin DSL launcher gets no task. | +| Older than 7.4, or unreadable | The first Unity 2021.3 patch releases ship AGP 4.0.1 | No plugin and no build id task. The build logs an info line when it can read the AGP version, and a warning when it cannot. | On the older AGPs, the plugin functions that the package recovers are these: | Plugin function | On AGP 8.6 and later | On older AGPs | | --- | --- | --- | | Declare `bugsee-android` and `bugsee-android-ndk` | The package. | The package. | -| `assets/bugsee_build_id.properties`, the id of the R8 mapping | The plugin. | The package's Gradle task, on AGP 7.4.x and 8.0 to 8.5. With R8 off, no asset is written and the SDK derives its own id. | +| `assets/bugsee_build_id.properties`, the id of the R8 mapping | The plugin. | The package's Gradle task, on AGP 7.4.x and 8.0 to 8.5, for a Groovy launcher file only. With a Kotlin DSL launcher the SDK derives its own id. With R8 off, no asset is written and the SDK derives its own id. | | Mapping and native symbol upload | The Editor uploads after Gradle runs. | The Editor uploads after Gradle runs. | | Bytecode instrumentation of Java and Kotlin code, build info and size analysis | The plugin. | Not available. The plugin needs AGP 8.6 or later. | @@ -71,11 +71,11 @@ Unity 2021.3, 2022.3 and 6 generate Groovy files (`*.gradle`). A project that co | A plugin you declared yourself (`id`, `apply plugin`, `classpath`) | Kept as written. Nothing is added next to it. | | A launcher that applies the Android plugin with `apply` and no `plugins { }` block, or a one-line `plugins { }` | Left alone. A warning on every build names the lines to add. | -If the settings file's `pluginManagement` repositories do not serve the plugin (not the Gradle plugin portal, not Maven Central, and no mirror whose filter includes `com.bugsee`), the package appends `mavenCentral()` after the existing entries and warns. Set the environment variable `BUGSEE_NO_GRADLE_REPO_INJECTION` (any value) to stop the package from changing project repositories. The plugin is then not applied, and the warning lists the lines to add. +If the settings file's `pluginManagement` repositories do not serve the plugin (not the Gradle plugin portal, not Maven Central, and no mirror whose filter includes `com.bugsee`), the package appends `mavenCentral()` after the existing entries and warns. Set the environment variable `BUGSEE_NO_GRADLE_REPO_INJECTION` (any value) to stop the package from adding Maven Central to the plugin and buildscript repositories. The package still adds `mavenCentral()` to the dependency repositories that resolve `bugsee-android`. If the plugin cannot then resolve from your repositories, it is not applied, and the warning lists the lines to add. Two menu items help with templates: -- **Bugsee > Android > Remove Legacy Gradle Templates** checks `Assets/Plugins/Android` for Gradle templates that earlier package versions wrote, and backs up and removes the unedited ones. A template of your own that pins another AGP major than your Unity's default is left unchanged, and the build warns about it. +- **Bugsee > Android > Remove Legacy Gradle Templates** checks `Assets/Plugins/Android` for Gradle templates that earlier package versions wrote, and backs up and removes the unedited ones. A template of your own that pins another AGP major than your Unity's default is left unchanged, and the build warns about it. The same cleanup also runs automatically before every Android build, for templates that pin another AGP major or use the removed DSL. The menu item runs it on demand. - **Bugsee > Android > Force Gradle Plugin On Older AGP (unsupported)** applies the plugin whatever AGP the package detects. A plugin that needs AGP 8.6 will likely fail Gradle configuration on an older AGP. ## Minify and R8 @@ -139,7 +139,7 @@ Limits of an exported project: - Builds that the Editor runs itself keep the token-less block, because the Editor's own upload after Gradle sends the mapping and symbols. :::warning[The token can appear in logs] -Gradle with `--info` or `--debug` prints the `bugsee-cli` command line, which contains `--app-token `, in the console and in the daemon log under `~/.gradle/daemon`. Do not run CI builds of an exported project with `--info` or `--debug`, or mask the value. +Gradle with `--info` or `--debug` can print the `bugsee-cli` command line, which contains `--app-token `, in the console and in the daemon log under `~/.gradle/daemon`. Do not run CI builds of an exported project with `--info` or `--debug`, or mask the value. ::: ## Related pages diff --git a/docs/sdk/unity/build-setup/ios.mdx b/docs/sdk/unity/build-setup/ios.mdx index 41151577..7c6e62f3 100644 --- a/docs/sdk/unity/build-setup/ios.mdx +++ b/docs/sdk/unity/build-setup/ios.mdx @@ -39,11 +39,11 @@ Debug builds then have no dSYM to upload. The export writes `BugseeScripts/upload-symbols.sh` next to the Xcode project and adds a **Bugsee Upload Symbols** Run Script phase to the app target that runs it. The phase uploads the app's and `UnityFramework`'s dSYMs and the IL2CPP line map, so crash frames resolve to your code. -- **Token.** The script reads `BUGSEE_APP_TOKEN` when Xcode builds, from the environment or from a user-defined build setting. The token is never written into the project. Without it, the build prints a warning and uploads nothing. +- **Token.** The script reads `BUGSEE_APP_TOKEN` when Xcode builds, from the environment or from a user-defined build setting. The token is never written into the project. Without it, nothing is uploaded. An archive or install build prints a warning, and any other build prints a note. - **Which builds.** The script runs for every Xcode configuration, Debug included, and on every build that has the token in its environment, not only archives. Set `BUGSEE_SKIP_UPLOAD_ON_DEBUG=1` to skip the Debug configuration, for example for local runs from Xcode. - **Opt out.** `BUGSEE_NO_SYMBOL_UPLOAD` set in the environment of the Xcode build makes the script print that it skips the upload and upload nothing. - **The CLI.** The script never downloads `bugsee-cli`. At export, on macOS with `BUGSEE_APP_TOKEN` set, the Editor looks for an installed CLI and writes its absolute path into the script. That path contains your home directory. If you commit the exported project, set `BUGSEE_NO_SYMBOL_UPLOAD` or unset `BUGSEE_APP_TOKEN` before you export, and nothing is baked. When no CLI is found, the script prints a warning that lists the paths it tried, and the build continues. -- **Sandbox.** The export sets `ENABLE_USER_SCRIPT_SANDBOXING = NO` on the `Unity-iPhone` target. With the sandbox on, Xcode refuses to start the script and nothing is uploaded. A project-wide or command-line `ENABLE_USER_SCRIPT_SANDBOXING=YES` still wins over the target's setting. +- **Sandbox.** The export sets `ENABLE_USER_SCRIPT_SANDBOXING = NO` on the `Unity-iPhone` target. With the sandbox on, Xcode refuses to start the script and nothing is uploaded. A command-line override or an Xcode configuration file override of `ENABLE_USER_SCRIPT_SANDBOXING` still wins. - **Failures.** A failing upload never fails the build. For what is uploaded and how to read the results, see [iOS symbolication](/sdk/unity/symbolication/ios) and [Environment variables](/sdk/unity/symbolication/environment-variables). @@ -52,17 +52,23 @@ For what is uploaded and how to read the results, see [iOS symbolication](/sdk/u On iOS 27 and later, the iOS SDK can report exits that no in-process handler survives, such as out-of-memory kills, through a Crash Report Extension. The export can add that extension to your Xcode project as an ExtensionKit target named `BugseeCrashReport`, with the bundle id `.BugseeCrashReport`, an iOS 27.0 deployment target on the extension only, and an App Group shared with the app. -The target is added only when the build machine has **Xcode 27 or later**. The setting decides the rest: +The target is added only when `xcodebuild -version` on the Mac that exports the project reports **Xcode 27 or later**. The setting decides the rest: | Setting | Behavior | | --- | --- | | **Auto** (default) | Adds the extension in an interactive Editor build when Player Settings has **Automatically Sign** on and a team id. Never in batch mode. | -| **On** | Adds it for any signing setup. Register the App Group on both App IDs yourself. | +| **On** | Adds it for any signing setup. Register the App Group on both App IDs yourself unless Xcode signs automatically. | | **Off** | Never adds it. | Set it from the menu **Bugsee > iOS > Crash Report Extension** (Auto, On or Off), which is saved per machine, or from the environment with `BUGSEE_IOS_CRASH_EXTENSION=auto`, `1` or `0`, which wins over the menu. The App Group defaults to `group.`. Override it with `BUGSEE_IOS_APP_GROUP=group.`. -The extension's `CFBundleShortVersionString` and `CFBundleVersion` are set to the app's at export. If you change the app's version after export, change the extension's too. +The extension's `CFBundleShortVersionString` and `CFBundleVersion` are set to the app's at export. If you change the app's version after export, change the extension's too. A version mismatch between the app and the extension fails App Store validation. + +:::caution[Unity and iOS 27] +Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +::: + +{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} If you do not want the target, set the mode to Off. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) for what it reports, its limits, the signing requirements and the Append export behavior. @@ -84,11 +90,11 @@ Turn it on for the export in one of two ways. The environment variables win over Or choose **Bugsee > iOS > Early Launch...**, a window with an enable toggle, the iOS app token and the options JSON. It is saved per machine. -The export writes these values into the app's `Info.plist`. It writes `$` as `$` in the options, because Xcode would otherwise collapse `$$` in plist strings. A token that is not a single printable line of at most 256 characters means early launch is not added, with a warning in the build log. Options that are not a JSON object, or are longer than 16,384 characters, are ignored with a warning, and the SDK defaults are used. Nothing is written when early launch is off, and an Append export removes an earlier export's entry. +The export writes these values into the app's `Info.plist`. It writes `$` as `\u0024` in the options, because Xcode would otherwise collapse `$$` in plist strings. A token that is not a single printable line of at most 256 characters means early launch is not added, with a warning in the build log. Options that are not a JSON object, or are longer than 16,384 characters, are ignored with a warning, and the SDK defaults are used. Nothing is written when early launch is off, and an Append export removes an earlier export's entry. How the first `Bugsee.Launch` behaves with early launch: -- **No second launch.** It adopts the running session. The `Launching` and `Launched` lifecycle events arrive once. +- **No second launch.** It adopts the running session. - **Options are launch-only.** Options passed to `Bugsee.Launch` that differ from the early options are logged as a warning and not applied. Put them in the early options, or call `Stop` and launch again. - **The build-time token wins.** A different token in `Bugsee.Launch` is logged, and the session keeps the build-time token. - **After `Stop`**, `Launch` works as without early launch. diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx index 3cd74f97..744a4bb7 100644 --- a/docs/sdk/unity/configuration.mdx +++ b/docs/sdk/unity/configuration.mdx @@ -9,7 +9,7 @@ slug: "/sdk/unity/configuration" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -You configure the SDK with launch options, the second argument of `Bugsee.Launch`. The options are the same `com.bugsee.option.*` keys the native [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration) SDKs read. This page lists every option the Unity package exposes as a C# property, with its type, default and key. +You configure the SDK with launch options, the second argument of `Bugsee.Launch`. The options are the same `com.bugsee.option.*` keys the native [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration) SDKs read. This page lists the options the package documents, with their type, default and key. The typed properties are also in the API reference and in IntelliSense. :::warning[Defaults changed in 7.x] Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. Both were on in earlier versions. To keep them, set `ReportingTriggerByShake = true` (both platforms) and `ReportingTriggerByNotification = true` (Android). @@ -28,7 +28,7 @@ Shake-to-report is off on both platforms, and the notification-bar trigger is of All three live in the `Bugsee.Contracts.Options` namespace. - **Unset options keep the SDK default.** The typed properties are write-only. An option you do not set is not sent, and the native SDK applies its own default. -- **An option the other platform does not know is dropped.** Setting an Android-only option on an iOS launch has no effect, and the reverse. The package removes these keys before the native SDK sees them. +- **A typed property the other platform does not know is dropped.** Setting an Android-only property on an iOS launch has no effect, and the reverse. The package removes a fixed list of keys before the native SDK sees them. A key outside that list, set with `SetCustomOption`, reaches the native SDK as is. - **`SetCustomOption(key, value)`** sets any key on a typed options object. `Clear()` removes everything you set. `ToDictionary()` returns the current map. - **`Options` holds the key constants**, for example `Options.CaptureNetwork`. Each key is `com.bugsee.option.` plus the suffix shown in the tables below. @@ -66,7 +66,7 @@ public static class BugseeSetup } ``` -The `OptionsBuilder` form works on both platforms from one code path. Its `Set` overloads take a key and a `bool`, `int`, `float` or `string`, and it has helpers for enum options (`SetVideoMode`, `SetVideoQuality`, `SetFrameRate`, `SetLogLevel`, `SetDefaultCrashPriority`, `SetDefaultErrorPriority`, `SetDefaultBugPriority`, `SetCrashHandlerType`, `SetCrashSignals`, `SetReportingUIStyle`) and for common switches (`Duration`, `CaptureVideo`, `CaptureNetwork`, `CaptureLogs`, `DetectAndReportCrash`, `CaptureManagedExceptions`, `CaptureUnobservedTaskExceptions`, `DetectAndReportHang`, `DetectAndReportExitNotResponding`, `DetectAndReportExitLowMemory`). +The `OptionsBuilder` form works on both platforms from one code path. Its `Set` overloads take a key and a `bool`, `int`, `float`, `string` or `object`, and it has helpers for enum options (`SetVideoMode`, `SetVideoQuality`, `SetFrameRate`, `SetLogLevel`, `SetDefaultCrashPriority`, `SetDefaultErrorPriority`, `SetDefaultBugPriority`, `SetCrashHandlerType`, `SetCrashSignals`, `SetReportingUIStyle`) and for common switches (`Duration`, `CaptureVideo`, `CaptureNetwork`, `CaptureLogs`, `DetectAndReportCrash`, `CaptureManagedExceptions`, `CaptureUnobservedTaskExceptions`, `DetectAndReportHang`, `DetectAndReportExitNotResponding`, `DetectAndReportExitLowMemory`). ```csharp using Bugsee.Contracts.Options; @@ -216,7 +216,7 @@ These properties exist on `AndroidLaunchOptions` only. An iOS launch drops the k | `WebViewDomainAllowlist` | Android | `string` | `""` | `capture.webview.domain-allowlist` | Domains the WebView capture may record. | | `WebViewReportTrigger` | Android | `bool` | `false` | `capture.webview.report-trigger` | Let WebView content trigger a report. The iOS SDK also reads this key. | | `CaptureVideoMode` | Android | `VideoMode` | `V2` | `capture.video.mode` | How the screen is captured. See [VideoMode](#enums). | -| `CaptureVideoAdaptive` | Android | `bool` | `false` | `capture.video.adaptive` | Skip frames while nothing on screen changes. | +| `CaptureVideoAdaptive` | Android | `bool` | `false` (iOS: `true`) | `capture.video.adaptive` | Skip frames while nothing on screen changes. | | `CaptureVideoSecureScrolling` | Android | `bool` | `false` | `capture.video.secure-scrolling` | With `VideoMode.V1`, skip more frames while secure views are on screen. | | `CaptureVideoUsingCustomMuxer` | Android | `bool` | `false` | `capture.video.custom-muxer` | Use Bugsee's MP4 muxer instead of Android's `MediaMuxer`. | | `CaptureVideoFullscreenRememberUserDecision` | Android | `bool` | `true` | `capture.video.fullscreen-remember-decision` | With `VideoMode.Fullscreen`, remember the user's screen-capture consent across launches. | @@ -229,7 +229,7 @@ These properties exist on `AndroidLaunchOptions` only. An iOS launch drops the k | `ReportingTriggerByNotification` | Android | `bool` | `false` | `reporting.triggers.notification-bar` | Show a notification-bar entry that opens the report dialog. | | `ReportingTriggerByBroadcast` | Android | `bool` | `false` | `reporting.triggers.broadcast` | Allow a broadcast intent to trigger a report. | -`DetectAndReportExit`, `DetectAndReportMainThreadMisuse`, `CaptureNetworkOnLaunch`, `AdvancedWebViewCapture` and `WebViewReportTrigger` have a typed property on `AndroidLaunchOptions` only, but the iOS SDK reads the same keys. On iOS, set them with `SetCustomOption` and the `Options` constants. +`DetectAndReportExit`, `DetectAndReportMainThreadMisuse`, `CaptureNetworkOnLaunch`, `AdvancedWebViewCapture`, `WebViewReportTrigger` and `CaptureVideoAdaptive` have a typed property on `AndroidLaunchOptions` only, but the iOS SDK reads the same keys. On iOS, set them with `SetCustomOption` and the `Options` constants. The iOS default for `CaptureVideoAdaptive` is `true`. The NDK options (`DetectAndReportCrashNdk`, `CrashNdkIncludeTombstoneLogs` and the Android side of `CrashSignals`) belong to the `bugsee-android-ndk` module, which the package declares in every Android build. @@ -260,6 +260,7 @@ These properties exist on `IOSLaunchOptions` only. An Android launch drops the k | `BuildTarget` | iOS | `string` | none | `config.build-target` | The Xcode target name, reported with the session. | | `BuildType` | iOS | `string` | none | `config.build-type` | The build type (for example debug or release), reported with the session. | | `ReportingUIStyle` | iOS | `ReportingUIStyle` | `System` | `reporting.ui.style` | Look of the report screen. See [ReportingUIStyle](#enums). | + Three iOS keys have no property: `capture.logs.oslog` (the iOS SDK accepts and ignores it), `capture.status-bar-info` (read only by a debug build of the iOS SDK) and `capture.mach-exceptions` (removed from the iOS SDK; use `CrashHandlerType`). :::warning[Privacy options] diff --git a/docs/sdk/unity/feedback.mdx b/docs/sdk/unity/feedback.mdx index aaf2449f..94957eb4 100644 --- a/docs/sdk/unity/feedback.mdx +++ b/docs/sdk/unity/feedback.mdx @@ -40,7 +40,7 @@ If your project declares the Bugsee Android SDK itself (EDM4U, a custom Gradle t ### iOS requirements -The iOS add-on needs iOS 15 or later. +The iOS add-on needs iOS 15 or later. It is not linked when the build uses a local SDK package instead of the published one: the export logs a warning and `Bugsee.Feedback` does nothing in that build. An export that appends to an existing Xcode project with the switch off removes the `feedback-spm` link, including one you added by hand. Keep the define on, or link the package in a target of your own. diff --git a/docs/sdk/unity/issue-detection/crash-report-extension.mdx b/docs/sdk/unity/issue-detection/crash-report-extension.mdx index 1ec55b86..061b81ab 100644 --- a/docs/sdk/unity/issue-detection/crash-report-extension.mdx +++ b/docs/sdk/unity/issue-detection/crash-report-extension.mdx @@ -17,6 +17,12 @@ In a Unity project you do not add the extension by hand. The iOS export adds it The extension needs Xcode 27 or later to build, and a device on iOS 27 or later to run. Only the extension target needs iOS 27: your app keeps its own deployment target. The Simulator never runs the extension. ::: +:::caution[Unity and iOS 27] +Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +::: + +{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} + ## What is reported | Termination | Report | @@ -117,12 +123,12 @@ export BUGSEE_IOS_APP_TOKEN= export BUGSEE_IOS_EARLY_LAUNCH_OPTIONS='{"com.bugsee.option.detect.hang":true}' ``` -Or use the menu **Bugsee > iOS > Early Launch...**, which stores the same three values as an Editor preference per machine. The variables win. The export writes the values into the app's `Info.plist`, with `$` written as `$` so that Xcode does not collapse `$$` and drop internal keys. Nothing is written when early launch is off. +Or use the menu **Bugsee > iOS > Early Launch...**, which stores the same three values as an Editor preference per machine. The variables win. The export writes the values into the app's `Info.plist`, with `$` written as `\u0024` so that Xcode does not collapse `$$` and drop internal keys. Nothing is written when early launch is off. How it behaves: - The native start happens when the app posts the did-finish-launching notification, after Unity's own `didFinishLaunching` returns. -- The first `Bugsee.Launch` with the same token adopts the running session. The `Launching` and `Launched` lifecycle events are delivered once. +- The first `Bugsee.Launch` with the same token adopts the running session. - Options are fixed at build time. Options you pass to `Bugsee.Launch` that differ from the early options are logged as a warning and not applied, and so is a different token. Put what you need into `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS`. - After `Bugsee.Stop`, `Bugsee.Launch` works as it does without early launch. - Early launch does nothing in the Simulator. diff --git a/docs/sdk/unity/lifecycle.mdx b/docs/sdk/unity/lifecycle.mdx index 7c812479..aa55e530 100644 --- a/docs/sdk/unity/lifecycle.mdx +++ b/docs/sdk/unity/lifecycle.mdx @@ -74,7 +74,7 @@ public class BugseeLifecycleExample : MonoBehaviour These calls do not wait for the native SDK. They are handed to the Unity main thread. -- **Android**: a call from another thread is queued and never refused. `Launch`, `Relaunch` and `DeleteCollectedDataOnDevice` run one at a time, in request order. A queued `Launch` replaces earlier queued `Launch` and `Relaunch` requests. A `Relaunch` requested while another `Relaunch` is in flight joins it: it gets that relaunch's outcome, and its own options are ignored (a warning says so). `Stop` is not queued behind the others: it starts at once and drops every queued `Launch` and `Relaunch`. A `Stop` that arrives while a relaunch is stopping, or before its launch has begun, cancels the relaunch, and the relaunch completes `false`. +- **Android**: a call from another thread is queued and never refused. `Launch`, `Relaunch` and `DeleteCollectedDataOnDevice` run one at a time, in request order. A queued `Launch` replaces the queued `Launch` and `Relaunch` requests that follow the last queued `DeleteCollectedDataOnDevice`. A queued `Relaunch` folds its options into the queued `Launch` or `Relaunch` before it. A `Relaunch` requested while another `Relaunch` is in flight joins it: it gets that relaunch's outcome, and its own options are ignored (a warning says so). `Stop` is not queued behind the others: it starts at once and drops every queued `Launch` and `Relaunch`. A `Stop` that arrives while a relaunch is stopping, or before its launch has begun, cancels the relaunch, and the relaunch completes `false`. - **iOS**: a call from another thread waits up to 5 seconds for the main thread to take it. If it does not, the request does not run and an error is logged: `LaunchAsync` and `RelaunchAsync` complete `false`, and `StopAsync` faults with `TimeoutException`. Stops and the delete's wipe run one at a time. A `Launch` or `Relaunch` requested while a stop or a wipe is in flight waits until the SDK reports it finished. A later `Launch` or `Relaunch` replaces the waiting one, and a later `Stop` or `DeleteCollectedDataOnDevice` cancels it. ### Deadlines @@ -111,7 +111,7 @@ In the Unity Editor, `Launch` does nothing: `Status` is `Stopped`, `IsLaunched` `Bugsee.DeleteCollectedDataOnDevice()` stops the SDK if needed, deletes the data it collected on the device, and leaves the SDK stopped. Call `Launch` again to resume. It returns nothing; a failure is only logged. -To get the result, or to delete less, use `DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)`, which returns `Task`, or the synchronous `DeleteCollectedDataOnDevice(DeleteScope scope)`. +To get the result, or to delete less, use `DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)`, which returns `Task`, or `DeleteCollectedDataOnDevice(DeleteScope scope)`, which returns before the data is deleted and has no result. | `DeleteScope` | Deletes | Keeps | | --- | --- | --- | @@ -186,6 +186,8 @@ The constants mirror the Android SDK's list. The native SDKs decide which events If you turned on iOS native early launch at export, the SDK starts at app launch, before the first scene, and the first `Bugsee.Launch` adopts that running session instead of starting a second one. See [iOS build setup](/sdk/unity/build-setup/ios#early-launch). +Known issue: after an iOS launch that died before the app became active, the next launch can block the main thread for up to about 8 seconds. An app that uses early launch can hit it. Details are in the early launch section of the [iOS build setup](/sdk/unity/build-setup/ios#early-launch). + ## Related pages - [Configuration](/sdk/unity/configuration): the launch options. diff --git a/docs/sdk/unity/logs.mdx b/docs/sdk/unity/logs.mdx index 9c7d445e..620de87c 100644 --- a/docs/sdk/unity/logs.mdx +++ b/docs/sdk/unity/logs.mdx @@ -36,7 +36,7 @@ Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [C | Option | Platform | Type | Default | What it does | | --- | --- | --- | --- | --- | | `CaptureLogs` | Both | `bool` | `true` | Capture logs. Unity console lines and, on Android, Logcat are recorded while it is on. | -| `CaptureLogsLevel` | Both | `LogLevel` | `Verbose` | Lines more verbose than this level are dropped. | +| `CaptureLogsLevel` | Both | `LogLevel` | `Verbose` | Lines more verbose than this level are dropped. On Android it applies to the lines the SDK reads from logcat, not to the Unity console lines the package forwards. | | `CaptureLogsUseAllSources` | Android | `bool` | `false` | Read all Logcat buffers (system, radio and others) instead of the default sources. | `LogLevel` has the values `Error` (1), `Warning` (2), `Info` (3), `Debug` (4) and `Verbose` (5). @@ -51,15 +51,15 @@ var options = new AndroidLaunchOptions CaptureLogs = true, CaptureLogsLevel = LogLevel.Info, }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { CaptureLogs = true, CaptureLogsLevel = LogLevel.Info, }; +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` To turn log capture off, set `CaptureLogs = false`. See [Privacy: console logs](/sdk/unity/privacy/logs). @@ -84,7 +84,7 @@ BugseeSdk.Log("Upload failed", LogLevel.Error); - `Bugsee.Log(string message, LogLevel level, bool requiresFiltering)` also runs the line through the filter when `requiresFiltering` is `true`. Use it when the message can hold data that your filter redacts. - Both overloads do nothing for a `null` message or before the SDK is launched. - Lines written with `Bugsee.Log` are recorded, and the ones that opt in are filtered, even with `CaptureLogs` off. -- On iOS, a line below `CaptureLogsLevel` is dropped before it reaches the filter. On Android, `CaptureLogsLevel` applies only to Logcat lines. An opt-in `Debug` line under `CaptureLogsLevel = LogLevel.Error` never reaches the filter on iOS. +- On iOS, a line below `CaptureLogsLevel` is dropped before it reaches the filter. On Android, `CaptureLogsLevel` applies only to Logcat lines and not to the Unity console lines the package forwards. To keep personal data out of forwarded Unity lines, filter them with `SetLogEventFilter`. An opt-in `Debug` line under `CaptureLogsLevel = LogLevel.Error` never reaches the filter on iOS. ## Filter log lines diff --git a/docs/sdk/unity/manual/bug-reporting.mdx b/docs/sdk/unity/manual/bug-reporting.mdx index 8af44da0..5b75929b 100644 --- a/docs/sdk/unity/manual/bug-reporting.mdx +++ b/docs/sdk/unity/manual/bug-reporting.mdx @@ -17,7 +17,7 @@ The snippets on this site call the facade through the alias `using BugseeSdk = B ## Built-in report triggers -Four triggers can open the report dialog. In 7.x all of them are off until you turn them on. The shake trigger and the Android notification-bar trigger were on by default in 6.x. +Four triggers can open the report dialog. In 7.x all of them are off until you turn them on. In 6.x, shake (Android) and the Android notification-bar trigger were on by default. | Option | Platform | Type | Default | What it does | | --- | --- | --- | --- | --- | diff --git a/docs/sdk/unity/manual/crash-error-reporting.mdx b/docs/sdk/unity/manual/crash-error-reporting.mdx index 64a0ebf4..6a107c2a 100644 --- a/docs/sdk/unity/manual/crash-error-reporting.mdx +++ b/docs/sdk/unity/manual/crash-error-reporting.mdx @@ -50,7 +50,7 @@ Options: | --- | --- | --- | --- | --- | | `CaptureManagedExceptions` | Android, iOS | `bool` | `true` | Installs the hooks above. A `Relaunch` applies a changed value. | | `CaptureUnobservedTaskExceptions` | Android, iOS | `bool` | `true` | Reports `TaskScheduler.UnobservedTaskException` as an error. Needs `CaptureManagedExceptions`. | -| `TreatUnityLogExceptionsAsFatal` | Android, iOS | `bool` | `false` | Reports exceptions that Unity logs as crashes instead of errors. | +| `TreatUnityLogExceptionsAsFatal` | Android, iOS | `bool` | `false` | Reports exceptions that Unity logs as crashes instead of errors. A `Relaunch` does not change it while the managed hooks stay installed. | An uncaught exception that Unity logs is reported as an error, because the game keeps running. Set `TreatUnityLogExceptionsAsFatal` to report these as crashes. When a crash report is made on a background thread, the call waits up to 4 seconds for Unity's main thread to take it. @@ -221,6 +221,10 @@ How much of a stack trace Bugsee can resolve to C# class, file and line depends The mapping and symbols are uploaded by the build. See [Symbolication](/sdk/unity/symbolication/overview), and the pages for [Android](/sdk/unity/symbolication/android), [iOS](/sdk/unity/symbolication/ios) and [managed code](/sdk/unity/symbolication/managed-code). +### Limits + +- **IL2CPP, exceptions rethrown through `await`.** For an exception thrown in an async continuation and rethrown where it is awaited, the frames before the line `--- End of stack trace from previous location where exception was thrown ---` carry no address and stay unresolved when the build has no IL2CPP line information. Only the frames after the separator resolve. + ### Known issues These apply to Bugsee Unity SDK 7.0.0-beta.1: @@ -228,7 +232,6 @@ These apply to Bugsee Unity SDK 7.0.0-beta.1: - **Android, Release IL2CPP, Public symbols.** Handled managed exceptions in a Release IL2CPP build without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public (symbol table only). Use Debugging symbols with the il2cpp line map: set **Create symbols.zip** to **Debugging** in Player Settings, use the menu **Bugsee > Android > Use Full Native Symbols (Debugging) For Symbol Upload**, or set `BUGSEE_ANDROID_FULL_SYMBOLS=1`. - **Android, Development IL2CPP.** Development builds send no addresses, and Debugging symbols do not change that. - **Public, then Debugging.** Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation: [bugsee-unity#263](https://github.com/bugsee/bugsee-unity/issues/263). Choose the symbol level before you upload a build. -- **IL2CPP, exceptions rethrown through `await`.** For an exception thrown in an async continuation and rethrown where it is awaited, the frames before the line `--- End of stack trace from previous location where exception was thrown ---` carry no address and stay unresolved when the build has no IL2CPP line information. Only the frames after the separator resolve. ## Test crash reporting diff --git a/docs/sdk/unity/migration.mdx b/docs/sdk/unity/migration.mdx index 8390a00f..99cb02e1 100644 --- a/docs/sdk/unity/migration.mdx +++ b/docs/sdk/unity/migration.mdx @@ -19,7 +19,7 @@ This guide compares Bugsee Unity SDK 6.0.x (the `.unitypackage`, namespace `Bugs ## Before you start -- [ ] Commit or back up your project. The migration deletes the 6.x plugin folder and edits every file that calls Bugsee. +- [ ] Commit or back up your project. The migration deletes the 6.x plugin folders and edits every file that calls Bugsee. - [ ] Read the Beta banner above. 7.0.0-beta.1 can change between betas, and 6.x stays the stable release. - [ ] Install 7.x from the pinned git tag with the Unity Package Manager, as described in [Installation](/sdk/unity/installation). Do not install without the `#v7.0.0-beta.1` part. @@ -30,18 +30,18 @@ This guide compares Bugsee Unity SDK 6.0.x (the `.unitypackage`, namespace `Bugs | | 6.x | 7.x | | --- | --- | --- | | Distribution | `Bugsee.unitypackage`, imported into `Assets` | Unity Package Manager package `com.bugsee.unity`, from a git tag | -| Where the files go | `Assets/Plugins/Bugsee`, with the native binaries `Bugsee-Unity.aar` (Android) and `Bugsee.a` with headers (iOS) inside | `Packages/`, read-only. The package bundles no native binaries. | +| Where the files go | Three folders in `Assets`: `Assets/Plugins/Bugsee` (the scripts), `Assets/Plugins/iOS/Bugsee` (`Bugsee.a`, the headers, `BugseePlugin.m` and `BugseeAgent`) and `Assets/Plugins/Android/Bugsee-Unity.aar` | `Packages/`, read-only. The package bundles no native binaries. | | Native SDKs | Bundled in the plugin folder | Added at build time: Android SDK 7.6.0 through Gradle, iOS SDK 7.1.0 through Swift Package Manager | | Launch | A `BugseeLauncher` component on an object in your first scene, or a call you make yourself | One call, `Launch`, from any script | | Namespace and class | `BugseePlugin`, class `Bugsee` (a `MonoBehaviour`) | Namespace `Bugsee`, static class `Bugsee` | Do these steps in order: -1. Delete the folder `Assets/Plugins/Bugsee`. It holds the 6.x scripts, the AAR and the iOS library. +1. Delete `Assets/Plugins/Bugsee` (the 6.x scripts), `Assets/Plugins/iOS/Bugsee` (the iOS library, headers and `BugseePlugin.m`) and `Assets/Plugins/Android/Bugsee-Unity.aar`. If the old AAR stays, it sits next to the Bugsee Android SDK 7.6.0 that 7.x adds through Maven. 2. Remove the `BugseeLauncher` component from your scene, and the object you created for it, if it has no other use. 3. Remove `gameObject.AddComponent()` from any code that did a manual launch. In 6.x the `Bugsee` class was a component that had to be on a scene object, and the launcher gave that object the name `bgs_gameObject`. In 7.x `Bugsee` is a static class, so `AddComponent()` does not compile, and nothing in your scene is required. The package creates its own helper object, `Bugsee.MainThreadDispatcher`, before the first scene loads. 4. Remove the `BugseeEventsListener` component from your main camera if you added it for GPU information. The 7.x package has no such component. -5. If you edited `Assets/Plugins/BugseeLaunchHandler.cs` or set `BugseeLauncher.AndroidOptionsHandler` and its siblings, move those options into your own launch code (see section 2). +5. If you wrote your own `partial class BugseeLauncher` (in namespace `BugseePlugin`) that set `AndroidOptionsHandler` and `IosOptionsHandler`, delete that file and move its options into your own launch code (see section 2). 6. Add the package from `https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1`. See [Installation](/sdk/unity/installation). The package needs no scoped registry and no custom Gradle template. If your project already uses the External Dependency Manager for other SDKs, it keeps working. See [Android build setup](/sdk/unity/build-setup/android) and [iOS build setup](/sdk/unity/build-setup/ios) for what the package changes in the exported projects. @@ -149,7 +149,7 @@ All 7.x members below are on the static class `Bugsee`, which the examples call | 6.x (`BugseePlugin.Bugsee`) | 7.x | Notes | | --- | --- | --- | -| `Launch(string, BugseeLaunchOptions = null)` and `Launch(string, IDictionary)` | `Launch(string, Dictionary options = null)` | Typed options, `OptionsBuilder` and a dictionary all go to the same parameter. | +| `Launch(string, BugseeLaunchOptions = null)` and `Launch(string, IDictionary)` | `Launch(string, Dictionary options = null)` | Typed options, `OptionsBuilder` and a dictionary all go to the same parameter. It is a `Dictionary`, so pass another `IDictionary` as `new Dictionary(d)`. | | `Relaunch(BugseeLaunchOptions = null)` | `Relaunch(Dictionary options = null)`, `RelaunchAsync` | | | `Stop()` | `Stop(Action completion = null)`, `StopAsync` | | | `ShowReport(summary, description, BugseeSeverityLevel severity = High)` | `ShowReportDialog(summary, description, IssueSeverity? severity = null, IList labels = null)` | Renamed. `null` severity uses `ReportingDefaultBugPriority`. 6.x always sent High. | @@ -159,14 +159,14 @@ All 7.x members below are on the static class `Bugsee`, which the examples call | `Trace(name, object)` | `Trace(name, object)` | Unchanged signature. | | `Log(message, BugseeLogLevel level = Debug)` | `Log(message, LogLevel level = Info)` | The default level is now `Info`. A second overload takes `requiresFiltering`. See [Console logs](/sdk/unity/logs). | | `LogException(Exception)` | `LogException(Exception, IDictionary options = null)` | Source compatible. `LogUnhandledException` is new. | -| `TestExceptionCrash()`, `TestSignalCrash()` | `TestCrash()` | One method, a native crash. | +| `TestExceptionCrash()`, `TestSignalCrash()` | `TestCrash()` | One method. On Android it crashes the app with a Java exception, on iOS it triggers the SDK's test crash. | | `ShowFeedbackUI()`, `SetFeedbackGreetingMessage(string)` | `Feedback.ShowFeedbackUi()`, `Feedback.SetDefaultGreeting(string)` | The feedback chat is an opt-in add-on. See [Feedback](/sdk/unity/feedback). | | `SetAttribute(key, value)` returns `bool` | `SetAttribute(key, value)` returns nothing | Invalid keys and values throw `ArgumentException`. See [User & session data](/sdk/unity/user-session-data). | | `GetAttribute(key)` | `GetAttribute(key)`, `GetAllAttributes()` | Values read back as `string`, `bool`, `long` or `double`. | | `ClearAttribute(key)`, `ClearAllAttributes()` return `bool` | Same names, return nothing | | | `SetEmail`, `GetEmail`, `ClearEmail` | `SetUserIdentifier`, `GetUserIdentifier`, `ClearUserIdentifier` | There is no email API in 7.x. An email address is a valid identifier. For one report, set `IReport.Email`. | | `CaptureViewHierarchy()` | `CaptureViewHierarchy()` | Unchanged. See [View hierarchy](/sdk/unity/view-hierarchy). | -| `AddSecureRect(Rect)`, `RemoveSecureRect(Rect)` return `bool` | `AddSecureRectangle(RectInt)`, `RemoveSecureRectangle(RectInt)`, and `AddSecureScreenRectangle(Rect, displayId)` | The first pair takes native pixels with a top-left origin. The screen variant takes Unity screen space. See [Privacy: Video](/sdk/unity/privacy/video). | +| `AddSecureRect(Rect)`, `RemoveSecureRect(Rect)` return `bool` on iOS and nothing on Android | `AddSecureRectangle(RectInt)`, `RemoveSecureRectangle(RectInt)`, and `AddSecureScreenRectangle(Rect, displayId)` | The first pair takes native pixels with a top-left origin. The screen variant takes Unity screen space. See [Privacy: Video](/sdk/unity/privacy/video). | | `RemoveAllSecureRects()`, `GetAllSecureRects()` returns `Rect[]` | `RemoveAllSecureRectangles()`, `GetAllSecureRectangles()` returns `RectInt[]` | | | `OnAttachmentForReport` event | `SetReportHandler(IReportHandler)` | See 3.3. | | `OnLifecycleEvent` event | `LifecycleEvent` event, `SetLifecycleEventListener` | See 3.4. | @@ -187,13 +187,12 @@ All 7.x members below are on the static class `Bugsee`, which the examples call | `BugseeFrameRate`: `Low`, `Medium`, `High` | `FrameRate`: `Low`, `Medium`, `High`, `Raw` | `Raw` is new and is meaningful for `VideoMode.DirectBuffers` only. | | `BugseeStyle`: `Default` 0, `Dark` 1, `BasedOnStatusBar` 2 | `ReportingUIStyle`: `Light` 0, `Dusk` 1, `BasedOnStatusBar` 2, `System` 3 | The default is now `System`. iOS only. | | `BugseeAndroidVideoMode`: `None`, `V1`, `V2`, `V3`, `V4` | `VideoMode`: `None` 0, `V1` 1, `V2` 2, `Fullscreen` 20, `DirectBuffers` 21 | `V3` and `V4` no longer exist. The 6.x `V2` used MediaProjection and asked the user for consent; in 7.x that is `Fullscreen`. The 7.x `V2` is the Android SDK's default capture engine. See [Video capture](/sdk/unity/video-capture). | -| `BugseeAndroidVideoQuality` | `VideoQuality` | `Default`, `Medium`, `High`. | | `BugseeLifecycleEventType` | Strings in `LifecycleEvents` | See 3.4. | | `BugseeReport`, `BugseeAttachment` structs | `IReport`, `IAttachment` | See 3.3. | ### 3.3 Attachments and the report handler -6.x added attachments by returning a list from the `OnAttachmentForReport` event. In 7.x you register a report handler and call `AddAttachmentBytes` or `AddAttachmentFile` on the report. The handler must call the completion callback. +6.x added attachments by returning a list from the `OnAttachmentForReport` event. In 7.x you register a report handler and call `AddAttachmentBytes` or `AddAttachmentFile` on the report from `OnAfterReportCreated`. Both return `null` when the report refuses the attachment. The handler must call the completion callback. ```csharp // 6.x @@ -215,10 +214,14 @@ public class StateAttachments : ReportHandlerBase public StateAttachments(byte[] stateBytes) { _stateBytes = stateBytes; } - public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) + public override void OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback) { IAttachment attachment = report.AddAttachmentBytes(_stateBytes, "state", "application/json"); - attachment.Filename = "state.json"; + if (attachment != null) + { + attachment.Filename = "state.json"; + } + completionCallback?.Invoke(); } } @@ -286,14 +289,13 @@ The tables list the 6.x property, its 7.x counterpart and both defaults. 6.x def | `NotificationBarTrigger` | Android | `ReportingTriggerByNotification` | `true` | `false` | | `ScreenshotToReport` | Both | `ReportingTriggerByScreenshot` | Android `false`, iOS `true` | `false` | | `CrashReport` | Both | `DetectAndReportCrash` | `true` | `true` | -| `DetectAppExit` | Both | `DetectAndReportExit` | `false` | `true` | +| `DetectAppExit` | Both | `DetectAndReportExit`, a typed property on `AndroidLaunchOptions` only. On iOS use `SetCustomOption(Options.DetectAndReportExit, value)`. | `false` | `true` | | `MaxNetworkBodySize` | Both | `CaptureNetworkBodySizeLimit` | `20480` | `20480` | | `MonitorNetwork` | Both | `CaptureNetwork` | `true` | `true` | | `RecordHttpBodyWithoutType` | Android | `CaptureNetworkBodyWithoutType` | not set | `false` | | `VideoEnabled` | Both | `CaptureVideo` | `true` | `true` | | `VideoScale` | Both | `CaptureVideoScale` | Android `1.0`, iOS `0` (not used) | `1` | | `FrameRate` | Both | `CaptureVideoFrameRate` | `High` | `High` | -| `VideoQuality` | Android | `CaptureVideoQuality` | `Default` | `Default` | | `VideoMode` | Android | `CaptureVideoMode` | `V3` | `V2` | | `CaptureLogs` | Both | `CaptureLogs` | `true` | `true` | | `LogLevel` | Android | `CaptureLogsLevel`, now on both platforms | `Verbose` | `Verbose` | @@ -336,7 +338,7 @@ These 6.x options have no property in 7.x and no key in the native option manife ### 4.3 Options that are new in 7.x -7.x types many options that 6.x did not have, among them hang, early-crash, HTTP-error, anomaly and frustration detection, breadcrumbs, performance monitoring, pending-report limits, screenshot scale, `CrashSignals`, `CaptureManagedExceptions` and the iOS capture switches. They are in [Configuration](/sdk/unity/configuration). +7.x types many options that 6.x did not have, among them hang, early-crash, HTTP-error, anomaly and frustration detection, breadcrumbs, performance monitoring, pending-report limits, screenshot scale, `CrashSignals`, `CaptureManagedExceptions`, `CaptureVideoQuality` (with the `VideoQuality` enum) and the iOS capture switches. They are in [Configuration](/sdk/unity/configuration). ## 5. Behavior changes @@ -349,7 +351,7 @@ Several options start with another value than they did in 6.x. The table in 4.1 - **The iOS screenshot trigger is off.** The 6.x iOS wrapper had it on. Set `ReportingTriggerByScreenshot = true` to keep it. - **`MaxDataSize` is 150 MB, not 50.** - **View hierarchy capture is on.** The 6.x wrapper had it off. -- **Exit detection is on.** Application exits (on Android, the reasons of `ApplicationExitInfo`; on iOS, out-of-memory kills) are reported unless you set `DetectAndReportExit = false`. +- **Exit detection is on.** Application exits (on Android, the reasons of `ApplicationExitInfo`; on iOS, out-of-memory kills) are reported unless you switch them off. On Android set `DetectAndReportExit = false`. On iOS call `options.SetCustomOption(Options.DetectAndReportExit, false)`. - **Early-crash handling is on.** The 6.x iOS option `AppLaunchCrashDetection` was off. - **The default bug severity on iOS is `High`.** It was `Low` in the 6.x options. - **The Android video mode default is `V2`** (the SDK's default capture engine), where 6.x used `V3`. @@ -400,7 +402,7 @@ The client signature of a managed exception changed too. 6.x hashed the exceptio ## 8. Migration checklist -- [ ] Delete `Assets/Plugins/Bugsee`, the `BugseeLauncher` component, any `AddComponent()` call and the `BugseeEventsListener` component. +- [ ] Delete `Assets/Plugins/Bugsee`, `Assets/Plugins/iOS/Bugsee` and `Assets/Plugins/Android/Bugsee-Unity.aar`, the `BugseeLauncher` component, any `AddComponent()` call and the `BugseeEventsListener` component. - [ ] Add `com.bugsee.unity` from `https://github.com/bugsee/bugsee-unity.git#v7.0.0-beta.1`. - [ ] Replace `using BugseePlugin;` with `using Bugsee.Contracts.Options;` (and the other namespaces you need) and `using BugseeSdk = Bugsee.Bugsee;`. - [ ] Port the launch to `BugseeSdk.Launch(token, options)` with `AndroidLaunchOptions` or `IOSLaunchOptions`. @@ -410,6 +412,6 @@ The client signature of a managed exception changed too. 6.x hashed the exceptio - [ ] Replace `OnAttachmentForReport` with a report handler and `OnLifecycleEvent` with `LifecycleEvent`. - [ ] Replace the appearance properties with `SetColor` and `SetString`. - [ ] Fix attribute reads that unbox to `int` or `float`. -- [ ] Decide `CaptureManagedExceptions`, `DetectAndReportExit` and `MaxDataSize` on purpose; they changed. +- [ ] Decide `CaptureManagedExceptions`, `DetectAndReportExit` (on iOS through `SetCustomOption`) and `MaxDataSize` on purpose; they changed. - [ ] Set `BUGSEE_APP_TOKEN` in your build environment if you want symbols uploaded. - [ ] Build for a device, send a report with `ShowReportDialog` and a crash with `TestCrash`, and check both in the dashboard. See [Installation](/sdk/unity/installation#check-that-it-works). diff --git a/docs/sdk/unity/network.mdx b/docs/sdk/unity/network.mdx index 502aed0e..c8f32dd2 100644 --- a/docs/sdk/unity/network.mdx +++ b/docs/sdk/unity/network.mdx @@ -50,6 +50,7 @@ var options = new AndroidLaunchOptions CaptureNetworkBodySizeLimit = 64 * 1024, CaptureNetworkOnLaunch = true, }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { @@ -57,9 +58,8 @@ var options = new IOSLaunchOptions CaptureNetworkBodySizeLimit = 64 * 1024, }; options.SetCustomOption(Options.CaptureNetworkOnLaunch, true); +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` To turn network capture off, set `CaptureNetwork = false`. See [Privacy: network](/sdk/unity/privacy/network). @@ -164,7 +164,7 @@ BugseeSdk.SetNetworkEventFilter(e => Keep these rules in mind: - **Do not keep the event.** The event is valid only inside the callback. Using it afterward throws `ObjectDisposedException` on Android. -- **Assign `Headers` back.** On Android, `Headers` returns a copy, so editing the returned dictionary in place does not change the event. Assign the edited dictionary to `e.Headers`. +- **Assign `Headers` back.** On Android, `Headers` returns a copy, so editing the returned dictionary in place does not change the event. On iOS it is live. Assign the edited dictionary to `e.Headers` on both. - **A filter that throws drops the event.** The SDK records nothing for that event. - **The filter runs on the Unity main thread.** On Android the SDK calls it on its own threads and the package hands each call to the main thread, which processes its queue in `Update`. While the app is in the background Unity's loop is paused, so the call waits until the app resumes. - **A filter that blocks forever blocks the main thread.** Keep it short. @@ -184,7 +184,7 @@ BugseeSdk.SetNetworkEventFilter(e => // rather than record it unredacted. if (!BugseeSdk.ApplyDefaultNetworkSanitizer(e)) return null; - e.Url = e.Url.Replace("/internal/", "/x/"); + if (e.Url != null) e.Url = e.Url.Replace("/internal/", "/x/"); return e; }); ``` diff --git a/docs/sdk/unity/overview.mdx b/docs/sdk/unity/overview.mdx index b8b68094..1d621766 100644 --- a/docs/sdk/unity/overview.mdx +++ b/docs/sdk/unity/overview.mdx @@ -35,6 +35,12 @@ The SDK turns problems into reports automatically: - **Out-of-memory exits on iOS 27 and later**, through the Crash Report Extension that the iOS export can add. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension). - **Manual reports**: open the report dialog or upload a report from code. Shake-to-report is off by default. See [Bug reporting](/sdk/unity/manual/bug-reporting). +:::caution[Unity and iOS 27] +Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +::: + +{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} + ## How it works - **One package.** You install `com.bugsee.unity` from a git tag. There is no scoped registry, no dependency-resolve step and no custom Gradle template. See [Installation](/sdk/unity/installation). diff --git a/docs/sdk/unity/performance.mdx b/docs/sdk/unity/performance.mdx index 2e5197e9..d2398084 100644 --- a/docs/sdk/unity/performance.mdx +++ b/docs/sdk/unity/performance.mdx @@ -27,11 +27,11 @@ In the Unity Editor, and on platforms other than Android and iOS, `StartTransact ```csharp using System.Collections.Generic; using Bugsee.Contracts.Apm; +using BugseeSdk = Bugsee.Bugsee; using (var checkout = BugseeSdk.StartTransaction( "checkout", "user.flow", new Dictionary { ["cart"] = 3 })) using (var pay = checkout.StartChild("payment", "charge card")) -using BugseeSdk = Bugsee.Bugsee; { pay.SetAttribute("provider", "example-pay"); // ... do the work ... @@ -91,7 +91,7 @@ Set these launch options on `AndroidLaunchOptions` or `IOSLaunchOptions`. See [C | `PerformanceAdaptiveSampling` | Both | `bool` | `true` | Promote transactions that lost the random draw into the standalone upload, based on their status, duration and span-tree complexity. | | `PerformanceUploadMode` | Android | `string` | `"batched"` | How sampled transactions are uploaded: `"batched"` or `"realtime"`. The package drops it before an iOS launch. | -Every transaction goes into reports, whatever the sampling options say. Sampling affects only the standalone upload. What that upload does is defined by the native SDKs. See [Android performance](/sdk/android/performance#sampling-and-upload-modes) and [iOS performance](/sdk/ios/performance#sampling). +Every transaction goes into reports, whatever the sampling options say. Sampling affects only the standalone upload. On iOS the standalone upload is not active yet, so `PerformanceSampleRate` and `PerformanceAdaptiveSampling` have no effect there. What that upload does is defined by the native SDKs. See [Android performance](/sdk/android/performance#sampling-and-upload-modes) and [iOS performance](/sdk/ios/performance#sampling). ```csharp using Bugsee.Contracts.Options; @@ -103,15 +103,15 @@ var options = new AndroidLaunchOptions PerformanceMonitoring = true, PerformanceSampleRate = 0.1f, }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { PerformanceMonitoring = true, PerformanceSampleRate = 0.1f, }; +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` ## Related pages diff --git a/docs/sdk/unity/privacy/cleanup.md b/docs/sdk/unity/privacy/cleanup.md index a3b77750..032dc52e 100644 --- a/docs/sdk/unity/privacy/cleanup.md +++ b/docs/sdk/unity/privacy/cleanup.md @@ -45,7 +45,7 @@ In 7.x, `DeleteCollectedDataOnDevice` on Android also deletes the finished repor On iOS, the two narrower scopes keep the crashes that are not reported yet, so the next launch can still report them. On Android, the scopes map to `includingIntermediate` and `includingBundles` of the native call. See the native pages for the details. -Pass the scope to the synchronous overload or to the async one: +Pass the scope to the overload that returns nothing or to the async one: ```csharp using System.Threading.Tasks; @@ -68,6 +68,7 @@ public static class UserData public static void ForgetCaptureOnly() { + // Returns before the data is deleted. Use the async form to wait for it. BugseeSdk.DeleteCollectedDataOnDevice(DeleteScope.CaptureOnly); } } diff --git a/docs/sdk/unity/privacy/logs.md b/docs/sdk/unity/privacy/logs.md index f43df446..b776a516 100644 --- a/docs/sdk/unity/privacy/logs.md +++ b/docs/sdk/unity/privacy/logs.md @@ -9,7 +9,7 @@ slug: "/sdk/unity/privacy/logs" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -Log lines often carry more than you meant to share: a token in a URL, an e-mail address in a debug message, a payload dumped while a feature was being built. Bugsee records the Unity console output, the native logs of the app, and the lines you send with `Bugsee.Log`. See [Console logs](/sdk/unity/logs) for where each comes from. This page covers how to keep sensitive data out of them. +Log lines often carry more than you meant to share: a token in a URL, an email address in a debug message, a payload dumped while a feature was being built. Bugsee records the Unity console output, the native logs of the app, and the lines you send with `Bugsee.Log`. See [Console logs](/sdk/unity/logs) for where each comes from. This page covers how to keep sensitive data out of them. The filter and the options forward to the native SDKs. For their behavior, see [Android log privacy](/sdk/android/privacy/logs) and [iOS log privacy](/sdk/ios/privacy/logs). @@ -50,7 +50,7 @@ The Unity log and logcat both need `CaptureLogs`. | Platform | `CaptureLogsLevel` applies to | | --- | --- | -| Android | The lines the SDK reads from logcat. It does not apply to the lines you send with `Bugsee.Log`, which are recorded whatever their level. | +| Android | The lines the SDK reads from logcat. It does not apply to the lines you send with `Bugsee.Log`, which are recorded whatever their level, or to the Unity console lines the package forwards. To keep personal data out of those, use a log filter. | | iOS | Every line the SDK records, including the lines you send with `Bugsee.Log`. | To keep a particular line out of a report whatever the level, use a log filter. @@ -132,7 +132,7 @@ public static class SafeLog - The `level` default of `Bugsee.Log(string, LogLevel)` is `LogLevel.Info`. - A line you send with `requiresFiltering` set to `true` is filtered even with `CaptureLogs` off. -- On iOS, a line below `CaptureLogsLevel` never reaches the filter. On Android, the level applies only to the logcat lines. +- On iOS, a line below `CaptureLogsLevel` never reaches the filter. On Android, the level applies only to the logcat lines, not to the Unity console lines the package forwards. - Do not call `Bugsee.Log(..., true)` from inside the log filter. On Android the filter runs during the call, so it recurses. - The call does nothing for a null message, and before the SDK is launched. diff --git a/docs/sdk/unity/privacy/network.mdx b/docs/sdk/unity/privacy/network.mdx index a08ec485..edefb8df 100644 --- a/docs/sdk/unity/privacy/network.mdx +++ b/docs/sdk/unity/privacy/network.mdx @@ -66,7 +66,7 @@ An `INetworkEvent` exposes these fields: | --- | --- | | `Url`, `Body`, `Size`, `ResponseCode`, `StatusText`, `ErrorShortMessage`, `ErrorDescription`, `Headers`, `IsOverride` (Android only) | `Id`, `Mechanism`, `Method`, `Stage` | -The error texts can quote a URL, so redact them too if your URLs carry secrets. `Headers` returns a copy: assign the dictionary back to `Headers` after you change it. +The error texts can quote a URL, so redact them too if your URLs carry secrets. On Android, `Headers` returns a copy, and on iOS it is live. Assign the dictionary back to `Headers` after you change it on both. ```csharp using System; diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index 5fcc5848..a5f9470d 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -54,6 +54,8 @@ These options are off by default. Each one records data you may not want in a re :::warning[iOS early launch starts before your consent check] If you turn on the optional iOS early launch at build time, the iOS SDK starts natively before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for user consent. See [iOS build setup](/sdk/unity/build-setup/ios). + +With early launch, options you pass to `Bugsee.Launch` that differ from the early options are logged and not applied. A privacy option you set in C#, such as `CaptureNetwork = false` or `CaptureLogs = false`, is ignored: put it in the early launch options. Filters and the report handler are set from C# later, so what the SDK captures before you set them is not filtered. ::: The optional iOS [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) is a separate component. Read its page before you add it to an app that asks for consent. @@ -82,8 +84,9 @@ Two features send data without a report, and only when your app calls them: - **Install filters and the report handler before `Bugsee.Launch`.** A filter applies to what is recorded after you set it. Set the log, network and breadcrumb filters and the report handler at the top of your startup code. - **Filters and the report handler run on the Unity main thread.** The native SDKs can call them on other threads, and the package hands each call to the main thread. While the app is in the background, Unity's loop is paused, and filter calls wait until it resumes. - **A filter that throws drops the event.** The package drops an event when your filter throws an exception. It does not record the event unfiltered. +- **A report handler that throws does not drop the report.** The package logs the exception and the report continues without your edits (on iOS every edit except a screenshot change is dropped). A redaction handler that throws uploads the report unredacted. Catch exceptions inside the handler and call `completionCallback()` in a `finally` block. See [Privacy: Report](/sdk/unity/privacy/report). - **A network filter turns the built-in network redaction off.** Run `Bugsee.ApplyDefaultNetworkSanitizer` first in your filter to keep it. See [Privacy: Network](/sdk/unity/privacy/network). -- **The report handler is not a redaction boundary for every report.** It is skipped for a report that is created while the process is terminating, and it cannot remove the video, the logs or the network traffic from a report. See [Privacy: Report](/sdk/unity/privacy/report). +- **The report handler is not a redaction boundary for every report.** It is skipped for a report that is created while the process is terminating, it uploads the report unredacted if it throws, and it cannot remove the video, the logs or the network traffic from a report. See [Privacy: Report](/sdk/unity/privacy/report). - **Secure rectangles cover Unity content.** Unity draws its UI itself, so the native secure views and the automatic masking of native password fields do not know your Unity elements. Register a rectangle for each one. See [Privacy: Video](/sdk/unity/privacy/video). ## Native references diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md index 296aa3e4..d819bf3b 100644 --- a/docs/sdk/unity/privacy/report.md +++ b/docs/sdk/unity/privacy/report.md @@ -33,7 +33,7 @@ A report bundles what the SDK recorded with what the user or your code put into - `OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback)` - `OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback)` -Derive from `ReportHandlerBase` and override what you need. Each method must call `completionCallback()` when it is done. The `IReport` you receive is the report itself: what you change is what is uploaded. +Derive from `ReportHandlerBase` and override what you need. Each method must call `completionCallback()` when it is done. The `IReport` you receive is the report: when the handler finishes, the changes you made are what is uploaded. | You can | With | | --- | --- | @@ -57,14 +57,14 @@ public sealed class RedactingReportHandler : ReportHandlerBase public override void OnBeforeReportCreated(IReport report, bool isTerminating, Action completionCallback) { - Redact(report); - completionCallback(); + try { Redact(report); } + finally { completionCallback(); } } public override void OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback) { - Redact(report); - completionCallback(); + try { Redact(report); } + finally { completionCallback(); } } static void Redact(IReport report) @@ -97,6 +97,7 @@ What to know: - **The handler runs on the Unity main thread, inside its turn.** Do the redaction there, keep it short, and call `completionCallback()` when you are done. - **The SDK does not wait indefinitely.** The native SDK carries on with the report unchanged after the handler timeout, 30 seconds by default. A before-phase handler that only gets to run after that is skipped. On Android, the `ReportHandlerCallbackTimeout` launch option sets the timeout. The iOS SDK does not read that option. While the app is in the background, Unity's loop is paused, and the handler waits until it resumes. - **The handler is skipped for a report that is created while the process is terminating.** When `isTerminating` is `true`, the package acknowledges the native SDK at once and does not call your handler. Do not rely on the handler to redact those reports. Keep the data out where it is recorded: mask it on screen, or drop it in a filter. +- **A handler that throws uploads the report unredacted.** The package logs the exception and the report continues without your edits. On iOS every edit except a screenshot change is dropped. A filter differs: a filter that throws drops the event. Catch exceptions inside the handler and call `completionCallback()` in a `finally` block, as the example does. - **Edits after the handler's turn are not applied.** Do not keep the `IReport` and change it later. - **The handler cannot remove the video, the logs or the network traffic from a report.** Use the capture options and the filters. - **A report from `Bugsee.CreateReport`.** `IReport.Email` set on a report from `Bugsee.CreateReport` is used on Android. On iOS it is dropped with a warning, because the managed upload cannot carry it. Use `Bugsee.SetUserIdentifier` there. diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx index a76bb2a3..cb8d1ba6 100644 --- a/docs/sdk/unity/privacy/video.mdx +++ b/docs/sdk/unity/privacy/video.mdx @@ -136,6 +136,8 @@ Remove a rectangle with `Bugsee.RemoveSecureRectangle(RectInt)`, passing the sam The [view hierarchy](/sdk/unity/view-hierarchy) of a report is the Unity scene tree. A node of that tree whose box overlaps a secure rectangle loses its name and its component list. The node keeps its class name and its bounds. A node whose bounds cannot be placed counts as covered while any rectangle is registered. The tree never contains the text of a label or an input field. +The test compares the node boxes, which are in Unity's render pixels, with the rectangles as registered, in native pixels. It is exact only when Unity renders at the native resolution and fills the screen. With Resolution Scaling, `Screen.SetResolution` or a surface that is offset in the window, a node under a rectangle can keep its name and components. If the names of your GameObjects must not reach Bugsee, set `CaptureViewHierarchy = false`, which turns the view hierarchy capture off. + ## WebView secure views If your app embeds a native WebView through a WebView plugin, mark it with `Bugsee.AddSecureWebView` so that its area is hidden in the video. Pass the native handle of the WebView, which the plugin must expose: an `AndroidJavaObject` holding the `android.webkit.WebView` on Android, and an `IntPtr` to the `WKWebView` on iOS. The call returns `false` for a null or zero handle, for an object that is not a WebView, and in the Editor. @@ -171,6 +173,10 @@ For what the native SDKs hide inside a page, see [Android WebView](/sdk/android/ On Android, the SDK blanks a window that carries the system `FLAG_SECURE` flag, without any Bugsee call. The `CaptureRespectFlagSecure` option controls this on `AndroidLaunchOptions`. It is on by default. Set it to `false` if your app marks windows `FLAG_SECURE` broadly and you want them recorded. See [Android video privacy](/sdk/android/privacy/video). +:::caution[The frame pusher does not honor FLAG_SECURE] +With `VideoMode.DirectBuffers`, the experimental [frame pusher](/sdk/unity/video-capture) records Unity's surface even when its window carries `FLAG_SECURE`. The package has no `FLAG_SECURE` handling for pushed frames, and the SDK does not mask them. Use secure rectangles or a blackout for what must stay out of the video. +::: + ## Blackout Blackout blanks the capture for as long as you need it. The calls forward to the native SDKs. diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index 50766141..28ecb892 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -13,7 +13,7 @@ Release history for Bugsee Unity SDK 7.x, the package `com.bugsee.unity`. Lookin Each release lists the native SDKs it is built on. Their own changes are in the native SDK release notes: [Android](/sdk/android/release-notes) and [iOS](/sdk/ios/release-notes). -## 7.0.0-beta.1 (November 23 2026) +## 7.0.0-beta.1 (November 23, 2026) The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API, built on Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. @@ -40,8 +40,7 @@ The [migration guide](/sdk/unity/migration) lists every change from 6.x, with th **Added** -- **`CrashSignals` reaches Android.** It is a shared launch option now (it was iOS only). On Android it is read by the NDK module. A mask meant only for iOS, such as `CrashSignals.None`, also narrows native signal capture on Android: leave it out of the Android options to keep every signal. -- **`DeleteScope` and `DeleteCollectedDataOnDeviceAsync`.** `Bugsee.DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)` returns a `Task`, and `DeleteCollectedDataOnDevice(DeleteScope scope)` is the synchronous form. On Android, `DeleteCollectedDataOnDevice()` also deletes finished reports that were not uploaded yet, and stops the SDK first. Use `DeleteScope.CaptureAndIntermediate` to keep them. See [Lifecycle & status](/sdk/unity/lifecycle#delete-collected-data). +- **`DeleteScope` and `DeleteCollectedDataOnDeviceAsync`.** `Bugsee.DeleteCollectedDataOnDeviceAsync(DeleteScope scope = DeleteScope.Everything)` returns a `Task`, and `DeleteCollectedDataOnDevice(DeleteScope scope)` is the fire-and-forget form: it returns before the data is deleted and has no result, and a failure is only logged. Use `DeleteCollectedDataOnDeviceAsync` when you need to know that the delete finished. On Android, `DeleteCollectedDataOnDevice()` also deletes finished reports that were not uploaded yet, and stops the SDK first. Use `DeleteScope.CaptureAndIntermediate` to keep them. See [Lifecycle & status](/sdk/unity/lifecycle#delete-collected-data). - **`IReport.Severity` is `IssueSeverity?`.** `null` is unset. - **Typed options.** Android options such as `MaxDataSize` and iOS options such as `CrashSignals`, `CaptureOnDeviceSymbolication`, `CrashSwiftAsyncStackTraces`, `CrashFillEmptyExceptionStacks` and `CaptureWebSocket` have typed properties and `Options` constants. They were reachable only through `SetCustomOption`. - **`CaptureUnobservedTaskExceptions`.** A Unity-only option, `true` by default, that needs `CaptureManagedExceptions`. Set it to `false` to stop reporting `TaskScheduler.UnobservedTaskException` as a handled error. @@ -52,10 +51,11 @@ The [migration guide](/sdk/unity/migration) lists every change from 6.x, with th **Changed** +- **`CrashSignals` reaches Android.** It is a shared launch option with a typed property. Before, the iOS key was reachable only through `SetCustomOption` and was not sent to Android. On Android it is read by the NDK module. A mask meant only for iOS, such as `CrashSignals.None`, also narrows or switches off native signal capture on Android when the NDK module is present, for example when iOS and Android share one options object. Leave it out of the Android options to keep every signal. See [Configuration](/sdk/unity/configuration#crashsignals). - **Native SDKs moved to Android SDK 7.6.0 and iOS SDK 7.1.0.** Their option defaults changed: see the shake and notification-bar item under Breaking changes. - **Feedback is opt-in and works when on.** Add the scripting define `BUGSEE_FEEDBACK` (or set the environment variable `BUGSEE_FEEDBACK=1` for the export) to link the feedback add-on. See [Feedback](/sdk/unity/feedback). - **Android symbols.** The Editor's upload of Unity's `symbols.zip` now gives `libunity.so`, `libil2cpp.so` and `libmain.so` the unwind tables that Unity strips from that copy, taken from the same-build-id libraries in the built APK or AAB. -- **Android launch and iOS launch options** are checked against the option manifests the native SDKs publish. +- **Option constants.** The package's tests check the `Options` constants against the option manifests that the native SDKs publish. - **`Relaunch` and `RelaunchAsync` replace the whole option set** on both platforms. Pass the full set again. See [Lifecycle & status](/sdk/unity/lifecycle). - **Breadcrumbs and log lines.** `CaptureBreadcrumbs` is off by default on both native SDKs, so `Bugsee.AddBreadcrumb` records nothing until you set it. `Bugsee.Log(message, level)` lines skip the log filter on both platforms. - **`ResetVideoCapturePermission()` on iOS** logs a warning once, because iOS has no capture permission to reset. @@ -75,7 +75,7 @@ The [migration guide](/sdk/unity/migration) lists every change from 6.x, with th - Android, Windows: a build output under a path over 260 characters no longer breaks the symbol upload's reads or uploads a mapping under a wrong build id. - The Bugsee Editor assembly compiles in an Editor without iOS Build Support. - The build-output scans no longer stop at one bad folder or hide it silently. -- `BUGSEE_NO_SYMBOL_UPLOAD` also turns off the IL2CPP line map upload, on iOS as well, as it does for the R8 mapping and native symbol uploads. +- iOS: `BUGSEE_NO_SYMBOL_UPLOAD` also turns off the IL2CPP line map upload, as it does for the R8 mapping and native symbol uploads. Before, the line map upload ran when a token was set even with the switch set. - The symbol upload also sends the native libraries that Unity's `symbols.zip` does not hold, when they are the build's own and still carry symbols. - The client signature of a managed exception no longer depends on the Java call site on Android, and is the same recipe on both platforms. - `Bugsee.Trace` with a map, list or array records the same JSON on both platforms (at most 8192 UTF-16 units). On Android, maps, lists and arrays you pass to the SDK are sent as JSON text and not as their type name. diff --git a/docs/sdk/unity/symbolication/android.mdx b/docs/sdk/unity/symbolication/android.mdx index 0240184b..ba4fa531 100644 --- a/docs/sdk/unity/symbolication/android.mdx +++ b/docs/sdk/unity/symbolication/android.mdx @@ -25,7 +25,7 @@ When `BUGSEE_APP_TOKEN` is set in the Editor's environment and `BUGSEE_NO_SYMBOL The last two are covered in [Symbolication: C# code](/sdk/unity/symbolication/managed-code). A library that carries only dynamic symbols is not uploaded. That includes the Bugsee SDK's own native libraries and most third-party AARs, so a frame inside such a library stays a module name and an offset. -The upload never fails the build. A missing token, a missing CLI or a failed upload logs a warning and the build continues. +The upload never fails the build. A missing CLI or a failed upload logs a warning and the build continues. With no token the Android build uploads nothing and prints no warning. It logs an info line when an R8 mapping exists that was not uploaded. ## Public and Debugging symbols @@ -57,7 +57,7 @@ The Debugging symbols file is larger than the Public one. The build warning ment - Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public. Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. - Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). Choose the symbol level before the first upload of a build, or change the code so the build id changes. -The server skips a symbol it already has for a build id, and the CLI replaces a symbol table with debug information for the same build id only from CLI 0.8.1. See [Uploading debug information files](/cli/debug-files#native-elf). The package never passes `--force`. +The server skips a symbol it already has for a build id. For how the CLI upgrades a symbol table to debug information for the same build id, see [Uploading debug information files](/cli/debug-files#native-elf). The package never passes `--force`. ## Unwind data for the Android 11 minidump path @@ -77,7 +77,7 @@ The package patches the generated Gradle project; you do not add a Gradle templa | Unity and Android Gradle plugin (AGP) | What the package does | | --- | --- | | Unity 6 with AGP 8.6 or newer | Applies the Bugsee Gradle plugin 4.1.1 with `ndk { enabled = true }`. | -| AGP below 8.6, for example Unity 2021.3 and 2022.3 | Does not apply the plugin, which needs AGP 8.6 or newer. On AGP 7.4.x and 8.0 to 8.5 it adds a small build-id block to the launcher instead. | +| AGP below 8.6, for example Unity 2021.3 and 2022.3 | Does not apply the plugin, which needs AGP 8.6 or newer. On AGP 7.4.x and 8.0 to 8.5 it adds a small build-id block to a Groovy launcher file instead (none for a Kotlin DSL launcher). | In a build the Editor runs itself, the Gradle plugin finds no app token (the app gets its token from `Bugsee.Launch`), so its own uploads skip. The Editor's uploads in the table above do the work for every Unity version. See [Android build setup](/sdk/unity/build-setup/android) for the Player Settings checklist and the Gradle file layouts the patching understands. diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index 196ccfa7..51f331d7 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -22,7 +22,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | `BUGSEE_APP_TOKEN` | Android, iOS | Unset | Turns the symbol upload on. The Editor uses it after an Android build. The iOS Run Script reads it from the Xcode environment. In an Export Project, the Gradle plugin reads it from the Gradle build's environment. | | `BUGSEE_NO_SYMBOL_UPLOAD` | Android, iOS | Unset | Flag. Turns every symbol upload off, including the Run Script's and the Gradle plugin's in an exported project, even with a token. | | `BUGSEE_ENDPOINT` | Android, iOS | The CLI's own default, `https://api.bugsee.com` | The Bugsee API endpoint that `bugsee-cli` uploads to. The Editor passes it to the CLI. The Gradle plugin of an exported project reads it too. | -| `BUGSEE_VERSION` | Android, iOS | Player Settings **Version** (`0.0.0` if empty) on Android; the built app's `Info.plist` on iOS | The app version the upload carries. On iOS, the Run Script reads it from the Xcode environment. | +| `BUGSEE_VERSION` | Android, iOS | Player Settings **Version** on Android; the built app's `Info.plist` on iOS | The app version the upload carries. On iOS, the Run Script reads it from the Xcode environment. | | `BUGSEE_BUILD` | Android, iOS | The Android version code; the iOS build number, else a UTC timestamp (`yyyyMMddHHmmss`) from the Editor; the built app's `Info.plist` for the Run Script | The build number the upload carries. On iOS, the Run Script reads it from the Xcode environment. | | `BUGSEE_BUILD_UUID` | Android | Unset | The build id of the app. For the R8 mapping it is used only when the built app has no `bugsee_build_id.properties` and the value is a UUID. Any non-empty value keys the native symbols upload. It never overrides the id the app carries. | | `BUGSEE_NO_TOKEN_CHECK` | Android, iOS | Unset | Flag. Records no token fingerprint in the build, so `Bugsee.Launch` never warns about a different token. On iOS, set it in the Xcode environment. See [the build token and the launch token](/sdk/unity/symbolication/overview#the-build-token-and-the-launch-token). | @@ -61,7 +61,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | `BUGSEE_FEEDBACK` | Android, iOS | Unset | Set to `1` or `true` in the Editor process that exports the build to link the Feedback add-on. Adding the scripting define `BUGSEE_FEEDBACK` in Player Settings does the same. See [Feedback](/sdk/unity/feedback). | | `BUGSEE_IOS_CRASH_EXTENSION` | iOS | Auto | `auto`, `1` (also `on`, `true`, `yes`, `enable`, `enabled`) or `0` (also `off`, `false`, `no`, `disable`, `disabled`). Any other value means auto. Overrides the **Bugsee > iOS > Crash Report Extension** menu. See [Crash report extension](/sdk/unity/issue-detection/crash-report-extension). | | `BUGSEE_IOS_APP_GROUP` | iOS | `group.` | The App Group id of the Crash Report Extension. It wins over `BugseeIosCrashExtensionPostProcess.AppGroupOverride` set in a build script. | -| `BUGSEE_IOS_EARLY_LAUNCH` | iOS | Off | `1` (also `on`, `true`, `yes`) turns native early launch on. Any other value is off. Overrides the Early Launch window. See [Issue detection](/sdk/unity/issue-detection/overview). | +| `BUGSEE_IOS_EARLY_LAUNCH` | iOS | Off | `1` (also `on`, `true`, `yes`) turns native early launch on. Any other value is off. Overrides the Early Launch window. With early launch on, the SDK starts before any consent check of yours, and the next launch after an iOS launch that died before the app was active can block the main thread for up to about 8 seconds. See [Early launch](/sdk/unity/build-setup/ios#early-launch). | | `BUGSEE_IOS_APP_TOKEN` | iOS | Unset | The iOS app token that early launch writes into the app's `Info.plist`. Overrides the Early Launch window. | | `BUGSEE_IOS_EARLY_LAUNCH_OPTIONS` | iOS | Unset | A JSON object of launch options, with the same keys as the C# options, for the early session. Overrides the Early Launch window. | diff --git a/docs/sdk/unity/symbolication/ios.mdx b/docs/sdk/unity/symbolication/ios.mdx index 69df251c..1fd9bc03 100644 --- a/docs/sdk/unity/symbolication/ios.mdx +++ b/docs/sdk/unity/symbolication/ios.mdx @@ -28,7 +28,7 @@ The script never fails your build. It reports each problem as a `warning:` line Set `BUGSEE_APP_TOKEN` where Xcode runs the build. The export never writes the token into the project. A build started from the Xcode GUI does not see your shell's environment, so use one of these: -- **The environment (preferred).** In CI or Xcode Cloud, set it in the job. Locally, run `export BUGSEE_APP_TOKEN=...` before `xcodebuild`, or `launchctl setenv BUGSEE_APP_TOKEN ...` and restart Xcode. A plain environment variable is not printed into the build log. +- **The environment (preferred).** In CI or Xcode Cloud, set it in the job. Locally, run `export BUGSEE_APP_TOKEN=...` before `xcodebuild`, or `launchctl setenv BUGSEE_APP_TOKEN ...` and restart Xcode. - **A user-defined build setting** named `BUGSEE_APP_TOKEN` on the `Unity-iPhone` target. Xcode exports build settings to Run Script phases as environment variables. The value is stored in the Xcode project, so do not commit the project after you add it. A Unity export in Replace mode regenerates `project.pbxproj`, so add the setting again after each export. Xcode prints build settings into the build log, so such a log holds the token. Without a token, an archive prints `warning: Bugsee: BUGSEE_APP_TOKEN unset` and uploads nothing. A build that is not an archive prints `note:` instead. @@ -44,7 +44,7 @@ The script uploads for every Xcode configuration, Debug included, so a crash fro If a configuration has no dSYM, the script prints `warning: Bugsee: no dSYM for ` and names `DEBUG_INFORMATION_FORMAT = dwarf-with-dsym` as the fix. The `dsymutil` step adds time to each Debug build. To keep Unity's own setting, choose **Bugsee > iOS > Keep Xcode Debug Info Format (skip dSYM force)** in the Unity menu, or set `BUGSEE_NO_DSYM_FORCE` in the Editor's environment for the export. A Debug build then has no dSYM to upload. -The line map file comes from the IL2CPP arguments the package adds to every IL2CPP build (`--emit-source-mapping --emit-method-map`), with or without a token. Nothing to enable in Player Settings. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code). +The line map file comes from the IL2CPP arguments the package adds to every IL2CPP build (`--emit-source-mapping --emit-method-map`), with or without a token. Nothing to enable in Player Settings. The arguments add absolute source paths to the generated C++ in the Xcode export, so set `BUGSEE_NO_IL2CPP_MAPPING` if you hand the export to other people. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code). ### Version and build number @@ -98,9 +98,9 @@ warning: Bugsee: symbol upload failed (exit 31): the Bugsee server could not be | 30 | The Bugsee server returned an error | | 31 | The Bugsee server could not be reached | | 50 | The CLI failed after it sent the request, so the upload may have been applied: check the dashboard and do not re-run blindly | -| 126, 127 | `bugsee-cli` could not be run | +| 126, 127 | `bugsee-cli` could not be run (shell exit codes: 126 is not executable, 127 is not found) | -After any failure the script ends with `warning: Bugsee: some symbols were NOT uploaded; crashes from this build may stay unsymbolicated`. The same codes are in the [CLI exit codes](/cli/exit-codes). +After any failure the script ends with `warning: Bugsee: some symbols were NOT uploaded; crashes from this build may stay unsymbolicated`. The codes other than 126 and 127 are the [CLI exit codes](/cli/exit-codes). ## Upload by hand @@ -109,7 +109,7 @@ Upload a dSYM you kept, or the files of a build that had no token, with the CLI: ```bash export BUGSEE_APP_TOKEN="your-app-token" -bugsee-cli debug-files upload "$ARCHIVE/dSYMs" --type dsym \ +bugsee-cli debug-files upload "/path/to/dSYMs" --type dsym \ --version --build ``` diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx index b28634cd..f43406b5 100644 --- a/docs/sdk/unity/symbolication/overview.mdx +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -49,7 +49,7 @@ Set `BUGSEE_NO_SYMBOL_UPLOAD` to any value to turn every upload off. [Build envi ## An upload never fails your build -The package treats every symbol upload as best effort. A missing token, a missing `bugsee-cli`, a missing map or a failed upload prints a warning in the Unity Console (Android) or the Xcode build log (iOS), and the build continues. Read the log of a release build once to see that the uploads ran. +The package treats every symbol upload as best effort. A missing `bugsee-cli`, a missing map or a failed upload prints a warning in the Unity Console (Android) or the Xcode build log (iOS), and the build continues. With no token, the Android build uploads nothing and prints no warning, and the iOS Run Script prints a warning for an archive and a note for other builds. Read the log of a release build once to see that the uploads ran. The Android upload logs lines that start with `Bugsee: uploading`. The iOS Run Script prints `Bugsee: uploading dSYM` for each dSYM, and a `warning:` line for each problem. diff --git a/docs/sdk/unity/video-capture.mdx b/docs/sdk/unity/video-capture.mdx index cab76021..bb47a4fd 100644 --- a/docs/sdk/unity/video-capture.mdx +++ b/docs/sdk/unity/video-capture.mdx @@ -61,6 +61,7 @@ var options = new AndroidLaunchOptions CaptureVideoFrameRate = FrameRate.Medium, CaptureVideoScale = 0.75f, }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { @@ -69,9 +70,8 @@ var options = new IOSLaunchOptions CaptureVideoFrameRate = FrameRate.Medium, CaptureVideoScale = 0.75f, }; +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` The package drops the Android-only options before an iOS launch, and the iOS-only options before an Android launch. @@ -183,7 +183,8 @@ At the end of each due frame the capturer calls `ScreenCapture.CaptureScreenshot ### What it records and what it does not - It records Unity's final composite, including screen-space overlay UI. Native Android views, such as WebViews, dialogs and system UI, are not in the video. -- The SDK does not mask frames pushed this way: no secure views, no secure WebViews and no pixelation. The pusher blanks the rectangles you register with `Bugsee.AddSecureRectangle`. See [Secure rectangles](#secure-rectangles). +- The SDK does not mask frames pushed this way: no secure views, no secure WebViews and no pixelation. The pusher blanks the rectangles you register with `Bugsee.AddSecureRectangle` and with `Bugsee.AddSecureScreenRectangle`. See [Secure rectangles](#secure-rectangles). +- The pusher records Unity's surface even when its window sets `FLAG_SECURE`, and the package has no `FLAG_SECURE` handling for pushed frames. `CaptureRespectFlagSecure` does not blank them. Use secure rectangles or a blackout for what must stay out of the video. - Blackout is honored by the SDK. - `Bugsee.AddSecureWebView` has no effect while the pusher is the capture source. diff --git a/docs/sdk/unity/view-hierarchy.mdx b/docs/sdk/unity/view-hierarchy.mdx index b26e0ebc..0fce8443 100644 --- a/docs/sdk/unity/view-hierarchy.mdx +++ b/docs/sdk/unity/view-hierarchy.mdx @@ -29,11 +29,11 @@ using BugseeSdk = Bugsee.Bugsee; #if UNITY_ANDROID var options = new AndroidLaunchOptions { CaptureViewHierarchy = true }; +BugseeSdk.Launch("", options); #elif UNITY_IOS var options = new IOSLaunchOptions { CaptureViewHierarchy = true }; +BugseeSdk.Launch("", options); #endif - -BugseeSdk.Launch("", options); ``` The SDK takes a snapshot when it builds a report. To record the hierarchy at a moment of your choosing, for example before a scene transition you want to inspect, call `Bugsee.CaptureViewHierarchy()`. @@ -48,7 +48,7 @@ The iOS SDK documents these rules for the call: it does nothing while `CaptureVi ## What is captured -The tree starts at a root node named `UnityPlayer`. Below it is one `Scene` node for each loaded scene, then each scene's root GameObjects and their children. Objects in the `DontDestroyOnLoad` scene are included. The SDK's own helper object is left out. +The tree starts at a root node whose `class_name` is `UnityPlayer`. The root has no name. Below it is one `Scene` node for each loaded scene, then each scene's root GameObjects and their children. Objects in the `DontDestroyOnLoad` scene are included. The SDK's own helper object is left out. Only GameObjects that are active in the hierarchy are captured. Each node holds: @@ -56,9 +56,9 @@ Only GameObjects that are active in the hierarchy are captured. Each node holds: | --- | --- | | `id` | The instance id of the GameObject. | | `class_name` | The type of the first component that says what the object is, such as `Image` or `Camera`. `RectTransform` or `GameObject` when there is none. | -| `bounds` | A rectangle `[x, y, width, height]` in screen coordinates with the origin at the top left: pixels on Android, points on iOS. | +| `bounds` | A rectangle `[x, y, width, height]` in screen coordinates with the origin at the top left. On Android the unit is Unity's render pixels, which equal device pixels only when Unity does not use Resolution Scaling. On iOS the unit is points. | | `options.name` | The name of the GameObject. | -| `options.components` | The names of the components on the object, at most 8, comma separated. | +| `options.components` | The names of the components on the object, at most 8, comma separated. `Transform` and `CanvasRenderer` are not listed. | | `subitems` | The child nodes. | | `truncated` | `true` when the walk stopped at this node and left some of its children out. | @@ -112,6 +112,10 @@ The hierarchy follows the same privacy rules as video and screenshots. A node wh A node with no usable bounds counts as covered while any secure rectangle is registered. +:::caution[The test is exact only at native resolution] +The overlap test compares the node boxes, which are in Unity's render pixels, with the secure rectangles as registered, in native pixels. It is exact only when Unity renders at the native resolution and fills the screen. With Resolution Scaling, `Screen.SetResolution` or a surface that is offset in the window, a node under a rectangle can keep its name and components. If the names of your GameObjects must not reach Bugsee, set `CaptureViewHierarchy = false`, which turns the view hierarchy capture off. +::: + See [Privacy: video](/sdk/unity/privacy/video) and [Video capture](/sdk/unity/video-capture#secure-rectangles) for how to register rectangles. ## Related pages From 7d66716600d28f9ce828192c1aac9a94582d1480 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 20:52:33 +0500 Subject: [PATCH 04/13] docs(unity): final UIScene note and throwing-handler wording Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I0d27bf5442c9738cfa6ba1c68725e75bc592acd7 --- docs/sdk/unity/build-setup/ios.mdx | 4 +--- docs/sdk/unity/issue-detection/crash-report-extension.mdx | 4 +--- docs/sdk/unity/overview.mdx | 4 +--- docs/sdk/unity/privacy/overview.md | 2 +- docs/sdk/unity/privacy/report.md | 3 ++- docs/sdk/unity/report-handler.mdx | 4 +++- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/sdk/unity/build-setup/ios.mdx b/docs/sdk/unity/build-setup/ios.mdx index 7c6e62f3..06cb77ab 100644 --- a/docs/sdk/unity/build-setup/ios.mdx +++ b/docs/sdk/unity/build-setup/ios.mdx @@ -65,11 +65,9 @@ Set it from the menu **Bugsee > iOS > Crash Report Extension** (Auto, On or Off) The extension's `CFBundleShortVersionString` and `CFBundleVersion` are set to the app's at export. If you change the app's version after export, change the extension's too. A version mismatch between the app and the extension fails App Store validation. :::caution[Unity and iOS 27] -Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +Apps built with the Xcode 27 SDK must use the UIScene lifecycle, or they abort at launch on iOS 27. This is an Apple and Unity requirement and is not specific to Bugsee. Unity 6000.0.84f1 runs on iOS 27 when built with Xcode 27. Unity 2021.3.45f1 and 2022.3.62f3 players abort at launch (SIGTRAP in `___UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption`). Unity lists UIScene support in 2022.3.72f1 and later (limited to enterprise and industry licenses), 6000.0.68f1 and later, 6.3, 6.4 and 6.5, and does not list 2021.3. Other versions, for example 6000.1 and 6000.2, were not tested and may need the same. These results come from Release builds on one device running iOS 27.2 with Xcode 27.1. To avoid the abort, use a Unity version with UIScene support, or build with Xcode 26, which does not link the iOS 27 SDK. The Crash Report Extension needs Xcode 27, so a build with Xcode 26 does not add it. ::: -{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} - If you do not want the target, set the mode to Off. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) for what it reports, its limits, the signing requirements and the Append export behavior. ## Early launch diff --git a/docs/sdk/unity/issue-detection/crash-report-extension.mdx b/docs/sdk/unity/issue-detection/crash-report-extension.mdx index 061b81ab..33645081 100644 --- a/docs/sdk/unity/issue-detection/crash-report-extension.mdx +++ b/docs/sdk/unity/issue-detection/crash-report-extension.mdx @@ -18,11 +18,9 @@ The extension needs Xcode 27 or later to build, and a device on iOS 27 or later ::: :::caution[Unity and iOS 27] -Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +Apps built with Xcode 27 must use the UIScene lifecycle, or they abort at launch on iOS 27. This is not specific to Bugsee, and some Unity versions are affected. See [Unity and iOS 27](/sdk/unity/build-setup/ios#crash-report-extension) for the verified versions and your options. ::: -{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} - ## What is reported | Termination | Report | diff --git a/docs/sdk/unity/overview.mdx b/docs/sdk/unity/overview.mdx index 1d621766..6bd123b3 100644 --- a/docs/sdk/unity/overview.mdx +++ b/docs/sdk/unity/overview.mdx @@ -36,11 +36,9 @@ The SDK turns problems into reports automatically: - **Manual reports**: open the report dialog or upload a report from code. Shake-to-report is off by default. See [Bug reporting](/sdk/unity/manual/bug-reporting). :::caution[Unity and iOS 27] -Building with Xcode 27 links the iOS 27 SDK, which requires the UIScene lifecycle. Unity versions without UIScene support can fail to launch on iOS 27 when built with Xcode 27. This is a maintainer note that is being re-verified per Unity version, so check the Unity version of your project in Unity's release notes. The extension only helps in a player that runs on iOS 27. +Apps built with Xcode 27 must use the UIScene lifecycle, or they abort at launch on iOS 27. This is not specific to Bugsee, and some Unity versions are affected. See [Unity and iOS 27](/sdk/unity/build-setup/ios#crash-report-extension) for the verified versions and your options. ::: -{/* TODO(lead): replace with the verified per-version statement from the UIScene investigation */} - ## How it works - **One package.** You install `com.bugsee.unity` from a git tag. There is no scoped registry, no dependency-resolve step and no custom Gradle template. See [Installation](/sdk/unity/installation). diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index a5f9470d..270a1d57 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -84,7 +84,7 @@ Two features send data without a report, and only when your app calls them: - **Install filters and the report handler before `Bugsee.Launch`.** A filter applies to what is recorded after you set it. Set the log, network and breadcrumb filters and the report handler at the top of your startup code. - **Filters and the report handler run on the Unity main thread.** The native SDKs can call them on other threads, and the package hands each call to the main thread. While the app is in the background, Unity's loop is paused, and filter calls wait until it resumes. - **A filter that throws drops the event.** The package drops an event when your filter throws an exception. It does not record the event unfiltered. -- **A report handler that throws does not drop the report.** The package logs the exception and the report continues without your edits (on iOS every edit except a screenshot change is dropped). A redaction handler that throws uploads the report unredacted. Catch exceptions inside the handler and call `completionCallback()` in a `finally` block. See [Privacy: Report](/sdk/unity/privacy/report). +- **A report handler that throws does not drop the report.** The package logs the exception. On Android the edits made before the throw are kept and later edits are blocked. On iOS every edit except a screenshot change is dropped. A redaction handler that throws before its first edit uploads the report unredacted on both platforms, so the handler is not a redaction boundary. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block. An exception thrown after an `await` in an `async void` handler is not caught, and the report waits about 31 seconds for the abandon timeout. See [Privacy: Report](/sdk/unity/privacy/report). - **A network filter turns the built-in network redaction off.** Run `Bugsee.ApplyDefaultNetworkSanitizer` first in your filter to keep it. See [Privacy: Network](/sdk/unity/privacy/network). - **The report handler is not a redaction boundary for every report.** It is skipped for a report that is created while the process is terminating, it uploads the report unredacted if it throws, and it cannot remove the video, the logs or the network traffic from a report. See [Privacy: Report](/sdk/unity/privacy/report). - **Secure rectangles cover Unity content.** Unity draws its UI itself, so the native secure views and the automatic masking of native password fields do not know your Unity elements. Register a rectangle for each one. See [Privacy: Video](/sdk/unity/privacy/video). diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md index d819bf3b..2058fc33 100644 --- a/docs/sdk/unity/privacy/report.md +++ b/docs/sdk/unity/privacy/report.md @@ -97,7 +97,8 @@ What to know: - **The handler runs on the Unity main thread, inside its turn.** Do the redaction there, keep it short, and call `completionCallback()` when you are done. - **The SDK does not wait indefinitely.** The native SDK carries on with the report unchanged after the handler timeout, 30 seconds by default. A before-phase handler that only gets to run after that is skipped. On Android, the `ReportHandlerCallbackTimeout` launch option sets the timeout. The iOS SDK does not read that option. While the app is in the background, Unity's loop is paused, and the handler waits until it resumes. - **The handler is skipped for a report that is created while the process is terminating.** When `isTerminating` is `true`, the package acknowledges the native SDK at once and does not call your handler. Do not rely on the handler to redact those reports. Keep the data out where it is recorded: mask it on screen, or drop it in a filter. -- **A handler that throws uploads the report unredacted.** The package logs the exception and the report continues without your edits. On iOS every edit except a screenshot change is dropped. A filter differs: a filter that throws drops the event. Catch exceptions inside the handler and call `completionCallback()` in a `finally` block, as the example does. +- **A handler that throws does not drop the report, and it is not a redaction boundary.** The package logs the exception ([bugsee-unity#293](https://github.com/bugsee/bugsee-unity/issues/293)). On Android, the edits made before the throw are kept, because the setters write to the native report at once, and later edits are blocked. On iOS, every edit except a screenshot change is dropped, because the wrapper buffers the edits and sends them with a successful completion. A redaction handler that throws before its first edit therefore uploads the report unredacted on both platforms. A filter differs: a filter that throws drops the event. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block, as the example does. +- **An `async void` handler is not covered by the package.** An exception thrown after an `await` is not caught by the package, the completion never runs, and the report waits for the abandon timeout (about 31 seconds with the default 30-second handler timeout) before it continues unchanged. - **Edits after the handler's turn are not applied.** Do not keep the `IReport` and change it later. - **The handler cannot remove the video, the logs or the network traffic from a report.** Use the capture options and the filters. - **A report from `Bugsee.CreateReport`.** `IReport.Email` set on a report from `Bugsee.CreateReport` is used on Android. On iOS it is dropped with a warning, because the managed upload cannot carry it. Use `Bugsee.SetUserIdentifier` there. diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx index c8ecf656..6b7218f9 100644 --- a/docs/sdk/unity/report-handler.mdx +++ b/docs/sdk/unity/report-handler.mdx @@ -94,7 +94,9 @@ BugseeSdk.Launch("", options); ### If your handler throws -An exception thrown from a callback is logged with `Debug.LogException`, and the report continues. On Android, the edits you made before the exception stay. On iOS, edits other than screenshots travel in the callback's result and are dropped. +An exception thrown from a callback is logged with `Debug.LogException`, and the report continues. On Android, the edits you made before the exception stay, and later edits are blocked. On iOS, edits other than screenshots travel in the callback's result and are dropped. A handler that throws before its first edit therefore uploads the report unredacted on both platforms: make the edits inside `try` and call the completion in `finally`. See [bugsee-unity#293](https://github.com/bugsee/bugsee-unity/issues/293). + +An `async void` handler is not covered. An exception thrown after an `await` is not caught by the package, the completion never runs, and the report waits for the abandon timeout (about 31 seconds with the default timeout) before it continues unchanged. ## What you can change From 912bfb92b7f984bf872c59697425d5b969813886 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 20:58:29 +0500 Subject: [PATCH 05/13] docs(unity): keep the footer link on the 6.x installation page until GA Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I5863a4ee8a108128b9acf544bbea1ff377ae9745 --- docusaurus.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 20c2e32a..a53eb595 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -222,7 +222,7 @@ const config: Config = { { label: 'Bugsee for Xamarin', to: '/sdk/xamarin/installation/' }, { label: 'Bugsee for .NET/MAUI', to: '/sdk/dotnet/installation/' }, { label: 'Bugsee for Flutter', to: '/sdk/flutter/installation/' }, - { label: 'Bugsee for Unity', to: '/sdk/unity/installation/' }, + { label: 'Bugsee for Unity', to: '/sdk/unity/v6/installation/' }, ], }, { From ced7465d6b2769305e2d14478b5b7397157e1170 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 21:42:59 +0500 Subject: [PATCH 06/13] docs(unity): the frame pusher honors FLAG_SECURE when CaptureRespectFlagSecure is true Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I330bdbee49cec9f4a4e849ed0fe120c49b36a8ec --- docs/sdk/unity/privacy/video.mdx | 4 ++-- docs/sdk/unity/video-capture.mdx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx index cb8d1ba6..5ad94fdc 100644 --- a/docs/sdk/unity/privacy/video.mdx +++ b/docs/sdk/unity/privacy/video.mdx @@ -173,8 +173,8 @@ For what the native SDKs hide inside a page, see [Android WebView](/sdk/android/ On Android, the SDK blanks a window that carries the system `FLAG_SECURE` flag, without any Bugsee call. The `CaptureRespectFlagSecure` option controls this on `AndroidLaunchOptions`. It is on by default. Set it to `false` if your app marks windows `FLAG_SECURE` broadly and you want them recorded. See [Android video privacy](/sdk/android/privacy/video). -:::caution[The frame pusher does not honor FLAG_SECURE] -With `VideoMode.DirectBuffers`, the experimental [frame pusher](/sdk/unity/video-capture) records Unity's surface even when its window carries `FLAG_SECURE`. The package has no `FLAG_SECURE` handling for pushed frames, and the SDK does not mask them. Use secure rectangles or a blackout for what must stay out of the video. +:::note[FLAG_SECURE with the frame pusher] +With `VideoMode.DirectBuffers`, the experimental [frame pusher](/sdk/unity/video-capture) follows the same option. On Android with `CaptureRespectFlagSecure` true (the default), frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on Android SDK 7.6.0 on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. ::: ## Blackout diff --git a/docs/sdk/unity/video-capture.mdx b/docs/sdk/unity/video-capture.mdx index bb47a4fd..200a954b 100644 --- a/docs/sdk/unity/video-capture.mdx +++ b/docs/sdk/unity/video-capture.mdx @@ -184,7 +184,7 @@ At the end of each due frame the capturer calls `ScreenCapture.CaptureScreenshot - It records Unity's final composite, including screen-space overlay UI. Native Android views, such as WebViews, dialogs and system UI, are not in the video. - The SDK does not mask frames pushed this way: no secure views, no secure WebViews and no pixelation. The pusher blanks the rectangles you register with `Bugsee.AddSecureRectangle` and with `Bugsee.AddSecureScreenRectangle`. See [Secure rectangles](#secure-rectangles). -- The pusher records Unity's surface even when its window sets `FLAG_SECURE`, and the package has no `FLAG_SECURE` handling for pushed frames. `CaptureRespectFlagSecure` does not blank them. Use secure rectangles or a blackout for what must stay out of the video. +- On Android with `CaptureRespectFlagSecure` true (the default), pushed frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on Android SDK 7.6.0 on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. - Blackout is honored by the SDK. - `Bugsee.AddSecureWebView` has no effect while the pusher is the capture source. From 82aa02c96dd57e724839aae43b2177a986d2be05 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 21:46:29 +0500 Subject: [PATCH 07/13] docs(unity): address review findings on handler, network, defaults and CLI wording Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I1b027acbddd33d31b1ef3c2c81b7c216800a3d7f --- docs/sdk/unity/configuration.mdx | 2 +- .../sdk/unity/issue-detection/crash-report-extension.mdx | 2 +- docs/sdk/unity/issue-detection/overview.mdx | 4 ++-- docs/sdk/unity/lifecycle.mdx | 6 +++--- docs/sdk/unity/network.mdx | 3 +++ docs/sdk/unity/privacy/overview.md | 8 ++++---- docs/sdk/unity/privacy/report.md | 2 +- docs/sdk/unity/privacy/video.mdx | 2 +- docs/sdk/unity/release-notes.md | 4 +++- docs/sdk/unity/report-handler.mdx | 9 +++++++-- docs/sdk/unity/symbolication/environment-variables.md | 2 +- docs/sdk/unity/symbolication/overview.mdx | 2 +- 12 files changed, 28 insertions(+), 18 deletions(-) diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx index 744a4bb7..8f861655 100644 --- a/docs/sdk/unity/configuration.mdx +++ b/docs/sdk/unity/configuration.mdx @@ -12,7 +12,7 @@ This page documents Bugsee Unity SDK **7.x**, which is in beta and can change be You configure the SDK with launch options, the second argument of `Bugsee.Launch`. The options are the same `com.bugsee.option.*` keys the native [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration) SDKs read. This page lists the options the package documents, with their type, default and key. The typed properties are also in the API reference and in IntelliSense. :::warning[Defaults changed in 7.x] -Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. Both were on in earlier versions. To keep them, set `ReportingTriggerByShake = true` (both platforms) and `ReportingTriggerByNotification = true` (Android). +Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. In 6.x, shake was on for Android and off for iOS, and the Android notification-bar trigger was on. To keep the 6.x Android behavior, set `ReportingTriggerByShake = true` and `ReportingTriggerByNotification = true` on `AndroidLaunchOptions`. Set `ReportingTriggerByShake = true` on iOS only if you want a shake trigger there. ::: ## How launch options work diff --git a/docs/sdk/unity/issue-detection/crash-report-extension.mdx b/docs/sdk/unity/issue-detection/crash-report-extension.mdx index 33645081..623b2371 100644 --- a/docs/sdk/unity/issue-detection/crash-report-extension.mdx +++ b/docs/sdk/unity/issue-detection/crash-report-extension.mdx @@ -104,7 +104,7 @@ An export that appends to an existing Xcode project keeps the extension target a By default, Bugsee starts when C# calls `Bugsee.Launch`. Early launch is an opt-in that starts the iOS SDK natively when the app finishes launching, before Unity's first scene. The first `Bugsee.Launch` then adopts that session instead of starting another. :::warning[Consent and privacy] -With early launch on, the iOS SDK starts before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for the player's consent. The app token is stored in the app bundle (`Info.plist`). +With early launch on, the iOS SDK starts before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for the player's consent. The app token is stored in the app bundle (`Info.plist`). With early launch on, an `IReportHandler` registered from C# cannot see or edit the report of the previous run's crash, so do not rely on a report handler to redact it. ::: Turn it on for the export with these environment variables: diff --git a/docs/sdk/unity/issue-detection/overview.mdx b/docs/sdk/unity/issue-detection/overview.mdx index c85fea6a..3d034713 100644 --- a/docs/sdk/unity/issue-detection/overview.mdx +++ b/docs/sdk/unity/issue-detection/overview.mdx @@ -9,11 +9,11 @@ slug: "/sdk/unity/issue-detection/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -Besides the reports your players file and the ones you file from code, Bugsee files reports on its own when it detects a problem in the running game. Each detector is independent: you turn any of them on or off with a launch option, without affecting the others. +Besides the reports your players file and the ones you file from code, Bugsee files reports on its own when it detects a problem in the running game. You turn each detector on or off with a launch option. On Android, `DetectAndReportCrashNdk` is also off when `DetectAndReportCrash` is `false`. The detectors are those of the native Bugsee SDKs, plus one that the Unity package adds for C# exceptions. This page lists the options the Unity package exposes. For how each detector works, see the native pages: [Android issue detection](/sdk/android/issue-detection) and [iOS issue detection](/sdk/ios/issue-detection). -Crash, early-crash and exit detection are on by default. The other detectors are off until you enable them. +Crash, early-crash and exit detection and C# exception capture (`CaptureManagedExceptions`) are on by default. The other detectors are off until you enable them. ## Detectors diff --git a/docs/sdk/unity/lifecycle.mdx b/docs/sdk/unity/lifecycle.mdx index aa55e530..f9c7c368 100644 --- a/docs/sdk/unity/lifecycle.mdx +++ b/docs/sdk/unity/lifecycle.mdx @@ -19,8 +19,8 @@ You can launch, relaunch and stop the SDK at runtime, ask for its status, and su | `Bugsee.LaunchAsync(string appToken, Dictionary options = null)` | `Task` | `Launch` that completes with the SDK's answer. | | `Bugsee.Relaunch(Dictionary options = null)` | `void` | Restarts a launched SDK with a new option set. | | `Bugsee.RelaunchAsync(Dictionary options = null)` | `Task` | `Relaunch` that completes with the SDK's answer. | -| `Bugsee.Stop(Action completion = null)` | `void` | Stops the SDK. `completion` runs once it has stopped. | -| `Bugsee.StopAsync()` | `Task` | `Stop` that completes once the SDK has stopped. | +| `Bugsee.Stop(Action completion = null)` | `void` | Stops the SDK. `completion` runs once the SDK has reported the stop, or after a timeout. | +| `Bugsee.StopAsync()` | `Task` | `Stop` that completes once the SDK has reported the stop, and faults on the timeout. | | `Bugsee.DeleteCollectedDataOnDevice(...)` | `void` or `Task` | Stops the SDK and deletes the data it collected. See [Delete collected data](#delete-collected-data). | The `options` argument takes `AndroidLaunchOptions`, `IOSLaunchOptions` or `OptionsBuilder`; see [Configuration](/sdk/unity/configuration). @@ -66,7 +66,7 @@ public class BugseeLifecycleExample : MonoBehaviour - **`Launch` and `LaunchAsync`** start a session when the SDK accepts the request. They do not wait for the native SDK to finish launching. A launch made while a stop is in flight waits for the stop. A launch while the SDK is already running ignores the new token and the new native options. On iOS, the managed capture options (`CaptureManagedExceptions`, `CaptureUnobservedTaskExceptions`) are applied again by such a repeated launch, so it can change or switch off managed exception capture in a running session. Android leaves the managed capture hooks unchanged. - **`Relaunch` and `RelaunchAsync`** replace the whole option set; they do not merge. Every native option you leave out goes back to its default, and a `Relaunch()` without options resets every option. Handlers, filters and the lifecycle listener are kept. `TreatUnityLogExceptionsAsFatal` is read only when the managed exception hooks are installed, so a relaunch that keeps the hooks does not change it. Android ignores a `Relaunch` unless the status is `Launched`. -- **`Stop` and `StopAsync`** stop the SDK. The `Stop` completion runs when the SDK has reported the stop. A `Launch` or `Relaunch` requested during the stop waits for it, and the completion runs before that launch does. If the completion itself calls `Launch`, that call replaces the waiting one. An unfinished managed `IReport` and an in-flight managed upload are dropped by a stop. +- **`Stop` and `StopAsync`** stop the SDK. The `Stop` completion runs when the SDK has reported the stop, or after the 10-second timeout described below while the native stop is still in flight. A callback cannot tell the two cases apart. A `StopAsync` that completes normally means the stop was reported. A `Launch` or `Relaunch` requested during the stop waits for it, and the completion runs before that launch does. If the completion itself calls `Launch`, that call replaces the waiting one. An unfinished managed `IReport` and an in-flight managed upload are dropped by a stop. - **`LaunchAsync` and `RelaunchAsync`** complete `true` when the SDK accepted the request. They complete `false` when the SDK refused it, or when a later request cancelled it while it waited. If the SDK gives no answer within 10 seconds, they complete `true` when the status is `Launching` or `Launched`, and `false` otherwise. - **`StopAsync`** completes when the SDK has reported the stop, even if a `Launch` follows. It faults with `TimeoutException` when the SDK has not reported the stop within 10 seconds of the call. diff --git a/docs/sdk/unity/network.mdx b/docs/sdk/unity/network.mdx index c8f32dd2..e585d5b2 100644 --- a/docs/sdk/unity/network.mdx +++ b/docs/sdk/unity/network.mdx @@ -149,6 +149,9 @@ using BugseeSdk = Bugsee.Bugsee; BugseeSdk.SetNetworkEventFilter(e => { + // Keep the built-in redaction (see below), then add your own rules. + if (!BugseeSdk.ApplyDefaultNetworkSanitizer(e)) return null; + // Drop health checks. if (e.Url != null && e.Url.Contains("/health")) return null; diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index 270a1d57..f18dcc8b 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -9,7 +9,7 @@ slug: "/sdk/unity/privacy/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -Bugsee does not stream data continuously. The SDK keeps what it records in a rolling buffer on the device, as long as the `Duration` launch option (60 seconds by default on both platforms), and sends it only when a report is created: by a crash or another issue Bugsee detects, from the report dialog, or from your code. The shake trigger and the Android notification-bar trigger are off by default in 7.x. They were on in 6.x. +Bugsee does not stream data continuously. The SDK keeps what it records in a rolling buffer on the device, as long as the `Duration` launch option (60 seconds by default on both platforms), and sends it only when a report is created: by a crash or another issue Bugsee detects, from the report dialog, or from your code. The shake trigger and the Android notification-bar trigger are off by default in 7.x. In 6.x, the Android shake trigger and the Android notification-bar trigger were on, and the iOS shake trigger was off. The data in a report (screen video, touches, console logs, network traffic, breadcrumbs, attributes and the text a user types into the report dialog) can contain personal data. It is the responsibility of your application to keep sensitive data out of reports before they leave the device. Bugsee gives you a control at each point where data is recorded. @@ -34,7 +34,7 @@ You set every option below on the launch options you pass to `Bugsee.Launch`. Se | --- | --- | --- | --- | | Screen video and touches | `CaptureVideo` | on | [Privacy: Video](/sdk/unity/privacy/video) | | Report screenshot | `CaptureScreenshot` | on | Separate from the video option. | -| Unity scene tree (names and component types, no text) | `CaptureViewHierarchy` | on | [View hierarchy](/sdk/unity/view-hierarchy) | +| Unity scene tree (names and component types, no text) | `CaptureViewHierarchy` | on | [View hierarchy](/sdk/unity/view-hierarchy). Secure rectangles can miss a node on a scaled or offset surface: see [Privacy: Video](/sdk/unity/privacy/video). | | Console logs | `CaptureLogs` | on | Includes the Unity console output the package forwards. [Privacy: Console logs](/sdk/unity/privacy/logs) | | Network traffic | `CaptureNetwork` | on | [Privacy: Network](/sdk/unity/privacy/network) | | WebSocket traffic (iOS) | `CaptureWebSocket` | on | Set on `IOSLaunchOptions`. | @@ -55,7 +55,7 @@ These options are off by default. Each one records data you may not want in a re :::warning[iOS early launch starts before your consent check] If you turn on the optional iOS early launch at build time, the iOS SDK starts natively before any C# code runs, so before any consent check of yours, and even if your app never calls `Bugsee.Launch`. Do not turn it on if Bugsee must wait for user consent. See [iOS build setup](/sdk/unity/build-setup/ios). -With early launch, options you pass to `Bugsee.Launch` that differ from the early options are logged and not applied. A privacy option you set in C#, such as `CaptureNetwork = false` or `CaptureLogs = false`, is ignored: put it in the early launch options. Filters and the report handler are set from C# later, so what the SDK captures before you set them is not filtered. +With early launch, options you pass to `Bugsee.Launch` that differ from the early options are logged and not applied. A privacy option you set in C#, such as `CaptureNetwork = false` or `CaptureLogs = false`, is ignored: put it in the early launch options. Filters and the report handler are set from C# later, so what the SDK captures before you set them is not filtered. With early launch on, an `IReportHandler` registered from C# cannot see or edit the report of the previous run's crash, so do not rely on a report handler to redact it. ::: The optional iOS [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension) is a separate component. Read its page before you add it to an app that asks for consent. @@ -84,7 +84,7 @@ Two features send data without a report, and only when your app calls them: - **Install filters and the report handler before `Bugsee.Launch`.** A filter applies to what is recorded after you set it. Set the log, network and breadcrumb filters and the report handler at the top of your startup code. - **Filters and the report handler run on the Unity main thread.** The native SDKs can call them on other threads, and the package hands each call to the main thread. While the app is in the background, Unity's loop is paused, and filter calls wait until it resumes. - **A filter that throws drops the event.** The package drops an event when your filter throws an exception. It does not record the event unfiltered. -- **A report handler that throws does not drop the report.** The package logs the exception. On Android the edits made before the throw are kept and later edits are blocked. On iOS every edit except a screenshot change is dropped. A redaction handler that throws before its first edit uploads the report unredacted on both platforms, so the handler is not a redaction boundary. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block. An exception thrown after an `await` in an `async void` handler is not caught, and the report waits about 31 seconds for the abandon timeout. See [Privacy: Report](/sdk/unity/privacy/report). +- **A report handler that throws does not drop the report.** The package logs the exception. On Android the edits made before the throw are kept and later edits are blocked. On iOS every edit except a screenshot change is dropped. If a handler makes some edits and then throws, Android keeps the earlier edits and iOS drops them. A redaction handler that throws before its first edit uploads the report unredacted on both platforms, so the handler is not a redaction boundary. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block. An exception thrown after an `await` in an `async void` handler is not caught, and the report waits about 31 seconds for the abandon timeout. See [Privacy: Report](/sdk/unity/privacy/report). - **A network filter turns the built-in network redaction off.** Run `Bugsee.ApplyDefaultNetworkSanitizer` first in your filter to keep it. See [Privacy: Network](/sdk/unity/privacy/network). - **The report handler is not a redaction boundary for every report.** It is skipped for a report that is created while the process is terminating, it uploads the report unredacted if it throws, and it cannot remove the video, the logs or the network traffic from a report. See [Privacy: Report](/sdk/unity/privacy/report). - **Secure rectangles cover Unity content.** Unity draws its UI itself, so the native secure views and the automatic masking of native password fields do not know your Unity elements. Register a rectangle for each one. See [Privacy: Video](/sdk/unity/privacy/video). diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md index 2058fc33..d47a8b09 100644 --- a/docs/sdk/unity/privacy/report.md +++ b/docs/sdk/unity/privacy/report.md @@ -97,7 +97,7 @@ What to know: - **The handler runs on the Unity main thread, inside its turn.** Do the redaction there, keep it short, and call `completionCallback()` when you are done. - **The SDK does not wait indefinitely.** The native SDK carries on with the report unchanged after the handler timeout, 30 seconds by default. A before-phase handler that only gets to run after that is skipped. On Android, the `ReportHandlerCallbackTimeout` launch option sets the timeout. The iOS SDK does not read that option. While the app is in the background, Unity's loop is paused, and the handler waits until it resumes. - **The handler is skipped for a report that is created while the process is terminating.** When `isTerminating` is `true`, the package acknowledges the native SDK at once and does not call your handler. Do not rely on the handler to redact those reports. Keep the data out where it is recorded: mask it on screen, or drop it in a filter. -- **A handler that throws does not drop the report, and it is not a redaction boundary.** The package logs the exception ([bugsee-unity#293](https://github.com/bugsee/bugsee-unity/issues/293)). On Android, the edits made before the throw are kept, because the setters write to the native report at once, and later edits are blocked. On iOS, every edit except a screenshot change is dropped, because the wrapper buffers the edits and sends them with a successful completion. A redaction handler that throws before its first edit therefore uploads the report unredacted on both platforms. A filter differs: a filter that throws drops the event. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block, as the example does. +- **A handler that throws does not drop the report, and it is not a redaction boundary.** The package logs the exception ([bugsee-unity#293](https://github.com/bugsee/bugsee-unity/issues/293)). On Android, the edits made before the throw are kept, because the setters write to the native report at once, and later edits are blocked. On iOS, every edit except a screenshot change is dropped, because the wrapper buffers the edits and sends them with a successful completion. If a handler makes some edits and then throws, Android keeps the earlier edits and iOS drops them. A redaction handler that throws before its first edit uploads the report unredacted on both platforms. A filter differs: a filter that throws drops the event. Make the edits inside a `try` block and call `completionCallback()` in a `finally` block, as the example does. - **An `async void` handler is not covered by the package.** An exception thrown after an `await` is not caught by the package, the completion never runs, and the report waits for the abandon timeout (about 31 seconds with the default 30-second handler timeout) before it continues unchanged. - **Edits after the handler's turn are not applied.** Do not keep the `IReport` and change it later. - **The handler cannot remove the video, the logs or the network traffic from a report.** Use the capture options and the filters. diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx index 5ad94fdc..4ddbb331 100644 --- a/docs/sdk/unity/privacy/video.mdx +++ b/docs/sdk/unity/privacy/video.mdx @@ -136,7 +136,7 @@ Remove a rectangle with `Bugsee.RemoveSecureRectangle(RectInt)`, passing the sam The [view hierarchy](/sdk/unity/view-hierarchy) of a report is the Unity scene tree. A node of that tree whose box overlaps a secure rectangle loses its name and its component list. The node keeps its class name and its bounds. A node whose bounds cannot be placed counts as covered while any rectangle is registered. The tree never contains the text of a label or an input field. -The test compares the node boxes, which are in Unity's render pixels, with the rectangles as registered, in native pixels. It is exact only when Unity renders at the native resolution and fills the screen. With Resolution Scaling, `Screen.SetResolution` or a surface that is offset in the window, a node under a rectangle can keep its name and components. If the names of your GameObjects must not reach Bugsee, set `CaptureViewHierarchy = false`, which turns the view hierarchy capture off. +The test compares the node boxes, which are in Unity's render pixels, with the rectangles as registered, in native pixels. It is exact only when Unity renders at the native resolution and fills the screen. With Resolution Scaling, `Screen.SetResolution` or a surface that is offset in the window, a node under a rectangle can keep its name and components ([bugsee-unity#291](https://github.com/bugsee/bugsee-unity/issues/291)). If the names of your GameObjects must not reach Bugsee, set `CaptureViewHierarchy = false`, which turns the view hierarchy capture off. ## WebView secure views diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index 28ecb892..f7e95780 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -29,7 +29,7 @@ The first beta of the 7.x line, which continues the sequence from 6.x. It is a n The [migration guide](/sdk/unity/migration) lists every change from 6.x, with the old and the new code. These are the main ones. - **New package, new API.** The `.unitypackage` and the `Assets/Plugins/Bugsee` files, the `BugseeLauncher` component and the namespace `BugseePlugin` are replaced by the git package and the namespace `Bugsee`. Remove the 6.x plugin files and the old AAR, and port your calls. -- **Shake-to-report and the Android notification-bar trigger are off by default** (iOS SDK 7.1.0 and Android SDK 7.6.0). Set `ReportingTriggerByShake = true` (both platforms) and `AndroidLaunchOptions.ReportingTriggerByNotification = true` (Android) to turn them on. +- **Shake-to-report and the Android notification-bar trigger are off by default** (iOS SDK 7.1.0 and Android SDK 7.6.0). In 6.x, shake was on for Android and off for iOS, and the Android notification-bar trigger was on. Set `ReportingTriggerByShake = true` (both platforms) and `AndroidLaunchOptions.ReportingTriggerByNotification = true` (Android) to turn them on. - **`ShowReportDialog` and `Upload` take `IssueSeverity? severity = null`.** `null` uses the `ReportingDefaultBugPriority` option. They used to always send High. - **Attribute values read back as `long` and `double` on Android**, as on iOS: `GetAttribute`, `GetAllAttributes` and `IReport.GetAttribute`. Replace `(int)` unboxing with `Convert.ToInt32` or a cast to `long`. - **There is no typed `Debug` or `Endpoint` launch option.** Set an endpoint with `SetCustomOption("com.bugsee.option.$$ENDPOINT", url)`. @@ -89,6 +89,8 @@ The [migration guide](/sdk/unity/migration) lists every change from 6.x, with th - Handled managed exceptions in a Release IL2CPP build on Android without IL2CPP line information stay unsymbolicated (no file and line) when the symbols are Public (symbol table only). Use Debugging symbols plus the IL2CPP line map. Development builds send no addresses on Android, and Debugging symbols do not change that. See [Symbolication: Android](/sdk/unity/symbolication/android#public-and-debugging-symbols). - Switching the symbol level from Public to Debugging for the same `libil2cpp.so` build id may leave frames raw on the dashboard. This is open and under investigation ([issue 263](https://github.com/bugsee/bugsee-unity/issues/263)). - After an iOS launch that ended before the app became active, the next launch may block the main thread for up to about 8 seconds while the crash report uploads. The fix is in the native iOS SDK and is not released yet. Normal Unity launches do not hit it, because the SDK starts while the app is active. The opt-in iOS native early launch starts the SDK at app launch, before the app is active, so an app that uses it can hit this. +- Secure rectangles and scaled or offset surfaces: with Resolution Scaling, `Screen.SetResolution` or a surface that is offset in the window, a view hierarchy node under a secure rectangle can keep its name and components ([bugsee-unity#291](https://github.com/bugsee/bugsee-unity/issues/291)). Set `CaptureViewHierarchy = false` if those names must not reach Bugsee. See [Privacy: Video](/sdk/unity/privacy/video). +- A report handler that throws does not drop the report, and is not a redaction boundary ([bugsee-unity#293](https://github.com/bugsee/bugsee-unity/issues/293)). See [Privacy: Report](/sdk/unity/privacy/report). **Compatibility** diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx index 6b7218f9..e63a90ce 100644 --- a/docs/sdk/unity/report-handler.mdx +++ b/docs/sdk/unity/report-handler.mdx @@ -48,7 +48,7 @@ BugseeSdk.SetReportHandler(new MyReportHandler()); | `OnBeforeReportCreated` | First, before the report is assembled. For a report from the dialog, before the dialog opens on iOS. | | `OnAfterReportCreated` | Later in the pipeline, before upload. For a dialog report on iOS, after the player sends it. | -The exact order differs a little between platforms: see the native pages above. Use the "before" callback to change summary, description, severity, labels and attributes. Use the "after" callback to add attachments. +The exact order differs a little between platforms: see the native pages above. Use the "before" callback to change summary, severity, labels and attributes. Use the "after" callback to add attachments and to redact the description and email: for a dialog report on iOS, the text the player typed exists only there. ## Complete the callback @@ -124,7 +124,12 @@ public override void OnBeforeReportCreated(IReport report, bool isTerminating, A if (report.Type == IssueType.Error && report.Severity == null) report.Severity = IssueSeverity.Medium; - // Remove text a player typed into the form. + completionCallback(); +} + +public override void OnAfterReportCreated(IReport report, bool isTerminating, Action completionCallback) +{ + // Remove text a player typed into the form. On iOS, a dialog report holds it only in this callback. if (report.Description != null) report.Description = System.Text.RegularExpressions.Regex.Replace(report.Description, @"\d{16}", "[CARD]"); diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index 51f331d7..7f83a922 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -41,7 +41,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | Variable | Platform | Default | What it does | | --- | --- | --- | --- | | `BUGSEE_NO_IL2CPP_MAPPING` | Android, iOS | Unset | Flag. Turns off the IL2CPP line map flags and the line map upload. The iOS Run Script reads it too, and still uploads the dSYMs. | -| `BUGSEE_IL2CPP_MAPPING` | Android, iOS | Unset | Path to a `LineNumberMappings.json` of your own to upload instead of the build's. A missing file gives a warning and no upload. | +| `BUGSEE_IL2CPP_MAPPING` | Android, iOS | Unset | Path to a `LineNumberMappings.json` of your own to upload instead of the build's. Set it, and `BUGSEE_APP_TOKEN`, in the Unity Editor's environment before the build: the Editor reads it, and a Run Script in Xcode does not. A missing file gives a warning and no upload. | | `BUGSEE_IL2CPP_UUIDS` | Android, iOS | Read from the build | The IL2CPP module UUIDs, comma separated, for the line map upload. The iOS Run Script reads it from the Xcode environment. | | `BUGSEE_SKIP_UPLOAD_ON_DEBUG` | iOS | Unset | Set to `1` in the Xcode environment to skip the upload for the Debug configuration. | | `BUGSEE_NO_DSYM_FORCE` | iOS | Unset | Flag. The export keeps Unity's `DEBUG_INFORMATION_FORMAT` and does not force `dwarf-with-dsym`. The Debug configuration then has no dSYM. | diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx index f43406b5..ca2dabe0 100644 --- a/docs/sdk/unity/symbolication/overview.mdx +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -75,7 +75,7 @@ The Editor uploads run the [Bugsee CLI](/cli). A Unity Editor started from the H 3. The directories the installers use: `/opt/homebrew/bin`, `/usr/local/bin`, `~/.local/bin`, `~/.cargo/bin`, `~/.bugsee/bin` and, on Windows, `%LOCALAPPDATA%\Bugsee\bin`. 4. The package's download cache: `~/Library/Caches/Bugsee/cli` on macOS, `$XDG_CACHE_HOME/bugsee/cli` or `~/.cache/bugsee/cli` on Linux, `%LOCALAPPDATA%\Bugsee\cache\cli` on Windows, else `Library/Bugsee/cli` in the project. -An installed CLI older than 0.8.1 is passed over. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads CLI 0.9.0 from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. +An installed CLI older than 0.8.1 is passed over, except the one `BUGSEE_CLI_PATH` names: that CLI is used as you set it, with a warning, and an already stored symbol table is not upgraded to DWARF. Update or unset `BUGSEE_CLI_PATH` to replace it. `BUGSEE_CLI_VERSION` alone does not. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads CLI 0.9.0 from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. The upload of managed-code mappings for Mono needs CLI 0.9.0 or newer. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#mono-on-android-release-builds). From eb4d7b4b126835da03e206d496ebb4ad4726e852 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 21:46:57 +0500 Subject: [PATCH 08/13] docs(unity): keep the bare Unity routes on 6.x until GA Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: Id668ac844db72fedf1a516295bc24bbe1a6a9567 --- docusaurus.config.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docusaurus.config.ts b/docusaurus.config.ts index a53eb595..c6ee2a00 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -123,9 +123,9 @@ const config: Config = { { from: '/sdk/react-native/v6/privacy', to: '/sdk/react_native/v6/privacy/overview/' }, { from: '/sdk/react_native/v6', to: '/sdk/react_native/v6/installation/' }, { from: '/sdk/react_native/v6/privacy', to: '/sdk/react_native/v6/privacy/overview/' }, - // Unity 7.x has an Overview page; 6.x moved under /sdk/unity/v6/. - { from: '/sdk/unity', to: '/sdk/unity/overview/' }, - { from: '/sdk/unity/privacy', to: '/sdk/unity/privacy/overview/' }, + // 6.x moved under /sdk/unity/v6/. The bare Unity routes stay on 6.x until 7.x is GA. + { from: '/sdk/unity', to: '/sdk/unity/v6/installation/' }, + { from: '/sdk/unity/privacy', to: '/sdk/unity/v6/privacy/overview/' }, { from: '/sdk/unity/v6', to: '/sdk/unity/v6/installation/' }, { from: '/sdk/unity/v6/privacy', to: '/sdk/unity/v6/privacy/overview/' }, // Unity 6.x routes with no 7.x page at the same address keep their 6.x content during the beta. From 6c73ccf1107e26fbb071b2dcdf648c5f7c3cf8f0 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 22:07:19 +0500 Subject: [PATCH 09/13] docs(unity): do not pin native SDK versions in the guides Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I49c643ac34e4222209fe41dc670b6dca7a7cfeb5 --- docs/sdk/unity/build-setup/android.mdx | 10 +++++----- docs/sdk/unity/build-setup/ios.mdx | 2 +- docs/sdk/unity/configuration.mdx | 2 +- docs/sdk/unity/faq.md | 2 +- docs/sdk/unity/feedback.mdx | 4 ++-- docs/sdk/unity/installation.mdx | 4 ++-- docs/sdk/unity/migration.mdx | 6 +++--- docs/sdk/unity/network.mdx | 2 +- docs/sdk/unity/overview.mdx | 14 +++++++------- docs/sdk/unity/privacy/overview.md | 4 ++-- docs/sdk/unity/privacy/video.mdx | 2 +- docs/sdk/unity/release-notes.md | 2 +- docs/sdk/unity/symbolication/android.mdx | 2 +- .../unity/symbolication/environment-variables.md | 2 +- docs/sdk/unity/symbolication/managed-code.mdx | 2 +- docs/sdk/unity/symbolication/overview.mdx | 2 +- docs/sdk/unity/video-capture.mdx | 2 +- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/sdk/unity/build-setup/android.mdx b/docs/sdk/unity/build-setup/android.mdx index f5c39dee..8d9b7881 100644 --- a/docs/sdk/unity/build-setup/android.mdx +++ b/docs/sdk/unity/build-setup/android.mdx @@ -17,11 +17,11 @@ The package runs when Unity generates the Gradle project. It never needs a custo | Step | What it does | | --- | --- | -| Native SDK | Declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk`, both 7.6.0, in `unityLibrary/build.gradle`, between marker comments so a second run does not duplicate them. | +| Native SDK | Declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk`, at the version the package pins, in `unityLibrary/build.gradle`, between marker comments so a second run does not duplicate them. | | Repositories | Adds `mavenCentral()` to the project repositories if Unity's layout lacks it. A project that sets `FAIL_ON_PROJECT_REPOS` is never given project-level repositories. | | Manifest provider | Adds a content provider, `com.bugsee.unity.UnityWrapperProvider`, to the merged manifest. It registers the Bugsee extension modules that your app carries before `Application.onCreate`. | | R8 keep rules | Appends rules to `unityLibrary/proguard-unity.txt` so a Minify build keeps the wrapper classes that C# reaches over JNI. See [Minify and R8](#minify-and-r8). | -| Gradle plugin | Applies the Bugsee Gradle plugin `4.1.1` when the generated project pins AGP 8.6 or later. See [Unity versions](#unity-versions). | +| Gradle plugin | Applies the Bugsee Gradle plugin, at the version the package pins, when the generated project pins AGP 8.6 or later. See [Unity versions](#unity-versions). | | Symbols | Warns when the symbol settings cannot give file and line information, and can switch to full symbols for one build. See [Native symbols](#native-symbols). | If the project already declares the Bugsee Android SDK itself, through the External Dependency Manager (EDM4U), a custom `mainTemplate.gradle` or a local AAR, that declaration is kept and nothing is added next to it. The build log warns when its version differs from the one this package pins, or when the NDK artifact is missing. @@ -42,9 +42,9 @@ The Bugsee Gradle plugin needs AGP 8.6 and Gradle 8.7 or later. The package read | Generated AGP | Typical Unity version | What the package applies | | --- | --- | --- | -| 8.6 or later | Unity 6, for example 6000.0.84f1 with AGP 9.0.0 | The Gradle plugin `4.1.1` and `bugsee { ndk { enabled = true } }` in the launcher module. | -| 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.2, Gradle 7.5.1 in the releases checked) | No plugin. The package adds a small Gradle task to a Groovy launcher file that writes the build id asset, and the Editor uploads symbols itself. A Kotlin DSL launcher gets no task. | -| Older than 7.4, or unreadable | The first Unity 2021.3 patch releases ship AGP 4.0.1 | No plugin and no build id task. The build logs an info line when it can read the AGP version, and a warning when it cannot. | +| 8.6 or later | Unity 6 | The Bugsee Gradle plugin and `bugsee { ndk { enabled = true } }` in the launcher module. | +| 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.x) | No plugin. The package adds a small Gradle task to a Groovy launcher file that writes the build id asset, and the Editor uploads symbols itself. A Kotlin DSL launcher gets no task. | +| Older than 7.4, or unreadable | Early Unity 2021.3 patch releases ship an older AGP | No plugin and no build id task. The build logs an info line when it can read the AGP version, and a warning when it cannot. | On the older AGPs, the plugin functions that the package recovers are these: diff --git a/docs/sdk/unity/build-setup/ios.mdx b/docs/sdk/unity/build-setup/ios.mdx index 06cb77ab..d2e7784c 100644 --- a/docs/sdk/unity/build-setup/ios.mdx +++ b/docs/sdk/unity/build-setup/ios.mdx @@ -15,7 +15,7 @@ You do not add the iOS SDK to Xcode yourself. When you build for iOS, the packag | Step | What it does | | --- | --- | -| Swift package | Adds the Bugsee Swift package, `https://github.com/bugsee/spm.git` at version 7.1.0, and links its `Bugsee` product to the app target and to `UnityFramework`. Bugsee 7.x on iOS is Swift Package Manager only. | +| Swift package | Adds the Bugsee Swift package, `https://github.com/bugsee/spm.git` at the version the package pins, and links its `Bugsee` product to the app target and to `UnityFramework`. Bugsee 7.x on iOS is Swift Package Manager only. | | Deployment target | Raises `IPHONEOS_DEPLOYMENT_TARGET` to 15.0 on both targets when it is lower. | | Debug symbols | Sets `DEBUG_INFORMATION_FORMAT` to `dwarf-with-dsym` for every configuration on both targets, so Debug builds also produce a dSYM to upload. | | Run Script | Adds a build phase named **Bugsee Upload Symbols** that uploads dSYMs and the IL2CPP line map. See [Symbol upload Run Script](#symbol-upload-run-script). | diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx index 8f861655..8e7f9e45 100644 --- a/docs/sdk/unity/configuration.mdx +++ b/docs/sdk/unity/configuration.mdx @@ -94,7 +94,7 @@ A [`Relaunch`](/sdk/unity/lifecycle) replaces the whole option set rather than m Every property below is available on both `AndroidLaunchOptions` and `IOSLaunchOptions`. The Platform column says where the native SDK reads it. -Defaults come from the option manifests of the pinned native SDKs (Android SDK 7.6.0, iOS SDK 7.1.0), except the three Unity-specific options, which the package defines. For what each option does in depth, see the native configuration pages: [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration). +Defaults are those shipped with this release, which come from the option manifests of the native SDKs the package pins, except the three Unity-specific options, which the package defines. For what each option does in depth, see the native configuration pages: [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration). ### Session and storage diff --git a/docs/sdk/unity/faq.md b/docs/sdk/unity/faq.md index b3efdaaa..380ad61c 100644 --- a/docs/sdk/unity/faq.md +++ b/docs/sdk/unity/faq.md @@ -116,7 +116,7 @@ Always keep a `#tag` in the URL. Without one, Unity follows the repository's def **14. Which native SDK versions does this release use?** -Bugsee Android SDK 7.6.0 (with the NDK module 7.6.0), Bugsee iOS SDK 7.1.0, Bugsee Gradle plugin 4.1.1 and `bugsee-cli` 0.9.0. The package adds the native SDKs to the generated Gradle and Xcode projects when you build. See [Overview](/sdk/unity/overview#versions). +The package pins the Bugsee Android SDK (with its NDK module), the Bugsee iOS SDK, the Bugsee Gradle plugin and the default `bugsee-cli` version it was tested with. The [release notes](/sdk/unity/release-notes) list the versions of each release. The package adds the native SDKs to the generated Gradle and Xcode projects when you build. See [Overview](/sdk/unity/overview#versions).
diff --git a/docs/sdk/unity/feedback.mdx b/docs/sdk/unity/feedback.mdx index 94957eb4..97549ddf 100644 --- a/docs/sdk/unity/feedback.mdx +++ b/docs/sdk/unity/feedback.mdx @@ -29,8 +29,8 @@ What the build adds: | Platform | What is added | | --- | --- | -| Android | `com.bugsee:bugsee-android-feedback`, at the version of the Android SDK (7.6.0 in this beta), is declared in the generated `unityLibrary/build.gradle` next to the core and NDK artifacts. | -| iOS | The Xcode export links the `BugseeFeedback` product of [`bugsee/feedback-spm`](https://github.com/bugsee/feedback-spm) into `UnityFramework`, at the same version as the core package (7.1.0 in this beta). | +| Android | `com.bugsee:bugsee-android-feedback`, at the version of the Android SDK the package pins, is declared in the generated `unityLibrary/build.gradle` next to the core and NDK artifacts. | +| iOS | The Xcode export links the `BugseeFeedback` product of [`bugsee/feedback-spm`](https://github.com/bugsee/feedback-spm) into `UnityFramework`, at the same version as the iOS SDK the package pins. | ### Android requirements diff --git a/docs/sdk/unity/installation.mdx b/docs/sdk/unity/installation.mdx index 4ccec27d..16f0101b 100644 --- a/docs/sdk/unity/installation.mdx +++ b/docs/sdk/unity/installation.mdx @@ -83,8 +83,8 @@ The package depends on three built-in Unity modules, which Unity resolves for yo You do not add a scoped registry, a dependency-resolve step or custom Gradle templates. The package wires the native SDKs in when you build: -- **Android**: every build declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk`, version 7.6.0, in the Gradle project that Unity generates. It adds `mavenCentral()` to the project repositories if they lack it. See [Android build setup](/sdk/unity/build-setup/android). -- **iOS**: every export adds the Bugsee Swift package (`https://github.com/bugsee/spm`, version 7.1.0) to the Xcode project. See [iOS build setup](/sdk/unity/build-setup/ios). +- **Android**: every build declares `com.bugsee:bugsee-android` and `com.bugsee:bugsee-android-ndk` in the Gradle project that Unity generates. It adds `mavenCentral()` to the project repositories if they lack it. See [Android build setup](/sdk/unity/build-setup/android). +- **iOS**: every export adds the Bugsee Swift package (`https://github.com/bugsee/spm`) to the Xcode project. See [iOS build setup](/sdk/unity/build-setup/ios). If your project already uses the External Dependency Manager (EDM4U) for other SDKs, it keeps working. If the project already declares `com.bugsee:bugsee-android` itself, through EDM4U, a custom `mainTemplate.gradle` or a local AAR, the package keeps that declaration and adds nothing next to it. The build log warns when its version differs from the one this package pins. diff --git a/docs/sdk/unity/migration.mdx b/docs/sdk/unity/migration.mdx index 99cb02e1..20906d0f 100644 --- a/docs/sdk/unity/migration.mdx +++ b/docs/sdk/unity/migration.mdx @@ -31,13 +31,13 @@ This guide compares Bugsee Unity SDK 6.0.x (the `.unitypackage`, namespace `Bugs | --- | --- | --- | | Distribution | `Bugsee.unitypackage`, imported into `Assets` | Unity Package Manager package `com.bugsee.unity`, from a git tag | | Where the files go | Three folders in `Assets`: `Assets/Plugins/Bugsee` (the scripts), `Assets/Plugins/iOS/Bugsee` (`Bugsee.a`, the headers, `BugseePlugin.m` and `BugseeAgent`) and `Assets/Plugins/Android/Bugsee-Unity.aar` | `Packages/`, read-only. The package bundles no native binaries. | -| Native SDKs | Bundled in the plugin folder | Added at build time: Android SDK 7.6.0 through Gradle, iOS SDK 7.1.0 through Swift Package Manager | +| Native SDKs | Bundled in the plugin folder | Added at build time: the Bugsee Android SDK through Gradle, the Bugsee iOS SDK through Swift Package Manager | | Launch | A `BugseeLauncher` component on an object in your first scene, or a call you make yourself | One call, `Launch`, from any script | | Namespace and class | `BugseePlugin`, class `Bugsee` (a `MonoBehaviour`) | Namespace `Bugsee`, static class `Bugsee` | Do these steps in order: -1. Delete `Assets/Plugins/Bugsee` (the 6.x scripts), `Assets/Plugins/iOS/Bugsee` (the iOS library, headers and `BugseePlugin.m`) and `Assets/Plugins/Android/Bugsee-Unity.aar`. If the old AAR stays, it sits next to the Bugsee Android SDK 7.6.0 that 7.x adds through Maven. +1. Delete `Assets/Plugins/Bugsee` (the 6.x scripts), `Assets/Plugins/iOS/Bugsee` (the iOS library, headers and `BugseePlugin.m`) and `Assets/Plugins/Android/Bugsee-Unity.aar`. If the old AAR stays, it sits next to the Bugsee Android SDK that 7.x adds through Maven. 2. Remove the `BugseeLauncher` component from your scene, and the object you created for it, if it has no other use. 3. Remove `gameObject.AddComponent()` from any code that did a manual launch. In 6.x the `Bugsee` class was a component that had to be on a scene object, and the launcher gave that object the name `bgs_gameObject`. In 7.x `Bugsee` is a static class, so `AddComponent()` does not compile, and nothing in your scene is required. The package creates its own helper object, `Bugsee.MainThreadDispatcher`, before the first scene loads. 4. Remove the `BugseeEventsListener` component from your main camera if you added it for GPU information. The 7.x package has no such component. @@ -278,7 +278,7 @@ BugseeSdk.Appearance ## 4. Launch options -The tables list the 6.x property, its 7.x counterpart and both defaults. 6.x defaults are the values its `AndroidLaunchOptions` and `IOSLaunchOptions` set in their constructors, which `Launch(token)` sent for you. 7.x defaults are those of the native SDKs the package pins (Android SDK 7.6.0, iOS SDK 7.1.0). Every 7.x property is on `AndroidLaunchOptions` and `IOSLaunchOptions` unless the Platform column says otherwise. The full list is in [Configuration](/sdk/unity/configuration). +The tables list the 6.x property, its 7.x counterpart and both defaults. 6.x defaults are the values its `AndroidLaunchOptions` and `IOSLaunchOptions` set in their constructors, which `Launch(token)` sent for you. 7.x defaults are those shipped with this release, from the native SDKs the package pins. Every 7.x property is on `AndroidLaunchOptions` and `IOSLaunchOptions` unless the Platform column says otherwise. The full list is in [Configuration](/sdk/unity/configuration). ### 4.1 Renamed options diff --git a/docs/sdk/unity/network.mdx b/docs/sdk/unity/network.mdx index e585d5b2..8b3f4703 100644 --- a/docs/sdk/unity/network.mdx +++ b/docs/sdk/unity/network.mdx @@ -13,7 +13,7 @@ Bugsee attaches the app's network requests, with their headers, bodies and respo ## What is recorded -The Unity package wraps the native Bugsee SDKs (Android 7.6.0 and iOS 7.1.0). Network capture happens in those native SDKs, on the platform's own HTTP stacks. See their pages for what each one records: +The Unity package wraps the native Bugsee Android and iOS SDKs. Network capture happens in those native SDKs, on the platform's own HTTP stacks. See their pages for what each one records: - [Android network events](/sdk/android/network) - [iOS network events](/sdk/ios/network) diff --git a/docs/sdk/unity/overview.mdx b/docs/sdk/unity/overview.mdx index 6bd123b3..4fd02f6c 100644 --- a/docs/sdk/unity/overview.mdx +++ b/docs/sdk/unity/overview.mdx @@ -60,7 +60,7 @@ The in-app feedback chat is an opt-in add-on. See [Feedback](/sdk/unity/feedback | Android | API 21 (Android 5.0) or later | | Platforms | iOS and Android | -The Android minimum is the minimum of the Bugsee Android SDK 7.x; see the [Android overview](/sdk/android/overview). The minimum API level of your player comes from your Unity version and Player Settings, and can be higher. +The Android minimum is the minimum of the Bugsee Android SDK; see the [Android overview](/sdk/android/overview). The minimum API level of your player comes from your Unity version and Player Settings, and can be higher. The package compiles for every build target, but it records and sends data only on iOS and Android. In the Unity Editor and on other platforms, `Bugsee.Launch` does nothing. @@ -73,14 +73,14 @@ The iOS Simulator has no crash reporter, so crashes and exceptions are reported ## Versions -This beta, `7.0.0-beta.1`, is built on these components: +The package pins the versions of the components it adds to your build, and each release uses the versions it was tested with. The [release notes](/sdk/unity/release-notes) list them for every release. -| Component | Version | +| Component | What the package adds | | --- | --- | -| Bugsee Android SDK | 7.6.0, with the NDK module `bugsee-android-ndk` 7.6.0 | -| Bugsee iOS SDK | 7.1.0, from `github.com/bugsee/spm` | -| Bugsee Gradle plugin | 4.1.1, applied when the generated project uses AGP 8.6 or later | -| `bugsee-cli` | 0.9.0, used for symbol uploads | +| Bugsee Android SDK | The core artifact and the NDK module `bugsee-android-ndk`, declared in the generated Gradle project | +| Bugsee iOS SDK | The Swift package from `github.com/bugsee/spm`, added to the Xcode project | +| Bugsee Gradle plugin | Applied when the generated project uses AGP 8.6 or later | +| `bugsee-cli` | The default version the package downloads for symbol uploads, when no installed CLI is found | 7.x replaces the 6.x `.unitypackage` distribution. The C# API is new, so 6.x code does not compile unchanged. See [Migrating from 6.x to 7.x](/sdk/unity/migration). diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index f18dcc8b..107ddb35 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -13,7 +13,7 @@ Bugsee does not stream data continuously. The SDK keeps what it records in a rol The data in a report (screen video, touches, console logs, network traffic, breadcrumbs, attributes and the text a user types into the report dialog) can contain personal data. It is the responsibility of your application to keep sensitive data out of reports before they leave the device. Bugsee gives you a control at each point where data is recorded. -The Unity package is a wrapper. It starts the native Android SDK (7.6.0) and iOS SDK (7.1.0), and the native SDKs do the recording and the redaction. Where a Unity API forwards to a native feature, the Unity pages say so and link to the native 7.x privacy page. On players other than Android and iOS, the Editor included, the package records nothing and the privacy calls do nothing. +The Unity package is a wrapper. It starts the native Android and iOS SDKs, and the native SDKs do the recording and the redaction. Where a Unity API forwards to a native feature, the Unity pages say so and link to the native 7.x privacy page. On players other than Android and iOS, the Editor included, the package records nothing and the privacy calls do nothing. ## Where the controls are @@ -40,7 +40,7 @@ You set every option below on the launch options you pass to `Bugsee.Launch`. Se | WebSocket traffic (iOS) | `CaptureWebSocket` | on | Set on `IOSLaunchOptions`. | | Breadcrumbs | `CaptureBreadcrumbs` | off | [Privacy: Breadcrumbs](/sdk/unity/privacy/breadcrumbs) | -The defaults come from the option manifests of the two native SDK versions the package wraps. The data you add yourself is recorded as you pass it: [custom events and traces](/sdk/unity/events-and-traces), and the [user identifier and attributes](/sdk/unity/user-session-data). +The defaults come from the option manifests of the native SDKs the package wraps, as shipped with this release. The data you add yourself is recorded as you pass it: [custom events and traces](/sdk/unity/events-and-traces), and the [user identifier and attributes](/sdk/unity/user-session-data). ## Options that record more diff --git a/docs/sdk/unity/privacy/video.mdx b/docs/sdk/unity/privacy/video.mdx index 4ddbb331..eddbf986 100644 --- a/docs/sdk/unity/privacy/video.mdx +++ b/docs/sdk/unity/privacy/video.mdx @@ -174,7 +174,7 @@ For what the native SDKs hide inside a page, see [Android WebView](/sdk/android/ On Android, the SDK blanks a window that carries the system `FLAG_SECURE` flag, without any Bugsee call. The `CaptureRespectFlagSecure` option controls this on `AndroidLaunchOptions`. It is on by default. Set it to `false` if your app marks windows `FLAG_SECURE` broadly and you want them recorded. See [Android video privacy](/sdk/android/privacy/video). :::note[FLAG_SECURE with the frame pusher] -With `VideoMode.DirectBuffers`, the experimental [frame pusher](/sdk/unity/video-capture) follows the same option. On Android with `CaptureRespectFlagSecure` true (the default), frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on Android SDK 7.6.0 on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. +With `VideoMode.DirectBuffers`, the experimental [frame pusher](/sdk/unity/video-capture) follows the same option. On Android with `CaptureRespectFlagSecure` true (the default), frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. ::: ## Blackout diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index f7e95780..5de99c2c 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -15,7 +15,7 @@ Each release lists the native SDKs it is built on. Their own changes are in the ## 7.0.0-beta.1 (November 23, 2026) -The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API, built on Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. +The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API, ships with Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. **Highlights** diff --git a/docs/sdk/unity/symbolication/android.mdx b/docs/sdk/unity/symbolication/android.mdx index ba4fa531..b3a94331 100644 --- a/docs/sdk/unity/symbolication/android.mdx +++ b/docs/sdk/unity/symbolication/android.mdx @@ -76,7 +76,7 @@ The package patches the generated Gradle project; you do not add a Gradle templa | Unity and Android Gradle plugin (AGP) | What the package does | | --- | --- | -| Unity 6 with AGP 8.6 or newer | Applies the Bugsee Gradle plugin 4.1.1 with `ndk { enabled = true }`. | +| Unity 6 with AGP 8.6 or newer | Applies the Bugsee Gradle plugin with `ndk { enabled = true }`. | | AGP below 8.6, for example Unity 2021.3 and 2022.3 | Does not apply the plugin, which needs AGP 8.6 or newer. On AGP 7.4.x and 8.0 to 8.5 it adds a small build-id block to a Groovy launcher file instead (none for a Kotlin DSL launcher). | In a build the Editor runs itself, the Gradle plugin finds no app token (the app gets its token from `Bugsee.Launch`), so its own uploads skip. The Editor's uploads in the table above do the work for every Unity version. See [Android build setup](/sdk/unity/build-setup/android) for the Player Settings checklist and the Gradle file layouts the patching understands. diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index 7f83a922..fe1af1f8 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -32,7 +32,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | Variable | Platform | Default | What it does | | --- | --- | --- | --- | | `BUGSEE_CLI_PATH` | Android, iOS | Unset | The `bugsee-cli` binary to use, as a path or a command name on `PATH`. The Editor, the iOS Run Script and the Gradle plugin of an exported project all read it. The Editor warns when the CLI it names is older than 0.8.1. | -| `BUGSEE_CLI_VERSION` | Android, iOS | `0.9.0` | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first. | +| `BUGSEE_CLI_VERSION` | Android, iOS | The default CLI version the package downloads (see the release notes) | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first. | | `BUGSEE_NO_CLI_DOWNLOAD` | Android | Unset | Flag. The Editor does not download a CLI. Without a token the Editor never downloads. | | `BUGSEE_CLI_BASE_URL` | Android | `https://download.bugsee.com/cli` | A mirror to download the CLI from. HTTPS only. | diff --git a/docs/sdk/unity/symbolication/managed-code.mdx b/docs/sdk/unity/symbolication/managed-code.mdx index 035a0f90..9c2792e8 100644 --- a/docs/sdk/unity/symbolication/managed-code.mdx +++ b/docs/sdk/unity/symbolication/managed-code.mdx @@ -88,7 +88,7 @@ It does not run for IL2CPP or on iOS. With no token or with `BUGSEE_NO_SYMBOL_UP ### CLI version -This step needs `bugsee-cli` 0.9.0 or newer. If the CLI the shared lookup found is older, the Editor looks for the first CLI of 0.9.0 or newer in the lookup order, and otherwise uses the package's cached or downloaded 0.9.0 release (or the release in `BUGSEE_CLI_VERSION`, when that is 0.9.0 or newer; a lower value is ignored for this step). It logs which CLI it took. A `BUGSEE_CLI_PATH` that names an older CLI is not replaced: the Editor warns and skips the step. The same warning appears when no CLI of 0.9.0 or newer is found and downloading is not possible (`BUGSEE_NO_CLI_DOWNLOAD` is set, an earlier download failed, or no release exists for the host). The build continues in every case. +This step needs `bugsee-cli` 0.9.0 or newer. If the CLI the shared lookup found is older, the Editor looks for the first CLI of 0.9.0 or newer in the lookup order, and otherwise uses the package's cached or downloaded default release (or the release in `BUGSEE_CLI_VERSION`, when that is 0.9.0 or newer; a lower value is ignored for this step). It logs which CLI it took. A `BUGSEE_CLI_PATH` that names an older CLI is not replaced: the Editor warns and skips the step. The same warning appears when no CLI of 0.9.0 or newer is found and downloading is not possible (`BUGSEE_NO_CLI_DOWNLOAD` is set, an earlier download failed, or no release exists for the host). The build continues in every case. ### Where the files come from diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx index ca2dabe0..77e02d8a 100644 --- a/docs/sdk/unity/symbolication/overview.mdx +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -75,7 +75,7 @@ The Editor uploads run the [Bugsee CLI](/cli). A Unity Editor started from the H 3. The directories the installers use: `/opt/homebrew/bin`, `/usr/local/bin`, `~/.local/bin`, `~/.cargo/bin`, `~/.bugsee/bin` and, on Windows, `%LOCALAPPDATA%\Bugsee\bin`. 4. The package's download cache: `~/Library/Caches/Bugsee/cli` on macOS, `$XDG_CACHE_HOME/bugsee/cli` or `~/.cache/bugsee/cli` on Linux, `%LOCALAPPDATA%\Bugsee\cache\cli` on Windows, else `Library/Bugsee/cli` in the project. -An installed CLI older than 0.8.1 is passed over, except the one `BUGSEE_CLI_PATH` names: that CLI is used as you set it, with a warning, and an already stored symbol table is not upgraded to DWARF. Update or unset `BUGSEE_CLI_PATH` to replace it. `BUGSEE_CLI_VERSION` alone does not. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads CLI 0.9.0 from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. +An installed CLI older than 0.8.1 is passed over, except the one `BUGSEE_CLI_PATH` names: that CLI is used as you set it, with a warning, and an already stored symbol table is not upgraded to DWARF. Update or unset `BUGSEE_CLI_PATH` to replace it. `BUGSEE_CLI_VERSION` alone does not. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads its default CLI version from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. The upload of managed-code mappings for Mono needs CLI 0.9.0 or newer. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#mono-on-android-release-builds). diff --git a/docs/sdk/unity/video-capture.mdx b/docs/sdk/unity/video-capture.mdx index 200a954b..fb771926 100644 --- a/docs/sdk/unity/video-capture.mdx +++ b/docs/sdk/unity/video-capture.mdx @@ -184,7 +184,7 @@ At the end of each due frame the capturer calls `ScreenCapture.CaptureScreenshot - It records Unity's final composite, including screen-space overlay UI. Native Android views, such as WebViews, dialogs and system UI, are not in the video. - The SDK does not mask frames pushed this way: no secure views, no secure WebViews and no pixelation. The pusher blanks the rectangles you register with `Bugsee.AddSecureRectangle` and with `Bugsee.AddSecureScreenRectangle`. See [Secure rectangles](#secure-rectangles). -- On Android with `CaptureRespectFlagSecure` true (the default), pushed frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on Android SDK 7.6.0 on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. +- On Android with `CaptureRespectFlagSecure` true (the default), pushed frames are not recorded while the activity window carries `FLAG_SECURE`, and the video shows placeholders. With it set to `false`, they are recorded. This was verified on one device and OS version. Secure rectangles and Unity-side redaction stay your responsibility for what must stay out of the video. - Blackout is honored by the SDK. - `Bugsee.AddSecureWebView` has no effect while the pusher is the capture source. From 834a7c90a3d460c67f1dd5f5565c3796fe53aae4 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 22:10:23 +0500 Subject: [PATCH 10/13] docs(unity): fix the release notes sentence Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I638e5ca9ce8707985618b0c4c0033d88e4a2fd5e --- docs/sdk/unity/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index 5de99c2c..10a54913 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -15,7 +15,7 @@ Each release lists the native SDKs it is built on. Their own changes are in the ## 7.0.0-beta.1 (November 23, 2026) -The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API, ships with Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. +The first beta of the 7.x line, which continues the sequence from 6.x. It is a new package with a new C# API. It ships with Bugsee Android SDK 7.6.0 and Bugsee iOS SDK 7.1.0. It is a beta: it can contain rough edges, and the API can change in later betas. **Highlights** From 8a878aadd2e5b3a63b77626e820e19324b5d0928 Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 22:13:58 +0500 Subject: [PATCH 11/13] docs(unity): CLI path warning applies to a path, not a bare command name Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I75c5b9558333f51e785625f98d0c66417448c3a1 --- docs/sdk/unity/symbolication/environment-variables.md | 2 +- docs/sdk/unity/symbolication/overview.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index fe1af1f8..f393e25f 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -31,7 +31,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | Variable | Platform | Default | What it does | | --- | --- | --- | --- | -| `BUGSEE_CLI_PATH` | Android, iOS | Unset | The `bugsee-cli` binary to use, as a path or a command name on `PATH`. The Editor, the iOS Run Script and the Gradle plugin of an exported project all read it. The Editor warns when the CLI it names is older than 0.8.1. | +| `BUGSEE_CLI_PATH` | Android, iOS | Unset | The `bugsee-cli` binary to use, as a path or a command name on `PATH`. The Editor, the iOS Run Script and the Gradle plugin of an exported project all read it. The Editor warns when the CLI at a path it names is older than 0.8.1. It does not warn for a bare command name. | | `BUGSEE_CLI_VERSION` | Android, iOS | The default CLI version the package downloads (see the release notes) | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first. | | `BUGSEE_NO_CLI_DOWNLOAD` | Android | Unset | Flag. The Editor does not download a CLI. Without a token the Editor never downloads. | | `BUGSEE_CLI_BASE_URL` | Android | `https://download.bugsee.com/cli` | A mirror to download the CLI from. HTTPS only. | diff --git a/docs/sdk/unity/symbolication/overview.mdx b/docs/sdk/unity/symbolication/overview.mdx index 77e02d8a..f81fc4f7 100644 --- a/docs/sdk/unity/symbolication/overview.mdx +++ b/docs/sdk/unity/symbolication/overview.mdx @@ -75,7 +75,7 @@ The Editor uploads run the [Bugsee CLI](/cli). A Unity Editor started from the H 3. The directories the installers use: `/opt/homebrew/bin`, `/usr/local/bin`, `~/.local/bin`, `~/.cargo/bin`, `~/.bugsee/bin` and, on Windows, `%LOCALAPPDATA%\Bugsee\bin`. 4. The package's download cache: `~/Library/Caches/Bugsee/cli` on macOS, `$XDG_CACHE_HOME/bugsee/cli` or `~/.cache/bugsee/cli` on Linux, `%LOCALAPPDATA%\Bugsee\cache\cli` on Windows, else `Library/Bugsee/cli` in the project. -An installed CLI older than 0.8.1 is passed over, except the one `BUGSEE_CLI_PATH` names: that CLI is used as you set it, with a warning, and an already stored symbol table is not upgraded to DWARF. Update or unset `BUGSEE_CLI_PATH` to replace it. `BUGSEE_CLI_VERSION` alone does not. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads its default CLI version from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. +An installed CLI older than 0.8.1 is passed over, except the one `BUGSEE_CLI_PATH` names: that CLI is used as you set it, and an already stored symbol table is not upgraded to DWARF. The Editor warns about an old CLI when `BUGSEE_CLI_PATH` is a path to a file. A bare command name found on the `PATH` is used without that warning. Update or unset `BUGSEE_CLI_PATH` to replace it. `BUGSEE_CLI_VERSION` alone does not. When none is found and `BUGSEE_APP_TOKEN` is set, the package downloads its default CLI version from `download.bugsee.com`, checks its SHA-256 and caches it. Set `BUGSEE_NO_CLI_DOWNLOAD` to turn the download off, or `BUGSEE_CLI_VERSION` to download another release (a value that is not a version, or is older than 0.8.1, is ignored with a warning). If nothing is found or downloaded, the build warns once and continues without uploading. The upload of managed-code mappings for Mono needs CLI 0.9.0 or newer. See [Symbolication: C# code](/sdk/unity/symbolication/managed-code#mono-on-android-release-builds). From 7aa165c2ace4133c6977b29ae7cbb511b1fb0d8c Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 22:16:57 +0500 Subject: [PATCH 12/13] docs(unity): use the report page card pattern in the handler example Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: If212f5eebc6a0d5721ccf6667d6daa0591a0c3cb --- docs/sdk/unity/report-handler.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx index e63a90ce..a8cf390a 100644 --- a/docs/sdk/unity/report-handler.mdx +++ b/docs/sdk/unity/report-handler.mdx @@ -131,7 +131,7 @@ public override void OnAfterReportCreated(IReport report, bool isTerminating, Ac { // Remove text a player typed into the form. On iOS, a dialog report holds it only in this callback. if (report.Description != null) - report.Description = System.Text.RegularExpressions.Regex.Replace(report.Description, @"\d{16}", "[CARD]"); + report.Description = System.Text.RegularExpressions.Regex.Replace(report.Description, @"\b\d(?:[ -]?\d){12,18}\b", "[CARD]"); completionCallback(); } From 3b115028b4329542f6fd87b7a3a16176f753830b Mon Sep 17 00:00:00 2001 From: Alexey Karimov Date: Mon, 23 Nov 2026 22:20:37 +0500 Subject: [PATCH 13/13] docs(unity): redact summary and labels, cover the iOS screenshot trigger and early-launch limits Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WeiJxQSiPP4vp79ZPpBsqf Change-Id: I4d912ef071e52d829f3272e97acb4f5b9c8769a2 --- docs/sdk/unity/build-setup/android.mdx | 2 +- docs/sdk/unity/configuration.mdx | 2 +- docs/sdk/unity/migration.mdx | 2 +- docs/sdk/unity/privacy/overview.md | 2 +- docs/sdk/unity/privacy/report.md | 3 +++ docs/sdk/unity/release-notes.md | 2 +- docs/sdk/unity/report-handler.mdx | 4 ++-- docs/sdk/unity/symbolication/environment-variables.md | 4 ++-- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/docs/sdk/unity/build-setup/android.mdx b/docs/sdk/unity/build-setup/android.mdx index 8d9b7881..9cc504f6 100644 --- a/docs/sdk/unity/build-setup/android.mdx +++ b/docs/sdk/unity/build-setup/android.mdx @@ -44,7 +44,7 @@ The Bugsee Gradle plugin needs AGP 8.6 and Gradle 8.7 or later. The package read | --- | --- | --- | | 8.6 or later | Unity 6 | The Bugsee Gradle plugin and `bugsee { ndk { enabled = true } }` in the launcher module. | | 7.4.x and 8.0 to 8.5 | Unity 2021.3 and 2022.3 (AGP 7.4.x) | No plugin. The package adds a small Gradle task to a Groovy launcher file that writes the build id asset, and the Editor uploads symbols itself. A Kotlin DSL launcher gets no task. | -| Older than 7.4, or unreadable | Early Unity 2021.3 patch releases ship an older AGP | No plugin and no build id task. The build logs an info line when it can read the AGP version, and a warning when it cannot. | +| Older than 7.4, or unreadable | Early Unity 2021.3 patch releases ship an older AGP | No plugin and no build id task. The build logs an info line when it can read the AGP version, and a warning when it cannot. Without the build id task, the SDK derives the build id from your token, version name and version code, so bump the version code for a minified build whose obfuscation changed. | On the older AGPs, the plugin functions that the package recovers are these: diff --git a/docs/sdk/unity/configuration.mdx b/docs/sdk/unity/configuration.mdx index 8e7f9e45..4c6f5ee0 100644 --- a/docs/sdk/unity/configuration.mdx +++ b/docs/sdk/unity/configuration.mdx @@ -12,7 +12,7 @@ This page documents Bugsee Unity SDK **7.x**, which is in beta and can change be You configure the SDK with launch options, the second argument of `Bugsee.Launch`. The options are the same `com.bugsee.option.*` keys the native [Android](/sdk/android/configuration) and [iOS](/sdk/ios/configuration) SDKs read. This page lists the options the package documents, with their type, default and key. The typed properties are also in the API reference and in IntelliSense. :::warning[Defaults changed in 7.x] -Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. In 6.x, shake was on for Android and off for iOS, and the Android notification-bar trigger was on. To keep the 6.x Android behavior, set `ReportingTriggerByShake = true` and `ReportingTriggerByNotification = true` on `AndroidLaunchOptions`. Set `ReportingTriggerByShake = true` on iOS only if you want a shake trigger there. +Shake-to-report is off on both platforms, and the notification-bar trigger is off on Android. In 6.x, shake was on for Android and off for iOS, and the Android notification-bar trigger was on. To keep the 6.x Android behavior, set `ReportingTriggerByShake = true` and `ReportingTriggerByNotification = true` on `AndroidLaunchOptions`. Set `ReportingTriggerByShake = true` on iOS only if you want a shake trigger there. The iOS screenshot trigger was on in 6.x and is off in 7.x: set `ReportingTriggerByScreenshot = true` to keep it. ::: ## How launch options work diff --git a/docs/sdk/unity/migration.mdx b/docs/sdk/unity/migration.mdx index 20906d0f..645cb51a 100644 --- a/docs/sdk/unity/migration.mdx +++ b/docs/sdk/unity/migration.mdx @@ -396,7 +396,7 @@ The client signature of a managed exception changed too. 6.x hashed the exceptio - **Events and context:** `AddBreadcrumb`, `SetUserIdentifier`, `GetAllAttributes`, and filters for logs, network events and breadcrumbs. See [Breadcrumbs](/sdk/unity/breadcrumbs), [Network events](/sdk/unity/network) and [Privacy overview](/sdk/unity/privacy/overview). - **Notification relay:** `Notify`. See [Notification relay](/sdk/unity/notification-relay). - **Performance monitoring:** `StartTransaction` and spans. See [Performance monitoring](/sdk/unity/performance). -- **Privacy:** screen-space secure rectangles, secure web views on Android, and `ApplyDefaultNetworkSanitizer`. See [Privacy: Video](/sdk/unity/privacy/video) and [Privacy: Network](/sdk/unity/privacy/network). +- **Privacy:** screen-space secure rectangles, secure web views (Android and iOS), and `ApplyDefaultNetworkSanitizer`. See [Privacy: Video](/sdk/unity/privacy/video) and [Privacy: Network](/sdk/unity/privacy/network). - **Detection:** hangs, exits, HTTP errors, anomalies and frustration, plus the iOS Crash Report Extension and the opt-in iOS native early launch. See [Issue detection](/sdk/unity/issue-detection/overview). - **Symbolication:** Editor and Xcode uploads of native symbols, mappings and the IL2CPP line map. See [Symbolication](/sdk/unity/symbolication/overview). diff --git a/docs/sdk/unity/privacy/overview.md b/docs/sdk/unity/privacy/overview.md index 107ddb35..8384f6af 100644 --- a/docs/sdk/unity/privacy/overview.md +++ b/docs/sdk/unity/privacy/overview.md @@ -9,7 +9,7 @@ slug: "/sdk/unity/privacy/overview" This page documents Bugsee Unity SDK **7.x**, which is in beta and can change between betas. The stable release is **6.x**: see the [6.x documentation](/sdk/unity/v6/installation). Upgrading? See [Migrating from 6.x to 7.x](/sdk/unity/migration). ::: -Bugsee does not stream data continuously. The SDK keeps what it records in a rolling buffer on the device, as long as the `Duration` launch option (60 seconds by default on both platforms), and sends it only when a report is created: by a crash or another issue Bugsee detects, from the report dialog, or from your code. The shake trigger and the Android notification-bar trigger are off by default in 7.x. In 6.x, the Android shake trigger and the Android notification-bar trigger were on, and the iOS shake trigger was off. +Bugsee does not stream data continuously. The SDK keeps what it records in a rolling buffer on the device, as long as the `Duration` launch option (60 seconds by default on both platforms), and sends it only when a report is created: by a crash or another issue Bugsee detects, from the report dialog, or from your code. The shake trigger and the Android notification-bar trigger are off by default in 7.x. In 6.x, the Android shake trigger and the Android notification-bar trigger were on, the iOS shake trigger was off, and the iOS screenshot trigger was on (it is off in 7.x too). The data in a report (screen video, touches, console logs, network traffic, breadcrumbs, attributes and the text a user types into the report dialog) can contain personal data. It is the responsibility of your application to keep sensitive data out of reports before they leave the device. Bugsee gives you a control at each point where data is recorded. diff --git a/docs/sdk/unity/privacy/report.md b/docs/sdk/unity/privacy/report.md index d47a8b09..4e5b38dd 100644 --- a/docs/sdk/unity/privacy/report.md +++ b/docs/sdk/unity/privacy/report.md @@ -71,8 +71,11 @@ public sealed class RedactingReportHandler : ReportHandlerBase { // Strip what the user may have typed into the report dialog. report.Email = null; + if (report.Summary != null) + report.Summary = CardNumber.Replace(report.Summary, "[CARD]"); if (report.Description != null) report.Description = CardNumber.Replace(report.Description, "[CARD]"); + report.ClearLabels(); // Keep an attribute off the report. report.RemoveAttribute("session_token"); diff --git a/docs/sdk/unity/release-notes.md b/docs/sdk/unity/release-notes.md index 10a54913..3f480785 100644 --- a/docs/sdk/unity/release-notes.md +++ b/docs/sdk/unity/release-notes.md @@ -29,7 +29,7 @@ The first beta of the 7.x line, which continues the sequence from 6.x. It is a n The [migration guide](/sdk/unity/migration) lists every change from 6.x, with the old and the new code. These are the main ones. - **New package, new API.** The `.unitypackage` and the `Assets/Plugins/Bugsee` files, the `BugseeLauncher` component and the namespace `BugseePlugin` are replaced by the git package and the namespace `Bugsee`. Remove the 6.x plugin files and the old AAR, and port your calls. -- **Shake-to-report and the Android notification-bar trigger are off by default** (iOS SDK 7.1.0 and Android SDK 7.6.0). In 6.x, shake was on for Android and off for iOS, and the Android notification-bar trigger was on. Set `ReportingTriggerByShake = true` (both platforms) and `AndroidLaunchOptions.ReportingTriggerByNotification = true` (Android) to turn them on. +- **Shake-to-report and the Android notification-bar trigger are off by default** (iOS SDK 7.1.0 and Android SDK 7.6.0). In 6.x, shake was on for Android and off for iOS, the Android notification-bar trigger was on, and the iOS screenshot trigger was on. The iOS screenshot trigger is also off in 7.x: set `ReportingTriggerByScreenshot = true` to keep it. Set `ReportingTriggerByShake = true` (both platforms) and `AndroidLaunchOptions.ReportingTriggerByNotification = true` (Android) to turn them on. - **`ShowReportDialog` and `Upload` take `IssueSeverity? severity = null`.** `null` uses the `ReportingDefaultBugPriority` option. They used to always send High. - **Attribute values read back as `long` and `double` on Android**, as on iOS: `GetAttribute`, `GetAllAttributes` and `IReport.GetAttribute`. Replace `(int)` unboxing with `Convert.ToInt32` or a cast to `long`. - **There is no typed `Debug` or `Endpoint` launch option.** Set an endpoint with `SetCustomOption("com.bugsee.option.$$ENDPOINT", url)`. diff --git a/docs/sdk/unity/report-handler.mdx b/docs/sdk/unity/report-handler.mdx index a8cf390a..041f250e 100644 --- a/docs/sdk/unity/report-handler.mdx +++ b/docs/sdk/unity/report-handler.mdx @@ -38,7 +38,7 @@ BugseeSdk.SetReportHandler(new MyReportHandler()); ``` - A new handler replaces the previous one. `SetReportHandler(null)` removes it. -- Register the handler before you call `Bugsee.Launch`. The native iOS SDK files the crash of the previous run while it launches, and a handler registered later does not see that report. +- Register the handler before you call `Bugsee.Launch`. The native iOS SDK files the crash of the previous run while it launches, and a handler registered later does not see that report. With iOS early launch on, a handler registered from C# never sees it, so do not rely on a report handler to redact it. See [Crash Report Extension](/sdk/unity/issue-detection/crash-report-extension#ios-native-early-launch). - In the Unity Editor there is no report handler, so nothing calls yours. `IReportHandler` has two methods, and both have the signature `(IReport report, bool isTerminating, Action completionCallback)`: @@ -48,7 +48,7 @@ BugseeSdk.SetReportHandler(new MyReportHandler()); | `OnBeforeReportCreated` | First, before the report is assembled. For a report from the dialog, before the dialog opens on iOS. | | `OnAfterReportCreated` | Later in the pipeline, before upload. For a dialog report on iOS, after the player sends it. | -The exact order differs a little between platforms: see the native pages above. Use the "before" callback to change summary, severity, labels and attributes. Use the "after" callback to add attachments and to redact the description and email: for a dialog report on iOS, the text the player typed exists only there. +The exact order differs a little between platforms: see the native pages above. Use the "before" callback to change severity and attributes. Use the "after" callback to add attachments and to redact the summary, description, labels and email: for a dialog report on iOS, what the player typed exists only there. ## Complete the callback diff --git a/docs/sdk/unity/symbolication/environment-variables.md b/docs/sdk/unity/symbolication/environment-variables.md index f393e25f..5f309427 100644 --- a/docs/sdk/unity/symbolication/environment-variables.md +++ b/docs/sdk/unity/symbolication/environment-variables.md @@ -32,7 +32,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | Variable | Platform | Default | What it does | | --- | --- | --- | --- | | `BUGSEE_CLI_PATH` | Android, iOS | Unset | The `bugsee-cli` binary to use, as a path or a command name on `PATH`. The Editor, the iOS Run Script and the Gradle plugin of an exported project all read it. The Editor warns when the CLI at a path it names is older than 0.8.1. It does not warn for a bare command name. | -| `BUGSEE_CLI_VERSION` | Android, iOS | The default CLI version the package downloads (see the release notes) | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first. | +| `BUGSEE_CLI_VERSION` | Android, iOS | The default CLI version the package downloads (see the release notes) | The CLI release to download. A leading `v` is ignored. A value that is not a release version, or is older than 0.8.1, is ignored with a warning. For the Mono step, a value below 0.9.0 is ignored. The Run Script looks for this release in the cache first, and its minimum is 0.8.0, not the Editor's 0.8.1. | | `BUGSEE_NO_CLI_DOWNLOAD` | Android | Unset | Flag. The Editor does not download a CLI. Without a token the Editor never downloads. | | `BUGSEE_CLI_BASE_URL` | Android | `https://download.bugsee.com/cli` | A mirror to download the CLI from. HTTPS only. | @@ -41,7 +41,7 @@ A Unity Editor started from the Hub or the Finder does not inherit your shell's | Variable | Platform | Default | What it does | | --- | --- | --- | --- | | `BUGSEE_NO_IL2CPP_MAPPING` | Android, iOS | Unset | Flag. Turns off the IL2CPP line map flags and the line map upload. The iOS Run Script reads it too, and still uploads the dSYMs. | -| `BUGSEE_IL2CPP_MAPPING` | Android, iOS | Unset | Path to a `LineNumberMappings.json` of your own to upload instead of the build's. Set it, and `BUGSEE_APP_TOKEN`, in the Unity Editor's environment before the build: the Editor reads it, and a Run Script in Xcode does not. A missing file gives a warning and no upload. | +| `BUGSEE_IL2CPP_MAPPING` | Android, iOS | Unset | Path to a `LineNumberMappings.json` of your own to upload instead of the build's. Set it, and `BUGSEE_APP_TOKEN`, in the Unity Editor's environment before the build: the Editor reads it, and a Run Script in Xcode does not. On Android, a missing file gives a warning and no upload. On an iOS export it gives a warning and the Editor writes no pointer, so the Xcode Run Script then looks for the exported build's own line map. | | `BUGSEE_IL2CPP_UUIDS` | Android, iOS | Read from the build | The IL2CPP module UUIDs, comma separated, for the line map upload. The iOS Run Script reads it from the Xcode environment. | | `BUGSEE_SKIP_UPLOAD_ON_DEBUG` | iOS | Unset | Set to `1` in the Xcode environment to skip the upload for the Debug configuration. | | `BUGSEE_NO_DSYM_FORCE` | iOS | Unset | Flag. The export keeps Unity's `DEBUG_INFORMATION_FORMAT` and does not force `dwarf-with-dsym`. The Debug configuration then has no dSYM. |