-
-
Notifications
You must be signed in to change notification settings - Fork 52
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: Managed layer initializes native SDK on iOS #1915
Conversation
|
…sentry/sentry-unity into chore/sample-no-thumb-update
…ntry-unity into feat/ios-init-cocoa
…ntry-unity into feat/ios-init-cocoa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added CI complexity was something I didn't realize at first. Challenging without the other step in CI (duping it all) is it easy thing to do?
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
### API Changes | |||
|
|||
- The native layer on iOS no longer self-initializes before the Unity game starts. Instead, it accepts the options at the end of the configure call. To restore the old behavior, users can opt-in to initializing native first via `IosInitializeNativeFirst`. Note that using this option comes with the limitation of baking the options into the generated Xcode project at build-time. ([#1915](https://github.com/getsentry/sentry-unity/pull/1915)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that using this option comes with the limitation of baking the options into the generated Xcode project at build-time.
Would be nice to link to the docs on this topic since it's quite complex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will follow!
iOS: Cocoa SDK Initialization
Overview
Implements the late initialization of the Cocoa SDK. This allows users to apply code changes to the options and for those options to apply to the native layer. Related issue: sentry-unity#1907
Implementation Details
The SDK now always includes the Cocoa SDK in the generated Xcode project with the following changes:
IosNativeInitializationType
to the SentryOptions. This allows users to switch betweenRuntime
andBuildTime
initialization and defaults toRuntime
.IosNativeSupportEnabled
controls whether the SDK should add native support. This helps i.e. in the case of UaaL where users want to completely disabled the SDK from modifying the Xcode project. We still need to add theNoOpBridge
due to the built-in P/Invoke declarations inSentryCocoaBridgeProxy
.Native Bridge Updates
Load()
as )Build Process Changes
SentryOptions.mm
generation is now controlled byIosNativeInitializationType
enummain.mm
Init generation is now controlled byIosNativeInitializationType
enumUnityFramework
but looking at supporting UaaL where the Cocoa SDK would be present outside the framework as well, this would cause conflicts.Runtime Behavior
SentryNativeCocoa.Configure
checks whether the native SDK was already initializedPending Tasks
RuntimeInitialization
is default. This means we're missing testingBuildTime
in CI right now.