-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43063 from ShridharGoel/associate-info
Associate crashes with user info
- Loading branch information
Showing
11 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
import Button from '@components/Button'; | ||
import TestToolRow from '@components/TestToolRow'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import testCrash from '@libs/testCrash'; | ||
import firebase from '../../../firebase.json'; | ||
|
||
/** | ||
* Adds a button in native dev builds to test the crashlytics integration with user info. | ||
*/ | ||
function TestCrash() { | ||
const {translate} = useLocalize(); | ||
|
||
const isCrashlyticsDebugEnabled = firebase?.['react-native']?.crashlytics_debug_enabled ?? false; | ||
|
||
const toolRowTitle = translate('initialSettingsPage.troubleshoot.testCrash'); | ||
|
||
return ( | ||
<View> | ||
{isCrashlyticsDebugEnabled ? ( | ||
<TestToolRow title={toolRowTitle}> | ||
<Button | ||
small | ||
text={toolRowTitle} | ||
onPress={testCrash} | ||
/> | ||
</TestToolRow> | ||
) : null} | ||
</View> | ||
); | ||
} | ||
|
||
export default TestCrash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
|
||
function TestCrash() { | ||
return <View />; | ||
} | ||
|
||
export default TestCrash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import crashlytics from '@react-native-firebase/crashlytics'; | ||
|
||
const setCrashlyticsUserId = (accountID: string | number) => { | ||
crashlytics().setUserId(accountID.toString()); | ||
}; | ||
|
||
export default setCrashlyticsUserId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const setCrashlyticsUserId = (_: string | number) => {}; | ||
export default setCrashlyticsUserId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import crashlytics from '@react-native-firebase/crashlytics'; | ||
|
||
const testCrash = () => { | ||
crashlytics().crash(); | ||
}; | ||
export default testCrash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const testCrash = () => {}; | ||
export default testCrash; |