feat: add iOS native exception capture support#331
feat: add iOS native exception capture support#331marandaneto wants to merge 12 commits intomainfrom
Conversation
d8d81a9 to
4fd0635
Compare
| #endif | ||
|
|
||
| // Configure error tracking | ||
| #if os(iOS) || os(macOS) || os(tvOS) |
There was a problem hiding this comment.
@ioannisj should this be under only these 3 plastforms or all?
autocapture is only these 3 right, manual capture everything
so i guess the in app stuff makes sense for all platforms?
There was a problem hiding this comment.
Correct, we only need to guard "captureNativeExceptions" config which uses the PLCrashReporter dependency (these os limitations come from there)
|
@ioannisj something to figure out here https://posthog.slack.com/archives/C07AA937K9A/p1773239632233809?thread_ts=1773236734.446239&cid=C07AA937K9A |
| ); | ||
| runOnlyForDeploymentPostprocessing = 0; | ||
| shellPath = /bin/sh; | ||
| shellScript = "# uncomment to upload mapping files to PostHog\n# POSTHOG_INCLUDE_SOURCE=1 ${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh\n"; |
There was a problem hiding this comment.
@hpouillot uncomment this otherwise it wont trigger, had to remove it to make CI happy
| # needs device pairing - enable debug mode on the device | ||
| # make sure you have a valid team in Xcode, go to Signing & Capabilities | ||
| flutter devices | ||
| flutter run --release -d Manoel --verbose | ||
| # replace Manoel with your device's name/id |
There was a problem hiding this comment.
@hpouillot we need release mode and you cant run release mode on emulators
dustinbyrne
left a comment
There was a problem hiding this comment.
I didn't run the example, but I trust that it's working. Native changes look good. 👍 👍
ioannisj
left a comment
There was a problem hiding this comment.
iOS line numbers will hopefully be addressed on cymbal. Was looking into it today but no luck yet
| #endif | ||
|
|
||
| // Configure error tracking | ||
| #if os(iOS) || os(macOS) || os(tvOS) |
There was a problem hiding this comment.
Correct, we only need to guard "captureNativeExceptions" config which uses the PLCrashReporter dependency (these os limitations come from there)
| /// - iOS: Not supported | ||
| /// - Android: Java/Kotlin exceptions only (no native C/C++ crashes) | ||
| /// - Android: No stacktrace demangling for minified builds | ||
| /// **iOS:** |
There was a problem hiding this comment.
We should probably mention that this is experimental. GH won't let me suggest changes for some reason
💡 Motivation and Context
Closes #238
The
captureNativeExceptionsconfig option previously only supported Android. This PR adds iOS support, enabling automatic capture of native crashes (Mach exceptions, POSIX signals, and uncaught NSExceptions) via the PostHog iOS SDK'serrorTrackingConfig.autoCaptureAPI.💚 How did you test it?
captureNativeExceptions = truein the example app configiOS: missing line numbers - to figure out
Android: missing sources - expected
📝 Checklist
If releasing new changes
pnpm changesetto generate a changeset filereleaselabel to the PR