Skip to content

Commit

Permalink
Add manually enableCrashlyticsCollection docs (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
timwangdev authored and Salakar committed Dec 1, 2018
1 parent 9aa8259 commit 35302e9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_sidebar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@
- to: "/android"
text: Install on Android
icon: android
- to: "/manual-initialization"
text: Manual Initialization
- type: divider
- type: reference
files:
Expand Down
32 changes: 32 additions & 0 deletions docs/crashlytics/manual-initialization.md
Original file line number Diff line number Diff line change
@@ -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
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
```

## 2) Enable collection at runtime

Initializing Crashlytics in your js code:

```js
firebase.crashlytics().enableCrashlyticsCollection();
```
5 changes: 5 additions & 0 deletions docs/crashlytics/reference/crashlytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ Set the user ID to show alongside any subsequent crash reports.
| Parameter | |
| --------- | --- |
| userId | **string** <br /> The user's ID. |

### enableCrashlyticsCollection
[method]enableCrashlyticsCollection() returns void;[/method]

Enable Crashlytics reporting. Only avaliable when [disabled automatic initialization](../manual-initialization).

0 comments on commit 35302e9

Please sign in to comment.