AMAAppMetricaPluginReporting 协议

The AMAAppMetricaPluginReporting 协议是 AMAAppMetricaCrashReporting 的扩展。

通过在 AMAAppMetricaCrashReporting 中调用 pluginExtension 方法,可以获取实现 AMAAppMetricaPluginReporting 的对象实例。

One AMAAppMetricaPluginReporting实例为每个报告者创建。 您可以每次都申请,也可以保存参考信息以供后续使用。

Instance methods

-reportUnhandledException:onFailure:

发送未处理的错误消息。

-报告错误:消息:失败时:

发送错误消息。

-报告错误带标识符:消息:详情:失败时:

发送一个包含简短描述的错误消息。

Method descriptions

-reportUnhandledException:onFailure:

- (void)reportUnhandledException:(AMAPluginErrorDetails *)errorDetails
                       onFailure:(nullable void (^)(NSError *error))onFailure
reportUnhandledException(exception:onFailure:);

发送关于未处理错误的消息。 要获取更多信息,请查看AMAPluginErrorDetails。

参数:

errorDetails

描述错误的对象。

OnFailure

若在发送消息时发生错误,要调用的回调方法。 错误作为参数传递。

-报告错误:消息:失败时:

- (void)reportError:(AMAPluginErrorDetails *)errorDetails
            message:(nullable NSString *)message
          onFailure:(nullable void (^)(NSError *error))onFailure
reportError(error:message:onFailure:);

发送自定义错误消息。 错误按回溯分组。 要更改分组参数,请使用 -reportErrorWithIdentifier:message:details:onFailure:。 要获取更多信息,请查看AMAPluginErrorDetails。

参数:

errorDetails

包含错误详情的对象。

message

简短的错误描述。

OnFailure

若在发送消息时发生错误,要调用的回调方法。 错误作为参数传递。

-报告错误标识符:消息:详情:失败时:

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

发送一个包含简短描述的错误消息。 错误按传入的 ID 分组。 要使用 backtrace 对它们进行分组,请使用 -reportError:message:onFailure: 方法。 要了解更多信息,请查看AMAPluginErrorDetails。

参数:

identifier

用于分组的ID。

message

简短的错误描述。

errorDetails

包含错误详情的对象。

OnFailure

若在发送消息时发生错误,要调用的回调方法。 该错误作为参数传递。