Hello
I am using Google Analytics
in one of my iPhone app
. I am tracking the app installations, screen visits and click events.
Now, I want to track the crashes & exceptions
in the app with reason and its location(by location, I mean method name, line number or anything else). I have read the the document provided by google, but didn't get anything useful.
Can anyone help me with this? Any example would be really appreciated.
Update:- Here, I am attaching the screenshot link of GA dashboard.
You can send the backtrace (already symbolicated). I set sendUncaughtExceptions = FALSE and manually send.
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]];
(model and version is optional)
The backtrace will have < redacted > but the most important class and method will be symbolicate (where the crash occurred) and you will know where is
** EDIT **
How handle exception
I have not used the Google Analytics crash reporting feature yet, but found this which could be helpful.
You can have Google Analytics(v2) report uncaught exceptions i.e. crashes by using this code
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GAI sharedInstance].sendUncaughtExceptions = YES; // Enable
// ... the rest of your code, include other GAI properties you want to set.
}
I don't think these will be symbolicated crash reports as the device is unable to symbolicate it. So you may have to symbolicate the received crash reports by yourself to understand the line number in code which caused this crash.
Check out Where can I view the Google Analytics iOS crash logs?
Refer: Symbolicating iPhone App Crash Reports
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With