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

feat: Add OptionConfiguration to replace Runtime/BuildTime #1888

Open
wants to merge 24 commits into
base: feat/create-cli-config
Choose a base branch
from

Conversation

bitsandfoxes
Copy link
Contributor

@bitsandfoxes bitsandfoxes commented Nov 6, 2024

Fixes #1621

Based on the issue description: The aim is to have users no longer need to know or care about Runtime and BuildTime differences. They write their code in once place, we use the same options at any time.

Platform specifics can be controlled via the Unity precompile directives. We include a sample of those with the generated template:

using Sentry;
using Sentry.Unity;

public class SentryConfiguration : SentryOptionsConfiguration
{
    public override void Configure(SentryUnityOptions options)
    {
        // Here you can programmatically modify the Sentry option properties used for the SDK's initialization

#if UNITY_ANDROID || UNITY_IOS
        // Important!
        // On Android and iOS, ALL options configured here will be "baked" into the exported project during
        // build time. Any runtime changes to these options will not take effect.

        // Examples:

        // Works as expected and will disable all debug logging of the native SDKs
        // options.Debug = false;

        // Will NOT work as expected as this will need to get validated at runtime
        // options.Debug = SystemInfo.deviceName.Contains("Pixel");
#endif
    }
}

The Runtime/BuildTime config got deprecated but will still be called last as keep backwards compatibility. I've updated the config window with a warning label.
Screenshot 2024-11-15 at 11 18 18

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a3f535a

@bitsandfoxes bitsandfoxes marked this pull request as ready for review November 13, 2024 22:01
@bitsandfoxes bitsandfoxes changed the title feat: Add OptionConfiguration feat: Add OptionConfiguration to replace Runtime/BuildTime Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants