Skip to content

Commit

Permalink
fix(crashlytics): convert internal API usage to modular
Browse files Browse the repository at this point in the history
previously the handler accessed analytics using the namespaced API
  • Loading branch information
mikehardy committed Feb 19, 2025
1 parent 5a29425 commit 179de2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/crashlytics/lib/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
*/

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

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

// Notify analytics, if it exists - throws error if not
try {
await firebase.app().analytics().logEvent(
await logEvent(

Check warning on line 99 in packages/crashlytics/lib/handlers.js

View check run for this annotation

Codecov / codecov/patch

packages/crashlytics/lib/handlers.js#L99

Added line #L99 was not covered by tests
getAnalytics(),
'app_exception', // 'app_exception' is reserved but we make an exception for JS->fatal transforms
{
fatal: 1, // as in firebase-android-sdk
Expand Down

0 comments on commit 179de2c

Please sign in to comment.