Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将崩溃日志自动发送到Xamarin.iOS中的HokeyApp,并提供额外信息?_Ios_Xamarin_Xamarin.ios_Hockeyapp - Fatal编程技术网

如何将崩溃日志自动发送到Xamarin.iOS中的HokeyApp,并提供额外信息?

如何将崩溃日志自动发送到Xamarin.iOS中的HokeyApp,并提供额外信息?,ios,xamarin,xamarin.ios,hockeyapp,Ios,Xamarin,Xamarin.ios,Hockeyapp,我正在使用Hockeyapp记录Xamarin应用程序中的崩溃情况。 对于Android,我使用这段代码自动提交崩溃信息,几乎没有额外信息: 内部main活动OnCreate方法: public class CustomCrashListener : CrashManagerListener { public override bool ShouldAutoUploadCrashes() { return true; } public overr

我正在使用Hockeyapp记录Xamarin应用程序中的崩溃情况。
对于Android,我使用这段代码自动提交崩溃信息,几乎没有额外信息:
内部main活动OnCreate方法:

public class CustomCrashListener : CrashManagerListener
{
    public override bool ShouldAutoUploadCrashes()
    {
        return true;
    }

    public override string UserID => "UserID recovered from settings.";
    public override string Contact => "More info from settings.";
    public override string Description => "Custom Description";
}
BITHockeyManager manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("APP_ID");
manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
manager.StartManager();
manager.Authenticator.AuthenticateInstallation();
CrashManager.Register(此“应用程序ID”,新的CustomCrashListener())

CustomCrashListener:

public class CustomCrashListener : CrashManagerListener
{
    public override bool ShouldAutoUploadCrashes()
    {
        return true;
    }

    public override string UserID => "UserID recovered from settings.";
    public override string Contact => "More info from settings.";
    public override string Description => "Custom Description";
}
BITHockeyManager manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("APP_ID");
manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
manager.StartManager();
manager.Authenticator.AuthenticateInstallation();
现在,对于iOS,我发现这会导致自动上传崩溃:

内部AppDelegate:

public class CustomCrashListener : CrashManagerListener
{
    public override bool ShouldAutoUploadCrashes()
    {
        return true;
    }

    public override string UserID => "UserID recovered from settings.";
    public override string Contact => "More info from settings.";
    public override string Description => "Custom Description";
}
BITHockeyManager manager = BITHockeyManager.SharedHockeyManager;
manager.Configure("APP_ID");
manager.CrashManager.CrashManagerStatus = BITCrashManagerStatus.AutoSend;
manager.StartManager();
manager.Authenticator.AuthenticateInstallation();

我的问题是,我在iOS中找不到类似于Android的东西,无法通过自动发送崩溃日志来发送一些额外的小信息,在iOS中有什么方法可以做到这一点吗?

在您的
uiapplicationedegate
类中,添加
IBITHockeyManagerDelegate
和/或
IBITCrashManagerDelegate

UIApplicationLegate示例: 将其分配给您的
BITHockeyManager。委派
:
实施所需的额外信息方法:

Ref:

我尝试了这个
hockeyManager.Delegate=(HockeyApp.iOS.BITHockeyManagerDelegate)(IBITHockeyManagerDelegate)这个但获取了无效的强制转换异常。然后我试着像这样做安全强制转换
(IBITHockeyManagerDelegate)这个作为HockeyApp.iOS.BITHockeyManagerDelegate但未按预期获得任何信息。注意:代理将在下一个应用程序启动时调用,而不是在崩溃时调用@Kerni是的,我知道这一点,我总是在崩溃后再次启动我的应用程序,在Hokeyapp上检查它。我能够使用您的答案使它工作,但我改变了一件事,而不是调用
hockeyManager.Delegate=(HockeyApp.iOS.BITHockeyManagerDelegate)(IBITHockeyManagerDelegate)这个
我将委托添加到Configure方法中,如下所示:
manager.Configure(HOCKEYAPP\u APP\u ID,this)