diff --git a/docs/_sidebar.yaml b/docs/_sidebar.yaml index 7b1bd8ee..bdad7367 100644 --- a/docs/_sidebar.yaml +++ b/docs/_sidebar.yaml @@ -223,6 +223,8 @@ - to: "/android" text: Install on Android icon: android + - to: "/manual-initialization" + text: Manual Initialization - type: divider - type: reference files: diff --git a/docs/crashlytics/manual-initialization.md b/docs/crashlytics/manual-initialization.md new file mode 100644 index 00000000..34e6e7e8 --- /dev/null +++ b/docs/crashlytics/manual-initialization.md @@ -0,0 +1,32 @@ +# Manual Initialization + +By default, Firebase Crashlytics automatically collects crash reports for all your app's users. To give users more control over the data they send, you can enable opt-in reporting instead. + +To do that, you have to disable automatic collection and initialize Crashlytics only for opt-in users. + +## 1) Disable automatic initialization + +### iOS: + +Turn off automatic collection with a new key to your `Info.plist` file: + +* Key: `firebase_crashlytics_collection_enabled` +* Value: `false` + +### Android: + +Turn off automatic collection with a meta-data tag in your `AndroidManifest.xml` file: + +```xml + +``` + +## 2) Enable collection at runtime + +Initializing Crashlytics in your js code: + +```js +firebase.crashlytics().enableCrashlyticsCollection(); +``` diff --git a/docs/crashlytics/reference/crashlytics.md b/docs/crashlytics/reference/crashlytics.md index def28ef9..01abf7cf 100644 --- a/docs/crashlytics/reference/crashlytics.md +++ b/docs/crashlytics/reference/crashlytics.md @@ -84,3 +84,8 @@ Set the user ID to show alongside any subsequent crash reports. | Parameter | | | --------- | --- | | userId | **string**
The user's ID. | + +### enableCrashlyticsCollection +[method]enableCrashlyticsCollection() returns void;[/method] + +Enable Crashlytics reporting. Only avaliable when [disabled automatic initialization](../manual-initialization). \ No newline at end of file