Deployo Agent for React Native
This package makes it easy for you to handle errors in your production applications and provides you with extensive information for debugging.
Install
npm install --save deployo-agent-rn
OR
yarn add deployo-agent-rn
Usage
In App.js you will need to take exp as a prop and pass it to deployo along with a callback function. The callback functions recieves the error message and stack trace, along with an object containing device information.
With the callback function you can do whatever you choose, i.e. post to an API to log error or flash a message to the user
import React from 'react';
import useDeployo from 'deployo-agent-rn';
export default function App({exp}) {
const deployo = useDeployo(exp, (error, stackTrace, deviceInfo) => {
console.log(error)
console.log(stackTrace)
console.log(deviceInfo)
});
return (
...
);
}
You can also return a dump of the device info by calling bundleDeviceInfo()
import React from 'react';
import {bundleDeviceInfo} from 'deployo-agent-rn';
console.log(await bundleDeviceInfo());