Setting Crash SDK

1. Detailed setting

Setting the collection server

Clients who have selected an installation-type must perform this setting.

The collection server can be set separately, which sends data to be collected by the IMQA Crash framework. Basically, no separate settings are required for clients using SaaS.

Objective-C

AppDelegate.m
NSString* imqaUrl = @"https://custom-url";
IMQACrashConfiguration* crashConfig = [[IMQACrashConfiguration alloc] initWithApiKey:PROJECT_KEY];

IMQACrashEndpointConfiguration* endpoint = [[IMQACrashEndpointConfiguration alloc] init];
endpoint.notify = [imqaUrl stringByAppendingString:@"/cocoa/crash/send"];
endpoint.sessions = [imqaUrl stringByAppendingString:@"/cocoa/session"];
crashConfig.endpoints = endpoint;

Swift

AppDelegate.swift
let imqaUrl = "https://custom-url"
let crashConfig = IMQACrashConfiguration("<PROJECT_KEY>")
crashConfig.endpoints = IMQACrashEndpointConfiguration(
                                 notify: imqaUrl + "/cocoa/crash/send",
                                 sessions: imqaUrl + "/cocoa/session")

2. Sending custom errors

IMQA Crash enables you to manually send custom errors. You can send various network errors or errors you wish to collect directly to our server using NSError for tracking.

Objective-C

AppDelegate.m
#import <IMQACrashAgent/IMQACrash.h>

NSError* custom_error = [NSError errorWithDomain:@"custom_error" code:404 userInfo:NULL];
[IMQACrash notifyError:custom_error];

Swift

AppDelegate.swift
let custom_error = NSError(domain: "custom error", code: 404, userInfo: nil)
IMQACrash.notifyError(custom_error)

3. Custom Web Crash

IMQA WebAgent lets you collect custom errors by specifying the desired error messages for detailed web error analytics.

To collect Webview Crash, you must add ImqaBridgeCrash. Please refer to 'iOS > Setting MPM SDK > Setting WKWebView > Setting iOS project'.

Create Custom Errors

IMQA WCrash detects and collects user-defined errors.

Different errors but of the same error type are recognized as the same error, which can lead to error accumulation.

Custom Error Messages

You can change the default error messages to any error messages you want and collect them by WebAgent. We recommend specifying several error messages for detailed web error analytics.

If you specify error messages, even errors of the same type will be collected as different errors.

JS files to collect custom errors
...
// When using try-catch
try {
	...
}
catch(e){
	throw new Error("Custom error messages");
}

// When to generate default errors
new Error("Custom error messages");

You can view web crashes with detailed information in the IMQA WCrash service as shown below.

❶ Caught Error Instance Type Displays the name of the caught error instance of the error if it is generated on a web page.

❷ Custom Error Message Displays a user-specified message when a specific error-type error is generated.

throw new Error("Custom error messages");

❸ Error type / Code line number You can check the type of webview error and the line number of the error.

Error typeDescription

Error

This is the error type set by the user.

EvalError

This error occurs in eval().

RangeError

This error is generated when a variable is outside its valid range.

ReferenceError

This error occurs when an incorrect reference is made.

SyntaxError

It is an error if incorrect syntax exists.

TypeError

If it is not a valid data type, it is a type error.

URIError

This error is generated when inappropriate parameters are passed to the encodeURI() or decodeURI() functions.

AggregateError

This is a type of error that wraps multiple errors into one error.

4. dSYM Settings

For apps with iOS Symbolication, you can view class names and function names through dSYM settings. See Using MPM > Project list > Project Management > ProGuard / dSYM settings.

Last updated