Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@
"RRGGBBAA",
"Dalvik",
"RSSI",
"Passpoint"
"Passpoint",
"elif",
"Mathf",
"screencapture",
"Readback",
"Dont",
"getenv",
"androidjni",
"jsonserialize",
"libunity",
"libmain",
"libmonobdwgc",
"libmono",
"dsymutil",
"readelf"
]
}
16 changes: 8 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -137,7 +137,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/privacy/video/">View</a></td>
<td><a href="/sdk/react_native/v6/privacy/video/">View</a></td>
<td><a href="/sdk/flutter/privacy/video/">View</a></td>
<td><a href="/sdk/unity/privacy/video/">View</a></td>
<td><a href="/sdk/unity/v6/privacy/video/">View</a></td>
<td><a href="/sdk/dotnet/privacy/video/">View</a></td>
<td><a href="/sdk/kmp/privacy/video/">View</a></td>
</tr>
Expand All @@ -148,7 +148,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><svg width="12" height="12"><path d="M1 4 L5 8 L11 1" fill="none" stroke="currentColor" stroke-width="3" /></svg></td>
<td><a href="/sdk/react_native/v6/crashes/">View</a></td>
<td><a href="/sdk/flutter/symbolication/">View</a></td>
<td><a href="/sdk/unity/crashes/">View</a></td>
<td><a href="/sdk/unity/v6/crashes/">View</a></td>
<td><a href="/sdk/dotnet/symbolication/">View</a></td>
<td><svg width="12" height="12"><path d="M1 4 L5 8 L11 1" fill="none" stroke="currentColor" stroke-width="3" /></svg></td>
</tr>
Expand All @@ -159,7 +159,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/logs/">View</a></td>
<td><a href="/sdk/react_native/v6/logs/">View</a></td>
<td><a href="/sdk/flutter/logs/">View</a></td>
<td><a href="/sdk/unity/logs/">View</a></td>
<td><a href="/sdk/unity/v6/logs/">View</a></td>
<td><a href="/sdk/dotnet/logs/">View</a></td>
<td><a href="/sdk/kmp/logs/">View</a></td>
</tr>
Expand All @@ -170,7 +170,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/custom/">View</a></td>
<td><a href="/sdk/react_native/v6/custom/#custom-events">View</a></td>
<td><a href="/sdk/flutter/custom/#custom-events">View</a></td>
<td><a href="/sdk/unity/custom/#custom-events">View</a></td>
<td><a href="/sdk/unity/v6/custom/#custom-events">View</a></td>
<td><a href="/sdk/dotnet/custom/#custom-events">View</a></td>
<td><a href="/sdk/kmp/custom/#custom-events">View</a></td>
</tr>
Expand All @@ -181,7 +181,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/custom/">View</a></td>
<td><a href="/sdk/react_native/v6/custom/#custom-traces">View</a></td>
<td><a href="/sdk/flutter/custom/#custom-traces">View</a></td>
<td><a href="/sdk/unity/custom/#custom-traces">View</a></td>
<td><a href="/sdk/unity/v6/custom/#custom-traces">View</a></td>
<td><a href="/sdk/dotnet/custom/#custom-traces">View</a></td>
<td><a href="/sdk/kmp/custom/#custom-traces">View</a></td>
</tr>
Expand All @@ -192,7 +192,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/react_native/v6/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/flutter/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/unity/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/unity/v6/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/dotnet/custom/#usersession-attributes">View</a></td>
<td><a href="/sdk/kmp/custom/#usersession-attributes">View</a></td>
</tr>
Expand All @@ -203,7 +203,7 @@ Bugsee has a very rich feature set, yet on some platforms we managed to achieve
<td><a href="/sdk/cordova/custom/">View</a></td>
<td><a href="/sdk/react_native/v6/custom/#file-attachments">View</a></td>
<td><a href="/sdk/flutter/custom/#file-attachments">View</a></td>
<td><a href="/sdk/unity/custom/#file-attachments">View</a></td>
<td><a href="/sdk/unity/v6/custom/#file-attachments">View</a></td>
<td><a href="/sdk/dotnet/custom/">View</a></td>
<td><a href="/sdk/kmp/custom/#file-attachments">View</a></td>
</tr>
Expand Down
128 changes: 128 additions & 0 deletions docs/sdk/unity/appearance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: "Appearance"
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"
---

:::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).
:::

`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<string, object> 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 Bugsee iOS bridge 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).
107 changes: 107 additions & 0 deletions docs/sdk/unity/breadcrumbs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
title: "Breadcrumbs"
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"
---

:::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).
:::

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 };
BugseeSdk.Launch("<your Android app token>", options);
#elif UNITY_IOS
var options = new IOSLaunchOptions { CaptureBreadcrumbs = true };
BugseeSdk.Launch("<your iOS app token>", options);
#endif
```

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", "<redacted>");
return crumb;
});
```

`IBreadcrumb` has these properties, all settable:

| Property | Type |
| --- | --- |
| `Timestamp` | `long` |
| `Category` | `string` |
| `Message` | `string` |
| `Type` | `string` |
| `Level` | `LogLevel?` |
| `Data` | `IDictionary<string, object>` |

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)
Loading
Loading