Skip to content

Commit b462330

Browse files
committed
fix(crashlytics): convert internal API usage to modular
previously the handler accessed analytics using the namespaced API
1 parent 5a29425 commit b462330

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/crashlytics/lib/handlers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*
1616
*/
1717

18-
import { firebase } from '@react-native-firebase/app';
1918
import { isError, once } from '@react-native-firebase/app/lib/common';
19+
import { getAnalytics, logEvent } from '@react-native-firebase/analytics';
2020
import tracking from 'promise/setimmediate/rejection-tracking';
2121
import StackTrace from 'stacktrace-js';
2222

@@ -96,7 +96,8 @@ export const setGlobalErrorHandler = once(nativeModule => {
9696

9797
// Notify analytics, if it exists - throws error if not
9898
try {
99-
await firebase.app().analytics().logEvent(
99+
await logEvent(
100+
getAnalytics(),
100101
'app_exception', // 'app_exception' is reserved but we make an exception for JS->fatal transforms
101102
{
102103
fatal: 1, // as in firebase-android-sdk

0 commit comments

Comments
 (0)