Summary: This diff includes minor changes to the pages within the Setup section of Flipper Docs. Reviewed By: mweststrate Differential Revision: D41496698 fbshipit-source-id: a338931bd08e474ee348e25798463647f9a0be29
28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
import Link from '@docusaurus/Link';
|
|
|
|
You don't have to instantiate the <Link to={useBaseUrl("/docs/features/plugins/crash-reporter")}>Crash Reporter plugin</Link> in your app in order to use its basic functionality.
|
|
|
|
You can use the Crash Reporter plugin to send notifications for exceptions that are suppressed in your Android application.
|
|
You could even use it to send notifications when the [Litho Error Boundary](https://www.internalfb.com/intern/staticdocs/litho/docs/mainconcepts/use-error-boundary/) is triggered.
|
|
|
|
In order to send custom notifications, take the steps detailed below.
|
|
|
|
## Android
|
|
|
|
1. Instantiate and add the plugin in `FlipperClient`.
|
|
|
|
```java
|
|
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
|
|
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
```
|
|
|
|
2. Use the following API to trigger your custom crash notification.
|
|
|
|
```java
|
|
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
|
|
CrashReporterPlugin.getInstance().sendExceptionMessage(Thread.currentThread(), error);
|
|
```
|