Skip to content

Demonstrate how to use IsCrashedLastRun in the MAUI Android sample #4048

Open

Description

@jamescrosswell

While initiating Sentry for MAUI the options.CrashedLastRun is always null. Maybe the following line is run later?
options.CrashedLastRun = () => JavaSdk.Sentry.IsCrashedLastRun()?.BooleanValue() is true;

I know iOS implementation has the feature added to the sample, could the android sample also be updated to expose how CrashedLatRun should be interpreted in the consumer code?

*Originally posted by @dalux-era in *#4044

Ideally we'd use this in conjunction with the new User Feedback API to prompt users for feedback when crashes occur. We can do this currently - it would be even better if we could get the id of the event that crashed the app though. See feature request in the Android SDK for this:

Activity

  1. jurganson commented on Apr 4, 2025

    @jurganson

    This could be very nice to have documented. As of now, I can't see a way to access this information with the current implementation, as the IsCrashedLastRun delegate gets set up doing SDK initialization, which is the point where I would expect to be able to actually run it.

    Is there a way to access the delegate after it has left the SDK initialization scope?

  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Apr 4, 2025
  3. jamescrosswell commented on Apr 7, 2025

    @jamescrosswell
    CollaboratorAuthor

    @aritchie I think you played around with this already right?

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Apr 7, 2025
  5. aritchie commented on Apr 7, 2025

    @aritchie
    Contributor

    @jamescrosswell A little bit. This was more to do with OnCrashedLastRun event on iOS (and OnBeforeSend). Unfortunately, on android, the native SDK doesn't have a OnCrashedLastRun to bind to

  6. jamescrosswell commented on Apr 8, 2025

    @jamescrosswell
    CollaboratorAuthor

    Unfortunately, on android, the native SDK doesn't have a OnCrashedLastRun to bind to

    Yes I saw that. There's an open issue in the repo for the Java SDK (referenced in the description above). If we had that functionality we could build a more sophisticated sample for Android.

    Regarding the query @jurganson had, we may need to look for any samples for this functionality in the Java SDK repository and check to ensure we can replicate the same when the .NET SDK is wrapping this.

    @aritchie if you're spread too thin to investigate this, maybe something @Flash0ver could look into? This is closely related to the CaptureFeedback APIs...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeDocsGood First IssueGood for newcomers

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions