Skip to content

Commit

Permalink
fix(crashlytics): crash(...) method now respects message option (#721)
Browse files Browse the repository at this point in the history
* bugfix-firebase-crashlytics-iOS-testCrash-not-passing-message-option-#720

* npm run changeset

* Update thin-hornets-explain.md

---------

Co-authored-by: Robin Genz <[email protected]>
  • Loading branch information
GoethelHB and robingenz authored Sep 20, 2024
1 parent fd2ee14 commit 8b190d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thin-hornets-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@capacitor-firebase/crashlytics': patch
---

fix(ios): `crash(...)` method now respects message option
4 changes: 2 additions & 2 deletions packages/crashlytics/ios/Plugin/FirebaseCrashlytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import FirebaseCrashlytics
}
}

@objc public func crash() {
fatalError()
@objc public func crash(_ message: String) {
fatalError(message)
}

@objc func setCustomKey(_ key: String, _ type: String, _ call: CAPPluginCall) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ public class FirebaseCrashlyticsPlugin: CAPPlugin {
}

@objc func crash(_ call: CAPPluginCall) {
guard let message = call.getString("message") else {
call.reject(errorMessageMissing)
return
}
call.resolve()
implementation?.crash()
implementation?.crash(message)
}

@objc func setCustomKey(_ call: CAPPluginCall) {
Expand Down

0 comments on commit 8b190d1

Please sign in to comment.