Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,22 @@ public void logCaughtEx() {
// [END crash_log_caught_ex]
}

public void logCaughtExWithCustomKeys() {
// [START crash_log_caught_ex_custom_keys]
try {
methodThatThrows();
} catch (Exception e) {
CustomKeysAndValues keysAndValues = new CustomKeysAndValues.Builder()
.putString("string key", "string value")
.putBoolean("boolean key", true)
.putFloat("float key", Float.MAX_VALUE)
.build();
FirebaseCrashlytics.getInstance().recordException(e, keysAndValues);
// handle your exception here
}
// [END crash_log_caught_ex_custom_keys]
}

public void forceACrash() {
// [START crash_force_crash]
Button crashButton = new Button(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,21 @@ class MainActivity : AppCompatActivity() {
// [END crash_log_caught_ex]
}

fun logCaughtExWithCustomKeys() {
// [START crash_log_caught_ex_custom_keys]
try {
methodThatThrows()
} catch (e: Exception) {
Firebase.crashlytics.recordException(e) {
key("string key", "string value")
key("boolean key", true)
key("float key", Float.MAX_VALUE)
}
// handle your exception here
}
// [END crash_log_caught_ex_custom_keys]
}

fun forceACrash() {
// [START crash_force_crash]
val crashButton = Button(this)
Expand Down
Loading