Skip to content

Commit 53d4926

Browse files
chore: demo of how we might possibly get around bridging headers
1 parent d7ed7ae commit 53d4926

File tree

7 files changed

+179
-23
lines changed

7 files changed

+179
-23
lines changed

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
1818
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
1919
AAE9D7BFA8AAA8783C2860B2 /* GoogleService-Info.plist in Sources */ = {isa = PBXBuildFile; fileRef = 864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */; };
20+
BEEC41346759ADDC8685A9A4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 627281BAE4683CE024487CCB /* Pods_Runner.framework */; };
2021
/* End PBXBuildFile section */
2122

2223
/* Begin PBXCopyFilesBuildPhase section */
@@ -35,10 +36,13 @@
3536
/* Begin PBXFileReference section */
3637
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
3738
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
39+
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 = "<group>"; };
3840
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
41+
627281BAE4683CE024487CCB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3942
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
4043
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4144
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
45+
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 = "<group>"; };
4246
864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
4347
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
4448
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@@ -48,6 +52,7 @@
4852
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4953
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
5054
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
55+
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 = "<group>"; };
5156
/* End PBXFileReference section */
5257

5358
/* Begin PBXFrameworksBuildPhase section */
@@ -56,6 +61,7 @@
5661
buildActionMask = 2147483647;
5762
files = (
5863
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */,
64+
BEEC41346759ADDC8685A9A4 /* Pods_Runner.framework in Frameworks */,
5965
);
6066
runOnlyForDeploymentPostprocessing = 0;
6167
};
@@ -65,10 +71,21 @@
6571
578F13DB49C24452CA02A630 /* Pods */ = {
6672
isa = PBXGroup;
6773
children = (
74+
85096D8D32F4E8438DDCF2CD /* Pods-Runner.debug.xcconfig */,
75+
35675B10B116DC277C431721 /* Pods-Runner.release.xcconfig */,
76+
AFA8AEE0B355AE68B1E56082 /* Pods-Runner.profile.xcconfig */,
6877
);
6978
path = Pods;
7079
sourceTree = "<group>";
7180
};
81+
949A5E8792F1031BE00473AE /* Frameworks */ = {
82+
isa = PBXGroup;
83+
children = (
84+
627281BAE4683CE024487CCB /* Pods_Runner.framework */,
85+
);
86+
name = Frameworks;
87+
sourceTree = "<group>";
88+
};
7289
9740EEB11CF90186004384FC /* Flutter */ = {
7390
isa = PBXGroup;
7491
children = (
@@ -88,6 +105,7 @@
88105
97C146EF1CF9000F007C117D /* Products */,
89106
578F13DB49C24452CA02A630 /* Pods */,
90107
864CBEC4F3EDA362F4B5B76D /* GoogleService-Info.plist */,
108+
949A5E8792F1031BE00473AE /* Frameworks */,
91109
);
92110
sourceTree = "<group>";
93111
};
@@ -130,13 +148,15 @@
130148
isa = PBXNativeTarget;
131149
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
132150
buildPhases = (
151+
8F72F3C6E5DA89F9AF59A4AF /* [CP] Check Pods Manifest.lock */,
133152
9740EEB61CF901F6004384FC /* Run Script */,
134153
97C146EA1CF9000F007C117D /* Sources */,
135154
97C146EB1CF9000F007C117D /* Frameworks */,
136155
97C146EC1CF9000F007C117D /* Resources */,
137156
9705A1C41CF9048500538489 /* Embed Frameworks */,
138157
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
139158
324E062721E4156B000CBB4D /* ShellScript */,
159+
47FC71FAC0C4CF9ECE2B6F0E /* [CP] Embed Pods Frameworks */,
140160
);
141161
buildRules = (
142162
);
@@ -176,7 +196,7 @@
176196
);
177197
mainGroup = 97C146E51CF9000F007C117D;
178198
packageReferences = (
179-
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */,
199+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */,
180200
);
181201
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
182202
projectDirPath = "";
@@ -235,7 +255,69 @@
235255
);
236256
runOnlyForDeploymentPostprocessing = 0;
237257
shellPath = /bin/sh;
238-
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
258+
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
259+
};
260+
47FC71FAC0C4CF9ECE2B6F0E /* [CP] Embed Pods Frameworks */ = {
261+
isa = PBXShellScriptBuildPhase;
262+
buildActionMask = 2147483647;
263+
files = (
264+
);
265+
inputPaths = (
266+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
267+
"${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework",
268+
"${BUILT_PRODUCTS_DIR}/FirebaseCoreExtension/FirebaseCoreExtension.framework",
269+
"${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework",
270+
"${BUILT_PRODUCTS_DIR}/FirebaseCrashlytics/FirebaseCrashlytics.framework",
271+
"${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework",
272+
"${BUILT_PRODUCTS_DIR}/FirebaseRemoteConfigInterop/FirebaseRemoteConfigInterop.framework",
273+
"${BUILT_PRODUCTS_DIR}/FirebaseSessions/FirebaseSessions.framework",
274+
"${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework",
275+
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
276+
"${BUILT_PRODUCTS_DIR}/PromisesObjC/FBLPromises.framework",
277+
"${BUILT_PRODUCTS_DIR}/PromisesSwift/Promises.framework",
278+
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
279+
);
280+
name = "[CP] Embed Pods Frameworks";
281+
outputPaths = (
282+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework",
283+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreExtension.framework",
284+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework",
285+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCrashlytics.framework",
286+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework",
287+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseRemoteConfigInterop.framework",
288+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseSessions.framework",
289+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework",
290+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
291+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBLPromises.framework",
292+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Promises.framework",
293+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
294+
);
295+
runOnlyForDeploymentPostprocessing = 0;
296+
shellPath = /bin/sh;
297+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
298+
showEnvVarsInLog = 0;
299+
};
300+
8F72F3C6E5DA89F9AF59A4AF /* [CP] Check Pods Manifest.lock */ = {
301+
isa = PBXShellScriptBuildPhase;
302+
buildActionMask = 2147483647;
303+
files = (
304+
);
305+
inputFileListPaths = (
306+
);
307+
inputPaths = (
308+
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
309+
"${PODS_ROOT}/Manifest.lock",
310+
);
311+
name = "[CP] Check Pods Manifest.lock";
312+
outputFileListPaths = (
313+
);
314+
outputPaths = (
315+
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
316+
);
317+
runOnlyForDeploymentPostprocessing = 0;
318+
shellPath = /bin/sh;
319+
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";
320+
showEnvVarsInLog = 0;
239321
};
240322
9740EEB61CF901F6004384FC /* Run Script */ = {
241323
isa = PBXShellScriptBuildPhase;
@@ -543,7 +625,7 @@
543625
/* End XCConfigurationList section */
544626

545627
/* Begin XCLocalSwiftPackageReference section */
546-
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = {
628+
781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = {
547629
isa = XCLocalSwiftPackageReference;
548630
relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage;
549631
};

packages/firebase_crashlytics/firebase_crashlytics/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
buildConfiguration = "Debug"
4545
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4646
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4748
shouldUseLaunchSchemeArgsEnv = "YES">
4849
<Testables>
4950
</Testables>
@@ -63,11 +64,13 @@
6364
buildConfiguration = "Debug"
6465
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6566
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
67+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
6668
launchStyle = "0"
6769
useCustomWorkingDirectory = "NO"
6870
ignoresPersistentStateOnLaunch = "NO"
6971
debugDocumentVersioning = "YES"
7072
debugServiceExtension = "internal"
73+
enableGPUValidationMode = "1"
7174
allowLocationSimulation = "YES">
7275
<BuildableProductRunnable
7376
runnableDebuggingMode = "0">

packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics.podspec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Pod::Spec.new do |s|
3131
s.authors = 'The Chromium Authors'
3232
s.source = { :path => '.' }
3333

34-
s.source_files = 'firebase_crashlytics/Sources/firebase_crashlytics/**/*.{swift}'
35-
s.public_header_files = 'firebase_crashlytics/Sources/firebase_crashlytics/include/*.h'
34+
s.source_files = 'firebase_crashlytics/Sources/firebase_crashlytics/**/*.{h,m,swift}'
35+
s.public_header_files = 'firebase_crashlytics/Sources/firebase_crashlytics/include/*.h', 'firebase_crashlytics/Sources/firebase_crashlytics/FLTFirebaseCrashlyticsPlatformBridge.h'
3636

3737
s.ios.deployment_target = '13.0'
3838
s.swift_version = '5.0'
@@ -44,8 +44,7 @@ Pod::Spec.new do |s|
4444
s.static_framework = true
4545
s.pod_target_xcconfig = {
4646
'GCC_PREPROCESSOR_DEFINITIONS' => "LIBRARY_VERSION=\\\"#{library_version}\\\" LIBRARY_NAME=\\\"flutter-fire-cls\\\"",
47-
'DEFINES_MODULE' => 'YES',
48-
'SWIFT_OBJC_BRIDGING_HEADER' => 'firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h'
47+
'DEFINES_MODULE' => 'YES'
4948
}
5049
s.user_target_xcconfig = { 'DEBUG_INFORMATION_FORMAT' => 'dwarf-with-dsym' }
5150
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// FLTFirebaseCrashlyticsPlatformBridge.h
3+
// firebase_crashlytics
4+
//
5+
// Objective-C bridge for accessing private Firebase Crashlytics APIs
6+
//
7+
8+
@import Foundation;
9+
@import FirebaseCrashlytics;
10+
11+
NS_ASSUME_NONNULL_BEGIN
12+
13+
@interface FLTFirebaseCrashlyticsPlatformBridge : NSObject
14+
15+
/// Setup platform information using private APIs
16+
+ (void)setupPlatformInfo;
17+
18+
/// Record an on-demand exception using private APIs
19+
+ (void)recordOnDemandException:(FIRExceptionModel *)exception;
20+
21+
/// Configure an exception model with private properties
22+
+ (void)configureExceptionModel:(FIRExceptionModel *)exception
23+
isFatal:(BOOL)isFatal
24+
onDemand:(BOOL)onDemand;
25+
26+
@end
27+
28+
NS_ASSUME_NONNULL_END
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// FLTFirebaseCrashlyticsPlatformBridge.m
3+
// firebase_crashlytics
4+
//
5+
// Objective-C bridge implementation for accessing private Firebase Crashlytics APIs
6+
//
7+
8+
#import "FLTFirebaseCrashlyticsPlatformBridge.h"
9+
#import "include/Crashlytics_Platform.h"
10+
#import "include/ExceptionModel_Platform.h"
11+
12+
@implementation FLTFirebaseCrashlyticsPlatformBridge
13+
14+
+ (void)setupPlatformInfo {
15+
// Use private APIs to set platform information
16+
[[FIRCrashlytics crashlytics] setDevelopmentPlatformName:@"Flutter"];
17+
[[FIRCrashlytics crashlytics] setDevelopmentPlatformVersion:@"-1"];
18+
}
19+
20+
+ (void)recordOnDemandException:(FIRExceptionModel *)exception {
21+
// Use public API method - Swift record(onDemandException:) becomes record: in Objective-C
22+
[[FIRCrashlytics crashlytics] record:exception];
23+
}
24+
25+
+ (void)configureExceptionModel:(FIRExceptionModel *)exception
26+
isFatal:(BOOL)isFatal
27+
onDemand:(BOOL)onDemand {
28+
// Use private properties to configure exception
29+
exception.isFatal = isFatal;
30+
exception.onDemand = onDemand;
31+
}
32+
33+
@end

packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlytics-Bridging-Header.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/firebase_crashlytics/firebase_crashlytics/ios/firebase_crashlytics/Sources/firebase_crashlytics/FirebaseCrashlyticsPlugin.swift

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,23 @@ private let kCrashlyticsArgumentDidCrashOnPreviousExecution = "didCrashOnPreviou
3535

3636
@objc(FirebaseCrashlyticsPlugin)
3737
public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, CrashlyticsHostApi {
38-
38+
3939
private override init() {
4040
super.init()
4141
// Register with the Flutter Firebase plugin registry.
4242
FLTFirebasePluginRegistry.sharedInstance().register(self)
43-
Crashlytics.crashlytics().setValue("Flutter", forKey: "developmentPlatformName")
44-
Crashlytics.crashlytics().setValue("-1", forKey: "developmentPlatformVersion")
45-
43+
// Use Objective-C bridge to access private APIs
44+
FLTFirebaseCrashlyticsPlatformBridge.setupPlatformInfo()
4645
}
47-
48-
46+
47+
4948
// MARK: - Singleton
5049

5150
// Returns a singleton instance of the Firebase Crashlytics plugin.
5251
public static let sharedInstance = FirebaseCrashlyticsPlugin()
5352

5453
// MARK: - FlutterPlugin
55-
54+
5655
@objc
5756
public static func register(with registrar: FlutterPluginRegistrar) {
5857
let binaryMessenger: FlutterBinaryMessenger
@@ -64,7 +63,7 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra
6463
#endif
6564
CrashlyticsHostApiSetup.setUp(binaryMessenger: binaryMessenger, api: sharedInstance)
6665
}
67-
66+
6867
func recordError(arguments: [String: Any?],
6968
completion: @escaping (Result<Void, any Error>) -> Void) {
7069
let reason = arguments[kCrashlyticsArgumentReason] as? String
@@ -114,12 +113,19 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra
114113

115114
let exception = ExceptionModel(name: "FlutterError", reason: finalReason)
116115
exception.stackTrace = frames
117-
exception.onDemand = true
118-
exception.isFatal = fatal
116+
117+
// Use Objective-C bridge to configure private properties and record
118+
FLTFirebaseCrashlyticsPlatformBridge.configureExceptionModel(
119+
exception,
120+
isFatal: fatal,
121+
onDemand: true
122+
)
119123

120124
if fatal {
121-
Crashlytics.crashlytics().record(onDemandExceptionModel: exception)
125+
// Use private API via bridge
126+
FLTFirebaseCrashlyticsPlatformBridge.recordOnDemandException(exception)
122127
} else {
128+
// Use public API
123129
Crashlytics.crashlytics().record(exceptionModel: exception)
124130
}
125131
completion(.success(()))
@@ -260,12 +266,19 @@ public class FirebaseCrashlyticsPlugin: NSObject, FLTFirebasePluginProtocol, Cra
260266

261267
let exception = ExceptionModel(name: "FlutterError", reason: finalReason)
262268
exception.stackTrace = frames
263-
exception.onDemand = true
264-
exception.isFatal = fatal
269+
270+
// Use Objective-C bridge to configure private properties and record
271+
FLTFirebaseCrashlyticsPlatformBridge.configureExceptionModel(
272+
exception,
273+
isFatal: fatal,
274+
onDemand: true
275+
)
265276

266277
if fatal {
267-
Crashlytics.crashlytics().record(onDemandExceptionModel: exception)
278+
// Use private API via bridge
279+
FLTFirebaseCrashlyticsPlatformBridge.recordOnDemandException(exception)
268280
} else {
281+
// Use public API
269282
Crashlytics.crashlytics().record(exceptionModel: exception)
270283
}
271284
result.success(nil)

0 commit comments

Comments
 (0)