From 48dcfcb1670c363e56f39fad9e9249a56b99a196 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Mon, 17 Oct 2022 17:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86bugly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Podfile | 1 + Podfile.lock | 6 ++++- .../Appdelegate/AppDelegate+ThirdConfig.m | 26 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Podfile b/Podfile index 5b49a51b..bfc3a132 100644 --- a/Podfile +++ b/Podfile @@ -60,6 +60,7 @@ target 'xplan-ios' do pod 'QGVAPlayer' pod 'IQKeyboardManager', '~> 6.5.5' pod 'TZImagePickerController' + pod 'Bugly' #上传音乐 pod 'CocoaAsyncSocket',:modular_headers => true #调试 diff --git a/Podfile.lock b/Podfile.lock index 0fd0a919..fac03e41 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -16,6 +16,7 @@ PODS: - AFNetworking/NSURLSession - AgoraRtcEngine_iOS (3.0.1.1) - Base64 (1.1.2) + - Bugly (2.5.93) - CocoaAsyncSocket (7.6.5) - FFPopup (1.1.5) - HappyDNS (0.3.17) @@ -91,6 +92,7 @@ DEPENDENCIES: - AFNetworking - AgoraRtcEngine_iOS (~> 3.0.1) - Base64 + - Bugly - CocoaAsyncSocket - FFPopup - IAPHelper @@ -128,6 +130,7 @@ DEPENDENCIES: SPEC REPOS: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git: + - Bugly - CocoaAsyncSocket - IQKeyboardManager - JXPagingView @@ -177,6 +180,7 @@ SPEC CHECKSUMS: AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce AgoraRtcEngine_iOS: 8ccceaaecff2e80ab28fcd33f3dfd2b417eb5365 Base64: cecfb41a004124895a7bcee567a89bae5a89d49b + Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 FFPopup: a208dcee8db3e54ec4a88fcd6481f6f5d85b7a83 HappyDNS: 848ef73e24f2b0e2752064223ce2dc0dd88900ea @@ -215,6 +219,6 @@ SPEC CHECKSUMS: YYText: 5c461d709e24d55a182d1441c41dc639a18a4849 YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928 -PODFILE CHECKSUM: 45b39f2f1f2dc3c34a960cba0c8214df5d55635c +PODFILE CHECKSUM: 833fe89266071153d9c69e0146aa9051398bd8a0 COCOAPODS: 1.11.3 diff --git a/xplan-ios/Appdelegate/AppDelegate+ThirdConfig.m b/xplan-ios/Appdelegate/AppDelegate+ThirdConfig.m index bdc07cef..8ea2a710 100644 --- a/xplan-ios/Appdelegate/AppDelegate+ThirdConfig.m +++ b/xplan-ios/Appdelegate/AppDelegate+ThirdConfig.m @@ -11,6 +11,7 @@ #import #import #import +#import ///Tool #import "XPConstant.h" #import "CustomAttachmentDecoder.h" @@ -27,6 +28,7 @@ UIKIT_EXTERN NSString * kYinyouPrivateKey; [self configNIMSDK]; [self configUMengSDK]; [self initEmojiData]; + [self configBugly]; } - (void)configShareSDK { @@ -62,6 +64,30 @@ UIKIT_EXTERN NSString * kYinyouPrivateKey; [[UIApplication sharedApplication] registerForRemoteNotifications]; } + +/** + 崩溃收集 Bugly + */ +- (void) configBugly { + + BuglyConfig *config = [[BuglyConfig alloc] init]; + config.channel = @"App Enterprise"; + config.blockMonitorEnable = YES; // 卡顿监控开关,默认关闭 + config.blockMonitorTimeout = 5; + config.unexpectedTerminatingDetectionEnable = YES; // 非正常退出事件记录开关,默认关闭 + +#ifdef DEBUG + config.debugMode = YES; // debug 模式下,开启调试模式 + config.reportLogLevel = BuglyLogLevelVerbose; // 设置打印日志级别 + [Bugly startWithAppId:@"bb158b9965" config:config]; +#else + config.debugMode = NO; // release 模式下,关闭调试模式 + config.reportLogLevel = BuglyLogLevelWarn; // 设置自定义日志上报的级别,默认不上报自定义日志 + [Bugly startWithAppId:@"bb158b9965" config:config]; +#endif + +} + #pragma mark - 友盟SDK - (void)configUMengSDK { // 只有同意过了隐私协议 才初始化