react-native-exception-handler
react-native-exception-handler copied to clipboard
setNativeExceptionHandler is not working
const nativeExceptionhandler = exceptionString => { fetch('URL', { method: 'post', headers: { accept: 'application/json', 'content-type': 'application/json', "Authorization": "Basic " + btoa(<API Key>" + ":x") }, body: JSON.stringify({ email: "MailID", // UserName == UserEmail description: JSON.stringify('errorString'), subject: JSON.stringify('errorString'), priority: 1, status: 2 }), }).then((r) => { console.log(r, r.status, r.ok) }).catch((e) => { console.log(e) }) };
setNativeExceptionHandler(nativeExceptionhandler, true);
Probably duplicate of #124 .
For me, on Android, I need to use this to get it to work:
setNativeExceptionHandler(nativeExceptionHandler, false);
If I use true
, the code is not executed for some reason.