BugSnag supports applications that use Microsoft App Center CodePush. BugSnag’s configuration and usage is mostly the same as in a normal React Native app, but there are some differences which are specified on this page.
BugSnag includes both native and JS code. Due to the fact the new JS code can be shipped to an old native app with CodePush, to keep the native and JS code in sync, we recommend locking the version of @bugsnag/react-native
in your package.json
.
If you allow newer versions of BugSnag’s JS code to be rolled out without a native update, it may not be compatible and could crash your app.
When you update BugSnag, ensure that you re-build and re-deploy the iOS and Android binaries as you would with any other dependencies that contain native code.
With a typical React Native app, a single version appVersion
is all BugSnag needs to uniquely idenfity what version is running and what source maps to apply. A CodePush app is different, because the same native version of the app can receive multiple JS bundles.
For this reason, when using CodePush, you should define a code bundle ID in your JS configuration:
Bugsnag.start({ codeBundleId: '1.0.0-b12'})
This identifier can be any string as long as it matches what you provided to the source map uploader. You should increment it every time you release a new version of your app with CodePush.
See the CodePush examples in the React Native build integration guide.