Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appcenter GetLastSessionCrashReportAsync equivalent for Xamarin #514

Open
rezamohamed opened this issue Apr 10, 2020 · 9 comments
Open

Appcenter GetLastSessionCrashReportAsync equivalent for Xamarin #514

rezamohamed opened this issue Apr 10, 2020 · 9 comments
Assignees
Labels
enhancement Denotes SDK enhancement related task question
Projects

Comments

@rezamohamed
Copy link

Does Rollbar have an equivalent to Appcenter's GetLastSessionCrashReportAsync for a Xamarin Forms app? I am trying to not have to mix-and-match Rollbar and Appcenter for crash reporting.

if (Crashes.HasCrashedInLastSessionAsync().Result)
{
    ErrorReport crashReport = Crashes.GetLastSessionCrashReportAsync().Result;
    if (crashReport.Exception == null)
        Analytics.TrackEvent("AppCrashedInLastLaunch: Crash Report Exception is Null");
    else
    {
        Crashes.TrackError(crashReport.Exception);
        var dict = new Dictionary<string, string>();
        dict.Add("CrashId", crashReport.Id);
        dict.Add("StackTrace", crashReport.Exception.StackTrace);
        Analytics.TrackEvent(string.Format("AppCrashedInLastLaunch: " + crashReport.Exception.Message), dict);
    }
}
@akornich akornich self-assigned this Apr 14, 2020
@akornich akornich added this to To do in 2020-Q2 via automation Apr 14, 2020
@akornich
Copy link
Contributor

akornich commented Apr 14, 2020

Hi @rezamohamed , no we do not have explicit/automated support for reporting mobile app crashes at the moment. It was in a discussion at some point but since we did not have any user requests for it (until now) it was shelved until then. I'll bring the conversation up again.

Meanwhile, since we do support sending custom data with our payloads, you can add any data field of the crashReport object as a custom data to a payload while seeding the payload itself from the crashReport.Exception property (I assume the property is of System.Exception type). You can use our exception packager to pack the exception and then decorate it with the custom data package decorator. Then, you send the resulting package over to Rollbar (like you normally send any other error/payload) either instead of or side-by-side with the TrackEvent call on Analytics.

Let me know if my assumptions here are wrong, I am sure we most likely can find for now workable alternative via the custom data.

@akornich
Copy link
Contributor

hi @rezamohamed, i just wanted to check on the status of this item. are you unblocked for now?

@rezamohamed
Copy link
Author

What do you mean unblocked? from your last reply, it sounded like the CatchLastException feature is not currently available but could possibly be in your future roadmap

@akornich
Copy link
Contributor

Right, but as a short-term solution, i suggested:

Meanwhile, since we do support sending custom data with our payloads, you can add any data field of the crashReport object as a custom data to a payload while seeding the payload itself from the crashReport.Exception property (I assume the property is of System.Exception type). You can use our exception packager to pack the exception and then decorate it with the custom data package decorator. Then, you send the resulting package over to Rollbar (like you normally send any other error/payload) either instead of or side-by-side with the TrackEvent call on Analytics.

Would work for you meantime?

@rezamohamed
Copy link
Author

rezamohamed commented Apr 27, 2020

It's still unclear how I can check if the application crashed last, and then get that crash exception. Delivery doesn't seem to be the problem, I am just not sure what the Rollbar equivalent, if it exists for

if (Crashes.HasCrashedInLastSessionAsync().Result)
{
ErrorReport crashReport = Crashes.GetLastSessionCrashReportAsync().Result;

@akornich
Copy link
Contributor

my thinking was that you can "load" the last crash via ErrorReport crashReport = Crashes.GetLastSessionCrashReportAsync().Result; and then send its exception plus some extra custom data that you need from the ErrorReport to Rollbar as an exception payload...

@rezamohamed
Copy link
Author

I gotcha, yea I was trying to move away from AppCenter Crashes all together, cause that's one more library that I would need in my mobile app.

Definitely consider it for your future rollout if possible. Handling crashes, especially unexplained crashes are super important in mobile apps.

@akornich
Copy link
Contributor

yes, we most likely will eventually address the crash reporting. but most likely not earlier than the second half of 2020. unless we see it is becoming a very popular feature request :)

@rezamohamed
Copy link
Author

I'll see if I can get a few people to like my OP :)

@akornich akornich added the enhancement Denotes SDK enhancement related task label May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Denotes SDK enhancement related task question
Projects
2020-Q2
  
To do
Development

No branches or pull requests

2 participants