Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unity: programmatic configuration changes #5738

Merged

Conversation

vaind
Copy link
Collaborator

@vaind vaind commented Nov 8, 2022

Docs update for getsentry/sentry-unity#1046

@vercel
Copy link

vercel bot commented Nov 8, 2022

@vaind is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Nov 8, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sentry-docs ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 2:10PM (UTC)

Comment on lines 21 to 32
* `ConfigureAtBuild()` is executed by the Unity Editor during app build.
Changes you make here affect current build and also allow you to alter native platform build-time settings (Android, iOS, macOS).

* `ConfigureAtRuntime()` is executed on each app startup, right before the managed Sentry SDK is initialized (except for Android, iOS and macOS native layers which are already set-up by that time).
This can be used, for example, to implement your own filtering of events using the [BeforeSend](/platforms/unity/configuration/filtering/#using-platformidentifier-namebefore-send-) callback (note: this callback only runs for events coming from C# scripts).

<Note>

Not all options are used on all platforms, and some may need to be changed at build-time, other at runtime.
Usually, it's safe for both functions to run the same code, unless you know some options should only be set in one or the other.

</Note>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `ConfigureAtBuild()` is executed by the Unity Editor during app build.
Changes you make here affect current build and also allow you to alter native platform build-time settings (Android, iOS, macOS).
* `ConfigureAtRuntime()` is executed on each app startup, right before the managed Sentry SDK is initialized (except for Android, iOS and macOS native layers which are already set-up by that time).
This can be used, for example, to implement your own filtering of events using the [BeforeSend](/platforms/unity/configuration/filtering/#using-platformidentifier-namebefore-send-) callback (note: this callback only runs for events coming from C# scripts).
<Note>
Not all options are used on all platforms, and some may need to be changed at build-time, other at runtime.
Usually, it's safe for both functions to run the same code, unless you know some options should only be set in one or the other.
</Note>
* `ConfigureAtBuild()` is executed by the Unity editor during app build.
Changes you make here affect the current build and also allow you to alter native platform build-time settings (Android, iOS, macOS).
* `ConfigureAtRuntime()` is executed on each app startup, right before the managed Sentry SDK is initialized (except for Android, iOS, and macOS native layers, which are already set up by that time).
An example of how this can be used is for implementing your own filtering of events using the [BeforeSend](/platforms/unity/configuration/filtering/#using-platformidentifier-namebefore-send-) callback. (This callback only runs for events coming from C# scripts.)
<Note>
Not all options can be used on all platforms. Some may need to be changed at build-time, others at runtime.
In most cases it's safe for both functions to run the same code.
</Note>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've accepted the suggestion manually because there were other changes made to the docs (due to functionality changes in the respective SDK PR).

As for Unity Editor vs Unity editor, I've kept uppercases as that is the full name of the IDE

@bitsandfoxes bitsandfoxes merged commit 20e7349 into getsentry:master Nov 14, 2022
@vaind vaind deleted the unity/programmatic-configuration-changes branch November 14, 2022 15:28
@github-actions github-actions bot locked and limited conversation to collaborators Nov 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants