Reputation: 6891
I was using Xamarin Insights until recently. I removed it from my project because it increases start up time and app size significantly. So I was left with 2 options Hockeyapp and Mobile Center from Microsoft. Problem with these 2 is that they dont have any reporting functionality for reporting caught exceptions typically what you would do inside your try catch in your xamarin forms project.
Very disappointing indeed.
xamarin insight had this and it worked fine. I would like to ask how can we report exceptions in forms project? is application insight an option. I used in other .net projects but UI is not so usable indeed.
There is even a thread on github here
https://github.com/Microsoft/ApplicationInsights-Xamarin/issues/26
Microsoft is saying that we are working on it for a year or more and never delivers anything and keeps deprecating things.
Upvotes: 0
Views: 675
Reputation: 107
We use Mobile Center for reporting issues. Basically in each catch statement we use a static class to report issues, like so:
public static class EventTrace
{
public static void Trace(string menuName, string actionName, Dictionary<string, string> parameters = null)
{
try
{
Dictionary<string, string> tmp;
if (parameters != null)
tmp = new Dictionary<string, string>(parameters);
else
tmp = new Dictionary<string, string>();
tmp.Add("GUID", MobileCenter.InstallId.ToString());
Analytics.TrackEvent(menuName + " - " + actionName, tmp);
}
catch (Exception ex)
{
Analytics.TrackEvent("Event Trace - Error creating event", new Dictionary<string, string> { { "Exception", ex.ToString() } });
Analytics.TrackEvent(menuName + " - " + actionName, parameters);
}
}
public static void Error(string menuName, string exception)
{
var parameters = new Dictionary<string, string> { { "Exception", exception } };
var tmp = new Dictionary<string, string>(parameters);
try
{
tmp.Add("GUID", MobileCenter.InstallId.ToString());
Analytics.TrackEvent(menuName + " - Error", tmp);
}
catch (Exception ex)
{
Analytics.TrackEvent("Event Trace - Error creating event", new Dictionary<string, string> { { "Exception", ex.ToString() } });
Analytics.TrackEvent(menuName + " - Error", parameters);
}
}
}
We have events for tracing, and events for catch error. In mobile center, we can basically search for the "Error" statement in the event tab.
It works for us, hope it works for you!
Upvotes: 3