react-native-exception-handler icon indicating copy to clipboard operation
react-native-exception-handler copied to clipboard

setNativeExceptionHandler is not working

Open Balajisivakumar92 opened this issue 4 years ago • 2 comments

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);

Balajisivakumar92 avatar May 27 '20 11:05 Balajisivakumar92

Probably duplicate of #124 .

pz250089 avatar Apr 26 '21 10:04 pz250089

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.

Nesh108 avatar Oct 26 '21 14:10 Nesh108