使用Google Analytics iOS跟踪崩溃

Piy*_*ush 5 iphone crash google-analytics ios

您好,
我正在使用Google Analytics其中一个iPhone app.我正在跟踪应用安装,屏幕访问和点击事件.
现在,我想crashes & exceptions在应用程序中跟踪原因及其位置(按位置,我的意思是方法名称,行号或其他任何内容).我已阅读谷歌提供的文件,但没有得到任何有用的信息.
谁能帮我这个?任何一个例子都会非常感激.


更新: - 这里,我附上了GA仪表板的屏幕截图链接.

在此输入图像描述

sil*_*ric 7

您可以发送回溯(已经符号化).我设置sendUncaughtExceptions = FALSE并手动发送.

id tracker = [[GAI sharedInstance] defaultTracker];

NSString * model = [[UIDevice currentDevice] model];
NSString * version = [[UIDevice currentDevice] systemVersion];
NSArray * backtrace = [exception callStackSymbols];
NSString * description = [NSString stringWithFormat:@"%@.%@.%@.Backtrace:%@",
                          model,
                          version,
                          exception.description,
                          backtrace];

[tracker send:[[GAIDictionaryBuilder
                createExceptionWithDescription:description  // Exception description. May be truncated to 100 chars.
                withFatal:NO] build]];     
Run Code Online (Sandbox Code Playgroud)

(型号和版本是可选的)

回溯将有<redacted>,但最重要的类和方法将是符号化的(崩溃发生的地方),你会知道在哪里

**编辑**

如何处理异常

  1. 详细说明
  2. 下载示例"UncaughtExceptions.zip"
  3. UncaughtExceptionHandler.m上,在方法" handleException:(NSException*)exception "中你可以做你想要的,在我的情况下,我有其他方法来验证异常,然后发送到GAI

  • 我正在使用这个:http://www.cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html - 下载示例"UncaughtExceptions.zip"和"handleException:(NSException*)exception"你可以打电话给你想要的 (2认同)