Bugsnag now supports Code Push for React Native
What you CANNOT use CodePush for:
- Code that touches the native side of React Native. These changes will require an App Store update.
- Updates that impact the overall purpose of your app (via Apple’s Developer agreement), so keep it within reason.
What you CAN use CodePush for:
How does Code Push integrate with Bugsnag?
codeBundleId (like a version for Code Push), and send us the source maps associated with that
codeBundleId. Bugsnag will link the errors you send, with the associated source maps, so it’s easy to see what line of code caused the error.
Before you deploy, the
codeBundleId gets defined in your Bugsnag configuration.
const config = new Configuration('YOUR_API_KEY_HERE'); config.codeBundleId = '1.0-123' const bugsnag = new Client(config);
When you release your app, specify the
--outputDir in order to capture the source map and asset bundle files for upload.
code-push release-react <appName> <platform> --outputDir <outputDir> <other options>
And finally, send Bugsnag your source maps, making sure to include the
codeBundleId and source map path.
$ curl https://upload.bugsnag.com/ \ -F apiKey=YOUR_API_KEY_HERE \ -F codeBundleId=1.0-123 \ -F minifiedUrl="main.jsbundle" \ -F sourceMap=@path/to/main.jsbundle.map \ -F minifiedFile=@path/to/main.jsbundle \ -F overwrite=true -F */index.ios.js=@/workspace/app/index.ios.js
For a full rundown of each of these steps, make sure to check out the Bugsnag docs. We hope this new support is useful as more and more of you continue to roll out React Native apps.
🚀 Bugsnag is hiring! · https://www.bugsnag.com/jobs/