This documentation is for the original BugSnag React Native SDK. We recommend upgrading to the React Native package that is now part of the Universal JavaScript SDK using our Upgrade guide. Documentation for the latest release can be found here.
While the default integration guide is suitable for apps using React Native as the primary development layer, it may not be suitable for all applications. This guide details the manual steps for linking BugSnag with native apps and adopting React Native incrementally.
If your project is ineligible for using react-native link
, you can complete
the following steps to create a fully linked React Native project.
android/app/build.gradle
: dependencies {
implementation project(':bugsnag-react-native')
}
android/settings.gradle
: include ':app'
// must be after `include ':app'`
include ':bugsnag-react-native'
project(':bugsnag-react-native').projectDir = new File(rootProject.projectDir,
'../node_modules/bugsnag-react-native/android')
android/{...}/MainApplication.java
: import com.bugsnag.BugsnagReactNative;
// ...
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(), BugsnagReactNative.getPackage()
);
}
build.gradle
: allprojects {
repositories {
maven { url 'https://maven.google.com' }
}
}
ios/[project].xcodeproj
in Xcode and, using Finder, drag
node_modules/bugsnag-react-native/cocoa/BugsnagReactNative.xcodeproj
into
the Libraries
group, alongside React Native and other dependencies.libz.tbd
and libBugsnagReactNative.a
to Link Binary
With Libraries.$(inherited) $(SRCROOT)/../node_modules/bugsnag-react-native/cocoa/**