我正在Objective-C应用程序中实现App Center SDK,并且我需要实现崩溃报告发送的确认。微软在其指南中提供的解决方案通常可以使用(https://docs.microsoft.com/en-us/appcenter/sdk/crashes/ios),但在我的应用程序中,在application:didFinishLaunchingWithOptions:方法执行完之后,将显示主视图(在启动过程中,显示加载屏幕),该窗口会关闭带有确认的警报。] >
我已经尝试过将performSelectorOnMainThread:withObject:waitUntilDone与waitUntilDone上的YES一起使用-它不起作用。
如果我尝试以另一种方法来实现此警报(不在application:didFinishLaunchingWithOptions中:)-警报不会出现。
UI阻塞“ while”循环(等待答案)会导致崩溃。
这里是Microsoft的默认解决方案,该解决方案无法按我的要求运行。
[MSCrashes setUserConfirmationHandler:(^(NSArray<MSErrorReport *> *errorReports) { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"crash" message:@"message" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* sendAction = [UIAlertAction actionWithTitle:@"Send" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [MSCrashes notifyWithUserConfirmation:MSUserConfirmationSend]; }]; [alertController addAction:sendAction]; alertController.preferredAction = sendAction; [alertController addAction:[UIAlertAction actionWithTitle:@"Always send" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [MSCrashes notifyWithUserConfirmation:MSUserConfirmationAlways]; }]]; [alertController addAction:[UIAlertAction actionWithTitle:@"Don't send" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [MSCrashes notifyWithUserConfirmation:MSUserConfirmationDontSend]; }]]; [self.window.rootViewController presentViewController:alertController animated:YES completion:nil]; return YES; })]
我希望用户在发送报告之前或不发送报告之前能够思考自己想要的时间,但是在应用程序启动完成并显示新的(应用程序主视图)后,警报会消失。
没有人遇到这个问题吗?您是如何解决的?
我正在Objective-C应用程序中实现App Center SDK,并且我需要实现崩溃报告发送的确认。微软在其指南中提供的解决方案通常可以正常使用(https:// docs ....
已解决。