diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f9edf7b..653fc3197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ ## Unreleased - ### Fixes +- iOS samples were missing the Objective-C plugin ([#921](https://github.com/getsentry/sentry-unity/pull/921)) - Save SampleRate to Options.asset ([#916](https://github.com/getsentry/sentry-unity/pull/916)) ### Features diff --git a/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m b/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m new file mode 100644 index 000000000..e092f42eb --- /dev/null +++ b/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m @@ -0,0 +1,19 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +void throwObjectiveC() +{ +#ifdef __EXCEPTIONS + NSLog(@"Throwing an Objective-C Exception"); + @throw [NSException exceptionWithName:@"Objective-C Exception" + reason:@"Sentry Unity Objective-C Support." + userInfo:nil]; +#else + NSLog(@"Objective-C Exceptions are disabled. " + "Consider enabling it in the Xcode project: " + "GCC_ENABLE_OBJC_EXCEPTIONS"); +#endif +} + +NS_ASSUME_NONNULL_END diff --git a/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m.meta b/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m.meta new file mode 100644 index 000000000..29c7eed3c --- /dev/null +++ b/samples/unity-of-bugs/Assets/Scripts/NativeSupport/ObjectiveCPlugin.m.meta @@ -0,0 +1,37 @@ +fileFormatVersion: 2 +guid: 0f5778fc7813434aacea6ae0acb6a55d +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + iPhone: iOS + second: + enabled: 1 + settings: {} + - first: + tvOS: tvOS + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/test/Scripts.Tests/package-release.zip.snapshot b/test/Scripts.Tests/package-release.zip.snapshot index e80f768e0..70cfff899 100644 --- a/test/Scripts.Tests/package-release.zip.snapshot +++ b/test/Scripts.Tests/package-release.zip.snapshot @@ -368,6 +368,8 @@ Samples~/unity-of-bugs/Scripts/NativeSupport/NativeButtons.cs Samples~/unity-of-bugs/Scripts/NativeSupport/NativeButtons.cs.meta Samples~/unity-of-bugs/Scripts/NativeSupport/NativeSupportScene.cs Samples~/unity-of-bugs/Scripts/NativeSupport/NativeSupportScene.cs.meta +Samples~/unity-of-bugs/Scripts/NativeSupport/ObjectiveCPlugin.m +Samples~/unity-of-bugs/Scripts/NativeSupport/ObjectiveCPlugin.m.meta Samples~/unity-of-bugs/Scripts/NativeSupport/WebGLButtons.cs Samples~/unity-of-bugs/Scripts/NativeSupport/WebGLButtons.cs.meta CHANGELOG.md