Monday, January 26, 2015

Features Available in Crittercism That we use less

Loggin Transactions

Transactions allows companies to track key interactions or user flows in their app such as login, account registration and in app purchase. By default, the SDK will automatically track application load time as a transaction. A developer can specify additional transactions by adding a few more lines of code to the application. 

Developers must add code to specify where a transaction starts and where it ends. Below is an example of tracking transactions 

[Crittercism beginTransaction:@“Login”];
BOOL didLogin = [self runMyLoginCode];
if(didLogin)
{
[Crittercism endTransaction:@“Login”];
}
else 
{
[Crittercism failTransaction:@“Login”];
}

Transaction can be nested. But transaction with the same group cannot be multiple. A transaction group is identified by the name given in the beginTransaction method. 

to end the transaction, code can use the endTransaction API. To modify the value of transaction, one can use setValue:forTransaction valueForTransaction 

Logging Breadcrumbs
Developers can use leaveBreadcrumb method to write to a chronological log that is reported with the crashes and handled exceptions 

A breadcrumb is a developer-defined text string upto 140 characters that allows developers to capture app runtime information. 

[Crittercism leaveBreadcrubmb:@“User reached login screen”]; 

by default the breadcrumbs are written on to the file immediately. in order to force the breadcrumbs to use the background thread, below method can be called 

[Crittercism setAsyncBreadcrumbMode:YES]

Handled Exceptions
Application can use logHandledException method to track NSException that do not cause a crash. An example is like below 

@try 
{
[NSException raise:NSINvalidArgumentException format:@“foo must not be nil”];
}
@catch (NSException *exception)
{
[Crittercism logHandledException:exception];
}

Logging Errors 
for logging errors, use logError method. Error may be used for tracking NSError errors returned by the Apple and 3rd party library errors. 

Handling Offline Crashes
library caches upto 3 crashes on the device when offline. But this value can be altered using the setMaxOfflineCrashReports method. 

Detecting that a Crash occurred
CrittercismDelegate protocol gives a method, below method can be overridden 

- (void) crittercismDidCrashOnLastLoad
{
}


 References:
http://docs.crittercism.com/ios/ios.html

No comments:

Post a Comment