浏览代码

1.移除bugly

wenweiwei 3 年之前
父节点
当前提交
326fb907d5

+ 0 - 1
BFFramework.podspec

@@ -61,7 +61,6 @@ TODO: Add long description of the pod here.
     s.dependency 'MJRefresh','3.5.0' # 刷新组件
     s.dependency 'FDFullscreenPopGesture' ,'1.1'
     s.dependency 'LMJHorizontalScrollText' ,'2.0.2'
-    s.dependency 'Bugly','2.5.71' # 奔溃分析组件
     s.dependency 'TXLiteAVSDK_Player','8.4.9944' # 腾讯播放器组件
     s.dependency "NXFramework-Swift"
     s.dependency 'KingfisherWebP','0.4.2' # 加载WebP格式图片库 使用https://github.com/webmproject/libwebp.git地址可以不翻

+ 2 - 2
BFFramework/Classes/Base/Controller/PQBaseViewController.swift

@@ -69,14 +69,14 @@ public class PQBaseViewController: UIViewController, UIGestureRecognizerDelegate
         leftButton(image: "icon_detail_back")
     }
 
-    func leftButton(image: String?,tintColor:UIColor? = nil) {
+    func leftButton(image: String?, tintColor: UIColor? = nil) {
         let leftButton = UIButton(type: .custom)
         leftButton.frame = CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: cDefaultMargin * 4, height: cDefaultMargin * 4)
         leftButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: -5, right: 0)
         if tintColor != nil {
             leftButton.tintColor = tintColor
             leftButton.setImage(UIImage().BF_Image(named: image ?? "icon_detail_back").withRenderingMode(.alwaysTemplate), for: .normal)
-        }else{
+        } else {
             leftButton.setImage(UIImage().BF_Image(named: image ?? "icon_detail_back"), for: .normal)
         }
         leftButton.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)

+ 7 - 11
BFFramework/Classes/Base/Controller/PQBaseWebViewController.swift

@@ -17,7 +17,7 @@ public class PQBaseWebViewController: PQBaseViewController {
         emptyData.emptyImage = "pic_network"
         return emptyData
     }()
