sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

`Sentry.crashedLastRun` in React Native

Open krystofwoldrich opened this issue 2 years ago • 8 comments

Description

The native SDK can give users information about crashedLastRun but RN SDK doesn't have such a feature. It might be useful for RN devs too.

Some user patched this feature in their app like this, but it's not working in the last RN SDK version.

RCT_EXPORT_METHOD(didCrashLastLaunch:(RCTPromiseResolveBlock)resolve
                  rejecter:(RCTPromiseRejectBlock)reject)
{
    if ([SentrySDK crashedLastRun]) {
        resolve(@YES);
    } else {
        resolve(@NO);
    }
}

krystofwoldrich avatar Jan 30 '23 10:01 krystofwoldrich

I don't think we have this feature on the Android SDK tho, so let's confirm and raise an issue on the Android SDK as well if needed.

marandaneto avatar Jan 30 '23 12:01 marandaneto

I think this PR added it

  • https://github.com/getsentry/sentry-java/pull/1739

krystofwoldrich avatar Jan 30 '23 15:01 krystofwoldrich

Indeed, ok, that was more than a year ago :D

marandaneto avatar Jan 30 '23 15:01 marandaneto

Hello, I was trying to use the isCrashedLastRun on Android with Kotlin but it didn't work.

Is it still not implemented?

Thank you for your answers.

MikaReesu avatar Oct 19 '23 08:10 MikaReesu

@MikaReesu Hi, thank you for the message, this is not implemented in RN yet.

Only in the native SDKs (cocoa, java) at the moment.

krystofwoldrich avatar Oct 23 '23 10:10 krystofwoldrich

I see, thank you.

MikaReesu avatar Oct 24 '23 09:10 MikaReesu

This would be quite helpful!

LonelyCpp avatar Jun 15 '24 08:06 LonelyCpp

@LonelyCpp Thanks for letting us know you're interested.

krystofwoldrich avatar Jun 17 '24 09:06 krystofwoldrich