-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Sentry directly in native code #813
Comments
I would also like to know how to use Sentry directly in Java code when integrated to the React Native SDK. Now I just get this:
|
In Android/Java, I had to change the import to In iOS, I simpy do The initialization with dsn is done in RN code by calling |
Hi everyone, I joined Sentry after this issue was made so I didn't see it until now, sorry! Yes that is correct. On Android it is You do not call init from native code otherwise it might not work with the React Native SDK, although this does mean that any errors before the JS code calls init will not be caught, and calling any methods from the native SDK before calling init would not work. |
OS:
Platform:
SDK:
@sentry/react-native
react-native-sentry
SDK version: 1.3.3
react-native
version: 0.60.5Are you using Expo?
Are you using sentry.io or on-premise?
I think it is possible to use Sentry directly from the native code in your react-native project, but this doesn't seem to be mentioned anywhere in the docs.
I'd like to be able to e.g. add breadcrumbs and capture exception, directly in Objective-C code.
I assume that when installing Sentry for react-native, it installs Sentry for Cocoa.
However, when I try and initialise Sentry in AppDelegate.m, with:
Xcode says "Module 'Sentry' not found"
What is the correct way to use react-native Sentry directly from (iOS) native code?
Thanks
The text was updated successfully, but these errors were encountered: