YMMYandexMetricaPlugins protocol

Extension for YMMYandexMetrica. Used for sending errors from plugins.

You can get an object instance by calling the YMMYandexMetrica#getPluginExtension method. One object instance will be created.

To use the protocol, initialize the library using the activateWithConfiguration method.

Instance methods

-reportUnhandledException:onFailure:

Sends an unhandled error.

-reportError:message:onFailure:

Sends a custom error message.

-reportErrorWithIdentifier:message:details:onFailure:

Sends a custom error message with the ID.

-handlePluginInitFinished

Notifies AppMetrica that plugin initialization has completed.

-reportUnhandledException:onFailure:

Sends an unhandled error.

-reportError:message:onFailure:

Sends a custom error message.

-reportErrorWithIdentifier:message:details:onFailure:

Sends a custom error message with the ID.

-handlePluginInitFinished

Notifies AppMetrica that plugin initialization has completed.

Method descriptions

reportUnhandledException:onFailure:


- (void)reportUnhandledException:(YMMPluginErrorDetails *)errorDetails
                       onFailure:(nullable void (^)(NSError *error))onFailure

Sends an unhandled error.

Parameters:
errorDetails Instance with error description.
onFailure The block that is executed when an error occurs. The error is passed as a block argument.
errorDetails Instance with error description.
onFailure The block that is executed when an error occurs. The error is passed as a block argument.

reportError:message:onFailure:


- (void)reportUnhandledException:(YMMPluginErrorDetails *)errorDetails
                       onFailure:(nullable void (^)(NSError *error))onFailure
            

Sends a custom error message.

Errors are grouped by backtrace.

Parameters:
errorDetails

Instance with error description.

message

Description or name of the error.

onFailure

The block that is executed when an error occurs. The error is passed as a block argument.

errorDetails

Instance with error description.

message

Description or name of the error.

onFailure

The block that is executed when an error occurs. The error is passed as a block argument.

Note. To pass the error, don't leave the stacktrace empty.

reportError:message:details:onFailure:


- (void)reportErrorWithIdentifier:(NSString *)identifier
                          message:(nullable NSString *)message
                          details:(nullable YMMPluginErrorDetails *)errorDetails
                        onFailure:(nullable void (^)(NSError *error))onFailure

Sends a custom error message with the ID. The ID is used to group errors.

Parameters:
identifier

ID used for grouping.

The maximum length is 300 characters.

If the value exceeds the limit, AppMetrica truncates it.

message

Description or name of the error.

The maximum length is 1000 characters.

If the value exceeds the limit, AppMetrica truncates it.

errorDetails

Instance with error description.

onFailure

The block that is executed when an error occurs. The error is passed as a block argument.

identifier

ID used for grouping.

The maximum length is 300 characters.

If the value exceeds the limit, AppMetrica truncates it.

message

Description or name of the error.

The maximum length is 1000 characters.

If the value exceeds the limit, AppMetrica truncates it.

errorDetails

Instance with error description.

onFailure

The block that is executed when an error occurs. The error is passed as a block argument.

handlePluginInitFinished

- (void)handlePluginInitFinished

Notifies AppMetrica that plugin initialization has completed.

Plugins must call this method in order for AppMetrica to process sessions correctly.

The method must be called immediately after initialization if the app is in the foreground session.