gpt4 book ai didi

ios - 要求在 ios 中发送崩溃报告?

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:01:53 26 4
gpt4 key购买 nike

我正在为一个项目编写代码,由于某些隐私问题,我无法使用多个崩溃报告工具。因此,如果在没有第三方报告工具参与的情况下发生崩溃,我正在寻找管理具有崩溃报告的发送电子邮件。

最佳答案

在您的应用程序委托(delegate)中声明 API,如:

void uncaughtExceptionHandler(NSException * exception)
{
// Here you can:
// 1. Set some boolean in user defaults that app crashed.
// 2. Dump this data (below) in some file in documents directory.

NSLog(@"Uncaught Exception: %@", exception.reason);
NSLog(@"CrashSymbols: %@", exception.callStackSymbols);
}

然后在“application:didFinishLaunchingWithOptions:”中设置:

NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);

然后,当您的应用程序下次启动时,如果在用户默认值中设置了 bool 值 (1),请读取此数据 (2) 并发送电子邮件。

关于ios - 要求在 ios 中发送崩溃报告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29085909/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com