diff --git a/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj b/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj index 4765ae8e47a2..bd9ff4709bef 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; AAE9D7BFA8AAA8783C2860B2 /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */; }; + BEEC41346759ADDC8685A9A4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 627281BAE4683CE024487CCB /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -35,10 +36,13 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 35675B10B116DC277C431721 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 627281BAE4683CE024487CCB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 85096D8D32F4E8438DDCF2CD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -48,6 +52,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + AFA8AEE0B355AE68B1E56082 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +61,7 @@ buildActionMask = 2147483647; files = ( 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + BEEC41346759ADDC8685A9A4 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -65,10 +71,21 @@ 578F13DB49C24452CA02A630 /* Pods */ = { isa = PBXGroup; children = ( + 85096D8D32F4E8438DDCF2CD /* Pods-Runner.debug.xcconfig */, + 35675B10B116DC277C431721 /* Pods-Runner.release.xcconfig */, + AFA8AEE0B355AE68B1E56082 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; }; + 949A5E8792F1031BE00473AE /* Frameworks */ = { + isa = PBXGroup; + children = ( + 627281BAE4683CE024487CCB /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -88,6 +105,7 @@ 97C146EF1CF9000F007C117D /* Products */, 578F13DB49C24452CA02A630 /* Pods */, 864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */, + 949A5E8792F1031BE00473AE /* Frameworks */, ); sourceTree = ""; }; @@ -130,6 +148,7 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 8F72F3C6E5DA89F9AF59A4AF /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, @@ -137,6 +156,7 @@ 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 324E062721E4156B000CBB4D /* ShellScript */, + 47FC71FAC0C4CF9ECE2B6F0E /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -176,7 +196,7 @@ ); mainGroup = 97C146E51CF9000F007C117D; packageReferences = ( - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; @@ -235,7 +255,69 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; + }; + 47FC71FAC0C4CF9ECE2B6F0E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfigInterop/FirebaseRemoteConfigInterop.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseSessions/FirebaseSessions.framework", + "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", + "${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework", + "${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework", + "${BUILT_PRODUCTS_DIR}/PromisesSwift/Promises.framework", + "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfigInterop.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseSessions.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Promises.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 8F72F3C6E5DA89F9AF59A4AF /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -543,7 +625,7 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ - 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { isa = XCLocalSwiftPackageReference; relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; }; diff --git a/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 6bca48fc9e71..92d502f0ca52 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -44,6 +44,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -63,11 +64,13 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> diff --git a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics.podspec b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics.podspec index 860d69bf53fc..8823ac0bea43 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics.podspec +++ b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics.podspec @@ -31,8 +31,8 @@ Pod::Spec.new do |s| s.authors = 'The Chromium Authors' s.source = { :path => '.' } - s.source_files = 'firebase_crashlytics/Sources/firebase_crashlytics/**/*.{swift}' - s.public_header_files = 'firebase_crashlytics/Sources/firebase_crashlytics/include/*.h' + s.source_files = 'firebase_crashlytics/Sources/firebase_crashlytics/**/*.{h,m,swift}' + s.public_header_files = 'firebase_crashlytics/Sources/firebase_crashlytics/include/*.h', 'firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.h' s.ios.deployment_target = '13.0' s.swift_version = '5.0' @@ -44,8 +44,7 @@ Pod::Spec.new do |s| s.static_framework = true s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => "LIBRARY_VERSION=\\\"#{library_version}\\\" LIBRARY_NAME=\\\"flutter-fire-cls\\\"", - 'DEFINES_MODULE' => 'YES', - 'SWIFT_OBJC_BRIDGING_HEADER' => 'firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h' + 'DEFINES_MODULE' => 'YES' } s.user_target_xcconfig = { 'DEBUG_INFORMATION_FORMAT' => 'dwarf-with-dsym' } end diff --git a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.h b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.h new file mode 100644 index 000000000000..a35562a5274a --- /dev/null +++ b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.h @@ -0,0 +1,28 @@ +// +// FLTFirebaseCrashlyticsPlatformBridge.h +// firebase_crashlytics +// +// Objective-C bridge for accessing private Firebase Crashlytics APIs +// + +@import Foundation; +@import FirebaseCrashlytics; + +NS_ASSUME_NONNULL_BEGIN + +@interface FLTFirebaseCrashlyticsPlatformBridge : NSObject + +/// Setup platform information using private APIs ++ (void)setupPlatformInfo; + +/// Record an on-demand exception using private APIs ++ (void)recordOnDemandException:(FIRExceptionModel *)exception; + +/// Configure an exception model with private properties ++ (void)configureExceptionModel:(FIRExceptionModel *)exception + isFatal:(BOOL)isFatal + onDemand:(BOOL)onDemand; + +@end + +NS_ASSUME_NONNULL_END diff --git a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.m b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.m new file mode 100644 index 000000000000..b9bbcdee0d0a --- /dev/null +++ b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.m @@ -0,0 +1,33 @@ +// +// FLTFirebaseCrashlyticsPlatformBridge.m +// firebase_crashlytics +// +// Objective-C bridge implementation for accessing private Firebase Crashlytics APIs +// + +#import "FLTFirebaseCrashlyticsPlatformBridge.h" +#import "include/Crashlytics_Platform.h" +#import "include/ExceptionModel_Platform.h" + +@implementation FLTFirebaseCrashlyticsPlatformBridge + ++ (void)setupPlatformInfo { + // Use private APIs to set platform information + [[FIRCrashlytics crashlytics] setDevelopmentPlatformName:@"Flutter"]; + [[FIRCrashlytics crashlytics] setDevelopmentPlatformVersion:@"-1"]; +} + ++ (void)recordOnDemandException:(FIRExceptionModel *)exception { + // Use public API method - Swift record(onDemandException:) becomes record: in Objective-C + [[FIRCrashlytics crashlytics] record:exception]; +} + ++ (void)configureExceptionModel:(FIRExceptionModel *)exception + isFatal:(BOOL)isFatal + onDemand:(BOOL)onDemand { + // Use private properties to configure exception + exception.isFatal = isFatal; + exception.onDemand = onDemand; +} + +@end diff --git a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h deleted file mode 100644 index bbbbebab5976..000000000000 --- a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h +++ /dev/null @@ -1,2 +0,0 @@ -#import "include/Crashlytics_Platform.h" -#import "include/ExceptionModel_Platform.h" \ No newline at end of file diff --git a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlyticsPlugin.swift b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlyticsPlugin.swift index 23c4d1a0d918..2b98c6271853 100644 --- a/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlyticsPlugin.swift +++ b/packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlyticsPlugin.swift @@ -35,24 +35,23 @@ private let kCrashlyticsArgumentDidCrashOnPreviousExecution = "didCrashOnPreviou @objc(FirebaseCrashlyticsPlugin) public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, CrashlyticsHostApi { - + private override init() { super.init() // Register with the Flutter Firebase plugin registry. FLTFirebasePluginRegistry.sharedInstance().register(self) - Crashlytics.crashlytics().setValue("Flutter", forKey: "developmentPlatformName") - Crashlytics.crashlytics().setValue("-1", forKey: "developmentPlatformVersion") - + // Use Objective-C bridge to access private APIs + FLTFirebaseCrashlyticsPlatformBridge.setupPlatformInfo() } - - + + // MARK: - Singleton // Returns a singleton instance of the Firebase Crashlytics plugin. public static let sharedInstance = FirebaseCrashlyticsPlugin() // MARK: - FlutterPlugin - + @objc public static func register(with registrar: FlutterPluginRegistrar) { let binaryMessenger: FlutterBinaryMessenger @@ -64,7 +63,7 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra #endif CrashlyticsHostApiSetup.setUp(binaryMessenger: binaryMessenger, api: sharedInstance) } - + func recordError(arguments: [String: Any?], completion: @escaping (Result) -> Void) { let reason = arguments[kCrashlyticsArgumentReason] as? String @@ -114,12 +113,19 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra let exception = ExceptionModel(name: "FlutterError", reason: finalReason) exception.stackTrace = frames - exception.onDemand = true - exception.isFatal = fatal + + // Use Objective-C bridge to configure private properties and record + FLTFirebaseCrashlyticsPlatformBridge.configureExceptionModel( + exception, + isFatal: fatal, + onDemand: true + ) if fatal { - Crashlytics.crashlytics().record(onDemandExceptionModel: exception) + // Use private API via bridge + FLTFirebaseCrashlyticsPlatformBridge.recordOnDemandException(exception) } else { + // Use public API Crashlytics.crashlytics().record(exceptionModel: exception) } completion(.success(())) @@ -260,12 +266,19 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra let exception = ExceptionModel(name: "FlutterError", reason: finalReason) exception.stackTrace = frames - exception.onDemand = true - exception.isFatal = fatal + + // Use Objective-C bridge to configure private properties and record + FLTFirebaseCrashlyticsPlatformBridge.configureExceptionModel( + exception, + isFatal: fatal, + onDemand: true + ) if fatal { - Crashlytics.crashlytics().record(onDemandExceptionModel: exception) + // Use private API via bridge + FLTFirebaseCrashlyticsPlatformBridge.recordOnDemandException(exception) } else { + // Use public API Crashlytics.crashlytics().record(exceptionModel: exception) } result.success(nil)