- 
+
     lazy var webView: WKWebView = {
         let config: WKWebViewConfiguration = WKWebViewConfiguration()
         config.allowsInlineMediaPlayback = true
@@ -54,7 +54,7 @@ public class PQBaseWebViewController: PQBaseViewController {
     @objc var baseTitle: String?
     public var evaluateJavaScript: String? // 交互
     var isAddObserve: Bool = false
-   open override func viewDidLoad() {
+    override open func viewDidLoad() {
         super.viewDidLoad()
         // Do any additional setup after loading the view.
         view.addSubview(webView)
@@ -62,14 +62,14 @@ public class PQBaseWebViewController: PQBaseViewController {
         navHeadImageView?.backgroundColor = UIColor.white
     }
 
-    public override func viewWillAppear(_ animated: Bool) {
+    override public func viewWillAppear(_ animated: Bool) {
         super.viewWillAppear(animated)
         if (UIApplication.shared.keyWindow?.viewWithTag(cProtocalViewTag)) != nil {
             (UIApplication.shared.keyWindow?.viewWithTag(cProtocalViewTag))?.isHidden = true
         }
     }
 
-    public override func viewWillDisappear(_ animated: Bool) {
+    override public func viewWillDisappear(_ animated: Bool) {
         super.viewWillDisappear(animated)
         if (UIApplication.shared.keyWindow?.viewWithTag(cProtocalViewTag)) != nil {
             (UIApplication.shared.keyWindow?.viewWithTag(cProtocalViewTag))?.isHidden = false
@@ -100,7 +100,7 @@ extension PQBaseWebViewController: WKNavigationDelegate {
         }
     }
 
-    public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
+    override public func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
         if keyPath == "estimatedProgress" {
             progresslayer.opacity = 1
             let float = (change?[NSKeyValueChangeKey.newKey] as! NSNumber).floatValue
@@ -130,7 +130,6 @@ extension PQBaseWebViewController: WKNavigationDelegate {
             webView.evaluateJavaScript(evaluateJavaScript!) { _, _ in
             }
         }
-     
     }
 
     public func webView(_ webView: WKWebView, didFail _: WKNavigation!, withError error: Error) {
@@ -141,12 +140,9 @@ extension PQBaseWebViewController: WKNavigationDelegate {
                 self?.baseTitle = any as? String
             }
         }
-     
     }
 
-    public func webView(_: WKWebView, didFailProvisionalNavigation _: WKNavigation!, withError _: Error) {
-   
-    }
+    public func webView(_: WKWebView, didFailProvisionalNavigation _: WKNavigation!, withError _: Error) {}
 
     public func webView(_: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) {
         BFLog(message: "navigationResponse:\(String(describing: navigationResponse))")
@@ -177,7 +173,7 @@ extension PQBaseWebViewController: WKNavigationDelegate {
 //        BFLog(message: "decidePolicyFor \(String(describing: navigationAction))")
 //        decisionHandler(.allow)
 //    }
-    public override var preferredStatusBarStyle: UIStatusBarStyle {
+    override public var preferredStatusBarStyle: UIStatusBarStyle {
         if #available(iOS 13.0, *) {
             return .darkContent
         } else {

+ 6 - 6
BFFramework/Classes/Base/Controller/PQPhotoAlbumController.swift

@@ -11,8 +11,8 @@ import UIKit
 /// 相册集
 class PQPhotoAlbumController: PQBaseViewController {
     var selectedHandle: ((_ selectedData: PQUploadModel?) -> Void)? // 选中/取消选中的回调
-    var isTopShow : Bool = false // 是否显示在顶部
-    
+    var isTopShow: Bool = false // 是否显示在顶部
+
     var categoryH: CGFloat = cDefaultMargin * 26 // 相簿高度
     var albaumsData: [PQUploadModel] = Array<PQUploadModel>.init()
     let itemSize = CGSize(width: ((cScreenWidth - cDefaultMargin) / 3) * UIScreen.main.scale, height: ((cScreenWidth - cDefaultMargin) / 3) * UIScreen.main.scale)
@@ -189,8 +189,8 @@ extension PQPhotoAlbumController {
                 self.albaumView.isHidden = true
                 self.view.isHidden = true
             }
-            
-        }else{
+
+        } else {
             albaumCollectionView.dismissViewAnimate { [weak self] _ in
                 self?.view.isHidden = true
             }
@@ -208,8 +208,8 @@ extension PQPhotoAlbumController {
                 self.albaumView.alpha = 1
             }) { _ in
             }
-           albaumCollectionView.reloadData()
-        }else{
+            albaumCollectionView.reloadData()
+        } else {
             view.isHidden = false
             albaumCollectionView.showViewAnimate()
         }

+ 5 - 3
BFFramework/Classes/Base/Controller/PQPhotoMaterialController.swift

@@ -297,7 +297,7 @@ extension PQPhotoMaterialController: UICollectionViewDelegate, UICollectionViewD
         return cell
     }
 
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+    func collectionView(_: UICollectionView, didSelectItemAt indexPath: IndexPath) {
         if photoData.count <= indexPath.item {
 //            collectionView.reloadData()
             return
@@ -306,12 +306,14 @@ extension PQPhotoMaterialController: UICollectionViewDelegate, UICollectionViewD
             detailMaterialHandle!(indexPath, photoData[indexPath.item])
         }
     }
-    func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
-        if !isAdded && !isShowMediaTag {
+
+    func collectionView(_: UICollectionView, willDisplay _: UICollectionViewCell, forItemAt _: IndexPath) {
+        if !isAdded, !isShowMediaTag {
 //            // 卡点音乐素材选择曝光上报
 //            PQEventTrackViewModel.baseReportUpload(businessType: .bt_windowView, objectType: .ot_view_selectSyncedUpMaterial, pageSource: .sp_stuck_selectMaterial, extParams: nil, remindmsg: "卡点音乐素材选择曝光上报")
         }
     }
+
     /// 点击选择的回调
     /// - Parameter materialData: <#materialData description#>
     /// - Returns: description

+ 5 - 72
BFFramework/Classes/Utils/PQThirdPlatformUtil.swift

@@ -6,77 +6,10 @@
 //  Copyright © 2020 BytesFlow. All rights reserved.
 //
 
-import Bugly
 import Kingfisher
 import UIKit
 import UserNotifications
 import WechatOpenSDK
-// MARK: - 第三方相关工具类
-
-/// 第三方相关工具类
-public class PQThirdPlatformUtil: NSObject {
-    static let shared = PQThirdPlatformUtil()
-    // 注册第三方
-    func register() {
-        // 注册微信
-        PQSingletoWXApiUtil.shared.registerApp(appInfo: PQBFConfig.shared.appInfo)
-        // 注册bugly
-        PQSingleBuglyUtil.shared.register()
-    }
-
-    override private init() {
-        super.init()
-    }
-
-    public override func copy() -> Any {
-        return self
-    }
-
-    public override func mutableCopy() -> Any {
-        return self
-    }
-}
-
-// MARK: - bugly相关工具类
-
-public class PQSingleBuglyUtil: NSObject {
-    static let shared = PQSingleBuglyUtil()
-    // 注册
-    func register() {
-        // 注册bugly
-        let buglyConfig = BuglyConfig()
-        buglyConfig.reportLogLevel = .warn
-        #if DEBUG
-            buglyConfig.version = versionName + ".6666"
-        #else
-            if PQENVUtil.shared.envMode == .ENVModeOnline {
-                buglyConfig.version = versionName + "." + versionCode
-            } else if PQENVUtil.shared.envMode == .ENVModePre {
-                buglyConfig.version = versionName + ".8888"
-            } else {
-                buglyConfig.version = versionName + ".9999"
-            }
-        #endif
-        buglyConfig.channel = PQBFConfig.shared.channelID
-        buglyConfig.deviceIdentifier = BFLoginUserInfo.shared.isLogin() ? BFLoginUserInfo.shared.uid : getMachineCode()
-        buglyConfig.unexpectedTerminatingDetectionEnable = true
-        buglyConfig.blockMonitorEnable = true
-        buglyConfig.blockMonitorTimeout = 2
-        Bugly.start(withAppId: PQBFConfig.shared.buglyAppkey, config: buglyConfig)
-    }
-
-    override private init() {
-        super.init()
-    }
-
-    override public func copy() -> Any {
-        return self
-    }
-
-    override public func mutableCopy() -> Any {
-        return self
-    }
-}
 
 // MARK: - 微信相关工具类
 
@@ -115,11 +48,11 @@ public class PQSingletoWXApiUtil: NSObject {
             }
         #endif
         WXApi.registerApp(mAppInfo.appid, universalLink: mAppInfo.universalLink)
-//        #if DEBUG
-//            WXApi.checkUniversalLinkReady { step, result in
-//                BFLog(message: "微信回调自检--\(step),result = \(result)")
-//            }
-//        #endif
+        #if DEBUG
+            WXApi.checkUniversalLinkReady { step, result in
+                BFLog(message: "微信回调自检--\(step),result = \(result)")
+            }
+        #endif
     }
 
     public func handleOpen(url: URL) -> Bool {