Dealing with this issue is no walk in the park.
It's worth noting that not all browsers support the "unhandledrejection" event just yet (check out MDN for browser compatibility). Additionally, React Native's Promises implementation comes with its own way of handling unhandled rejections (details can be found here).
If you're keen on having this functionality (I was eager for it too!), one option is to use a JS Promise library that includes it. A great example is Bluebird. Just keep in mind that you'd need to ensure every Promise in your app uses this specific implementation.
To demonstrate, within the index.js file of your React Native app:
import Promise from 'bluebird';
// Opting for the "Bluebird" lib for Promises due to its strong performance
// and inclusion of the "unhandledrejection" event:
global.Promise = Promise;
// Catching globally any unhandled Promise rejections:
global.onunhandledrejection = function onunhandledrejection(error) {
// Note: When operating in "remote debug" mode (JS environment is Chrome browser),
// this handler is triggered again by Bluebird with a custom "dom-event".
// We must distinguish this scenario:
if (error instanceof Error) {
logError(error); // Incorporate your customized error logging/reporting method
}
};