Reputation: 18923
What my requirement is wherever app crashes anywhere while functioning user should get push notification after some delay of time (like 10 mins after). To detect crash throughout the app i use Firebase crash analytics and Sentry both.
I came to know that using Sentry i can do it. But overall it is not working. Here is my code
import {AppRegistry, Text, TextInput} from 'react-native';
import App from './App';
import React from 'react';
import {name as appName} from './app.json';
import messaging from '@react-native-firebase/messaging';
import CleverTap from 'clevertap-react-native';
import * as Sentry from '@sentry/react-native';
import ApiUrls from './src/NetworkCalls/ApiUrls';
Sentry.init({
dsn: ApiUrls.SENTRY.URL,
environment: ApiUrls.SENTRY.ENV,
tracesSampleRate: 1.0,
});
const WrappedApp = () => (
<Sentry.ErrorBoundary
onError={(error, componentStack) => {
console.error('Error captured:', error);
console.error('Component stack:', componentStack);
}}>
<App />
</Sentry.ErrorBoundary>
);
AppRegistry.registerComponent(appName, () => WrappedApp);
In code i wrapped my main App component in Sentry.ErrorBoundary but onError is not getting called while i receive any error in app by using for e.g. throw new Error("Test Error") on any button press button.
Also is it possible that can i manage it through sentry dashboard as per user wise?
Upvotes: 0
Views: 26