wenweiwei 3 年之前
父节点
当前提交
c6e1284d1a

+ 0 - 4
BFFramework.podspec

@@ -63,10 +63,6 @@ TODO: Add long description of the pod here.
     s.dependency 'LMJHorizontalScrollText' ,'2.0.2'
     s.dependency 'Bugly','2.5.71' # 奔溃分析组件
     s.dependency "NXFramework-Swift"
-    s.dependency 'UMCommon','7.2.9'
-    s.dependency 'UMDevice','1.2.0'
-    s.dependency 'UMCSecurityPlugins','1.0.6'
-    s.dependency 'UMAPM','1.2.1'
 
     # s.dependency 'KingfisherWebP','0.4.2' # 加载WebP格式图片库 使用https://github.com/webmproject/libwebp.git地址可以不翻
 end

+ 2 - 2
BFFramework/Classes/BFFramework_custom_umbrella.h

@@ -17,6 +17,6 @@
 #import "LMJHorizontalScrollText/LMJHorizontalScrollText.h"
 #import "FBShimmeringView.h"
 #import "UIControl+NXCategory.h"
-#import <UMCommon/UMCommon.h>
-#import <UMCommon/MobClick.h>
+//#import <UMCommon/UMCommon.h>
+//#import <UMCommon/MobClick.h>
 #endif /* AliyunOSSiOS_Bridging_Header */

+ 2 - 0
BFFramework/Classes/Utils/PQBFConfig.swift

@@ -11,6 +11,8 @@ public class PQBFConfig: NSObject {
     public static let shared = PQBFConfig()
     // 主题色
     public var styleColor: styleColor = .green
+    // 微信登陆信息
+    public var appInfo: WXApiInfo?
     // 渠道
     public let channelID: String = "AppStore"
     // 友盟账号 快乐星球:60b9fa644d0228352bbc8937 闪音:60b9f95b4d0228352bbc87e0

+ 9 - 75
BFFramework/Classes/Utils/PQThirdPlatformUtil.swift

@@ -11,7 +11,6 @@ import Kingfisher
 import UIKit
 import UserNotifications
 import WechatOpenSDK
-
 // MARK: - 第三方相关工具类
 
 /// 第三方相关工具类
@@ -20,22 +19,20 @@ public class PQThirdPlatformUtil: NSObject {
     // 注册第三方
     func register() {
         // 注册微信
-        PQSingletoWXApiUtil.shared.registerApp()
+        PQSingletoWXApiUtil.shared.registerApp(appInfo: PQBFConfig.shared.appInfo)
         // 注册bugly
         PQSingleBuglyUtil.shared.register()
-        // 注册友盟
-        PQUMApiUtil.register()
     }
 
     override private init() {
         super.init()
     }
 
-    override func copy() -> Any {
+    public override func copy() -> Any {
         return self
     }
 
-    override func mutableCopy() -> Any {
+    public override func mutableCopy() -> Any {
         return self
     }
 }
@@ -51,7 +48,6 @@ public class PQSingleBuglyUtil: NSObject {
         buglyConfig.reportLogLevel = .warn
         #if DEBUG
             buglyConfig.version = versionName + ".6666"
-            PQLog(message: "Bugly版本号:\(BuglyConfig.version())")
         #else
             if PQENVUtil.shared.envMode == .ENVModeOnline {
                 buglyConfig.version = versionName + "." + versionCode
@@ -62,7 +58,7 @@ public class PQSingleBuglyUtil: NSObject {
             }
         #endif
         buglyConfig.channel = PQBFConfig.shared.channelID
-        buglyConfig.deviceIdentifier = PQLoginUserInfo.shared.isLogin() ? PQLoginUserInfo.shared.uid : getMachineCode()
+        buglyConfig.deviceIdentifier = BFLoginUserInfo.shared.isLogin() ? BFLoginUserInfo.shared.uid : getMachineCode()
         buglyConfig.unexpectedTerminatingDetectionEnable = true
         buglyConfig.blockMonitorEnable = true
         buglyConfig.blockMonitorTimeout = 2
@@ -108,8 +104,11 @@ public class PQSingletoWXApiUtil: NSObject {
     // 回调
     public var wxApiUtilHander: ((_ userData: [String: Any]?, _ errorMsg: String?) -> Void)?
     var mAppInfo: WXApiInfo = WXApiInfo()
-    public func registerApp(appInfo: WXApiInfo) {
-        mAppInfo = appInfo
+    public func registerApp(appInfo: WXApiInfo?) {
+        if appInfo == nil {
+            return
+        }
+        mAppInfo = appInfo!
         #if DEBUG
             WXApi.startLog(by: .detail) { msg in
                 BFLog(message: "微信回调Log--\(msg)")
@@ -355,68 +354,3 @@ extension PQSingletoWXApiUtil: WXApiDelegate {
         }
     }
 }
-
-// MARK: - 友盟相关工具类
-
-/// 友盟相关工具类
-class PQUMApiUtil: NSObject {
-    class func register() {
-        // 注册友盟
-        UMConfigure.setEncryptEnabled(true)
-        // 初始化友盟所有组件产品
-        UMConfigure.initWithAppkey(PQBFConfig.shared.umAppkey, channel: PQBFConfig.shared.channelID)
-        #if DEBUG
-            UMConfigure.setLogEnabled(true)
-        #endif
-        PQLog(message: "友盟版本号:\(UMConfigure.version())")
-    }
-}
-
-// MARK: - 统计分析工具类
-
-/// 统计分析工具类
-class PQAnalyticsUtil: NSObject {
-    /// 页面时长统计
-    /// - Parameters:
-    ///   - pageName: 页面名称
-    ///   - isBegin: 开始/结束
-    /// - Returns: <#description#>
-    class func pageAutoTimeAnalytics(pageName: String?, isBegin: Bool) {
-        if pageName == nil || pageName?.count ?? 0 <= 0 {
-            return
-        }
-        PQLog(message: "页面时长统计:isBegin = \(isBegin),pageName = \(pageName ?? "")")
-        if isBegin {
-            MobClick.beginLogPageView(pageName)
-        } else {
-            MobClick.endLogPageView(pageName)
-        }
-    }
-
-    /// 事件统计
-    /// - Parameters:
-    ///   - eventId: 事件ID
-    ///   - attributes: 事件属性
-    /// - Returns: <#description#>
-    class func eventAnalytics(eventId: String?, attributes: [String: Any]?) {
-        if eventId == nil || eventId?.count ?? 0 <= 0 {
-            return
-        }
-        PQLog(message: "自定义事件统计:eventId = \(eventId ?? ""),attributes = \(attributes ?? [:])")
-        if attributes != nil && attributes?.count ?? 0 > 0 {
-            MobClick.event(eventId!, attributes: attributes!)
-        } else {
-            MobClick.event(eventId!)
-        }
-    }
-
-    /// 账号统计
-    /// - Returns: <#description#>
-    class func accountAnalytics() {
-        if PQLoginUserInfo.shared.accessToken.count > 0 {
-            MobClick.profileSignIn(withPUID: PQLoginUserInfo.shared.accessToken, provider: cPrimarykey)
-        } else {
-            MobClick.profileSignOff()
-        }
-    }
-}