整合 Bugly 相关功能,新增 BuglyManager 类以统一管理 Bugly 配置和错误上报,优化 AppDelegate 中的 Bugly 配置逻辑。同时,更新多个模块以使用 BuglyManager 进行错误上报,提升代码可维护性和一致性。新增 BuglyManager 使用说明文档,提供详细的使用示例和功能介绍。
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Bugly/Bugly.h>
|
||||
#import "BuglyManager.h"
|
||||
|
||||
#import "Api+Gift.h"
|
||||
|
||||
@@ -790,19 +791,17 @@ NSString * const kBoomStateForceResetNotification = @"BoomStateForceResetNotific
|
||||
self.errorMessage = [NSString stringWithFormat:@"服务器繁忙,请稍后重试 - %@", msg];
|
||||
#else
|
||||
self.errorMessage = @"Over Heat & try later";
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
NSMutableDictionary *logDic = [@{@"targetUids": allUIDs,
|
||||
@"giftNum": self.giftNumPerTimes} mutableCopy];
|
||||
[logDic addEntriesFromDictionary:dic];
|
||||
[logDic setObject:[NSThread callStackSymbols] forKey:@"call stack symbols"];
|
||||
[logDic setObject:msg forKey:@"error message"];
|
||||
[logDic setObject:@"gift/sendV5" forKey:@"http method"];
|
||||
[Bugly reportError:[NSError errorWithDomain:[NSString stringWithFormat:@"UID: %@,API: %@ 异常",
|
||||
[AccountInfoStorage instance].getUid,
|
||||
@"gift/sendV5"]
|
||||
code:code
|
||||
userInfo:logDic]];
|
||||
});
|
||||
// 使用 BuglyManager 统一上报礼物发送错误
|
||||
NSString *uid = [AccountInfoStorage instance].getUid ?: @"未知用户";
|
||||
NSMutableDictionary *userInfo = [@{@"targetUids": allUIDs,
|
||||
@"giftNum": self.giftNumPerTimes} mutableCopy];
|
||||
[userInfo addEntriesFromDictionary:dic];
|
||||
[userInfo setObject:msg forKey:@"error message"];
|
||||
|
||||
[[BuglyManager sharedManager] reportNetworkError:uid
|
||||
api:@"gift/sendV5"
|
||||
code:code
|
||||
userInfo:userInfo];
|
||||
#endif
|
||||
// 临时错误,不重置连击状态,允许用户重试
|
||||
} else if (code == 31005) {
|
||||
|
@@ -20,6 +20,7 @@
|
||||
///P
|
||||
#import "XPGiftProtocol.h"
|
||||
#import <Bugly/Bugly.h>
|
||||
#import "BuglyManager.h"
|
||||
|
||||
@interface XPGiftPresenter ()
|
||||
///
|
||||
|
Reference in New Issue
Block a user