0
votes

I try to use HockeyApp on a iOS project with xamarin forms.

It's working fine on android, but I can't get it working on iOS.

Here's my AppDelegate code for HockeyApp:

var manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("----");
manager.CrashManager.Init();
manager.LogLevel = BITLogLevel.Verbose;
manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
manager.StartManager();
manager.Authenticator.AuthenticateInstallation(); 

if (BITHockeyManager.SharedHockeyManager.CrashManager.DidCrashInLastSession)
{
    runInSafeMode = true;
    Thread.Sleep(5000);
}

Then, later in my code I throw an NotYetImplementedException.

The exception is correctly catched and send to the server on android, but I can't get it working on iOS.

BITHockeyManager.SharedHockeyManager.CrashManager.DidCrashInLastSession is always false.

I also tried without the debugger attached as I read that the debugger catch exception before the SDK, still not working.

Any ideas ?

EDIT : Additional informations

I tried Visual Studio Mobile Center, working fine on android, same issue with iOS, HasCrashedInLastSessionAsync always to false

I moved the throw exception outside of the main method, just in case of, still the same problem, exception looks like not detected by the API

I disabled the debugging in addition of not attaching the debugger, I also tried to compile in Release, nothing new.

I removed the call to Init and AuthenticateInstallation, still the same problem.

1
Try removing manager.CrashManager.Init() and manager.Authenticator.AuthenticateInstallation(). I also do not set the LogLevel but that should not hurt anything. I believe manager.Authenticator stuff is only needed if you plan to do stuff other than exception handling and analytics.hvaughan3
@hvaughan3, thanks for the reply, I tried without them without success, still not getting DidCrashInLastSession to true.Emmanuel Istace
And the crashes are not showing up in the Hockey App site portal after relaunching the app? (You must relaunch the app after an unhandled exception crashes the app for the exception to show up)hvaughan3
@hvaughan3 no and more important DidCrashInLastSession remains to false. So the next time my application boot, she can't boot in safe mode to allow the SDK to send the exception. I tried Visual Studio Mobile Center and I have the exact same problem, everything looks like correct but when I read Crashes.HasCrashedInLastSessionAsync() it's set to false. Whenever with or without the debugger attached. It almost looks like the unhandled exception is not caught by SDK.Emmanuel Istace
You are not catching the exceptions right? Not sure how it would work on Android if you were but just wanted to make sure. I cannot imagine what else would cause problems other than maybe the iOS Linker which you could try disabling to rule that out.hvaughan3

1 Answers

0
votes

Where do you put your Hockey Init code?

I got it working with global::Xamarin.Forms.Forms.Init(); after the Hockey Init in my FinishedLaunching method.

Something like this:

var manager = BITHockeyManager.SharedHockeyManager;
...
manager.StartManager();
global::Xamarin.Forms.Forms.Init();