Closed YanCorey closed 3 years ago
自定义附件数据?
///上报自定义异常信息,data为文本附件
///Android 错误分析=>跟踪数据=>extraMessage.txt
///iOS 错误分析=>跟踪数据=>crash_attach.log
static Future<Null> uploadException(
{@required String message, @required String detail, Map data}) async {
var map = {};
map.putIfAbsent("crash_message", () => message);
map.putIfAbsent("crash_detail", () => detail);
if (data != null) map.putIfAbsent("crash_data", () => data);
await _channel.invokeMethod('postCatchedException', map);
}
这是不是你要的?
不知道哎 我看文档setCrashHandleCallback这个是初始化前调用的 问下uploadException能实现自定义crash的路径吗?
Android 端,能添加个setCrashHandleCallback不? UserStrategy strategy = new UserStrategy(appContext); strategy.setCrashHandleCallback(new CrashReport.CrashHandleCallback() { public Map<String, String> onCrashHandleStart(int crashType, String errorType, String errorMessage, String errorStack) { LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(); map.put("Key", "Value"); return map; }
}); CrashReport.initCrashReport(appContext, APPID, true, strategy);