Prechádzať zdrojové kódy

fix:优化弹窗的样式的和弹窗条件。

“HeShaoZe” 4 mesiacov pred
rodič
commit
3963600a9b

+ 5 - 1
QuickSearchLocation/Classes/Common/Tool/QSLGravityManager.swift

@@ -37,7 +37,11 @@ class QSLGravityManager {
         let version = QSLApi.params["appVersionCode"] as? Int ?? 100
         
         instance?.initializeGravityEngine(withAsaEnable: true, withCaid1: "", withCaid2: "", withSyncAttribution: true, withChannel: "AppStore", withSuccessCallback: { response in
-            print("gravity engine initialize success, response is", response)
+            print("gravity engine initialize success, response is---", response)
+            
+            if let clickCom = response["click_company"] as? String {
+                QSLGuideusersToCommentManager.commentShare.clickCompanyChannel = clickCom
+            }
             
             // 检查订单
             QSLBaseManager.shared.initPayCheck()

+ 23 - 10
QuickSearchLocation/Classes/Common/Tool/QSLGuideusersToCommentManager.swift

@@ -16,6 +16,9 @@ class QSLGuideusersToCommentManager: NSObject {
     
     static let commentShare = QSLGuideusersToCommentManager()
     
+    //归因渠道
+    public var clickCompanyChannel : String = ""
+    
     var guideGobalModel: QSLGuideIsTriggeredModel = QSLGuideIsTriggeredModel()
     var commentType: QSLGuideusersToCommentType = .member
     private var timer: Timer?
@@ -87,8 +90,11 @@ class QSLGuideusersToCommentManager: NSObject {
             let guideIsModel: QSLGuideIsTriggeredModel = response.mapObject(QSLGuideIsTriggeredModel.self, modelKey: "data")
             self.commentType = showType
             self.guideGobalModel = guideIsModel
-            if guideIsModel.trigger {
-                if showType == .member {
+            if guideIsModel.trigger  && self.areThisTwoChannel(){
+                DispatchQueue.main.async {
+                    self.noMemberPositiveReviewPopWindow()
+                }
+                /*if showType == .member {
                     DispatchQueue.main.async {
                         self.memberPositiveReviewPopWindow()
                     }
@@ -96,12 +102,20 @@ class QSLGuideusersToCommentManager: NSObject {
                     DispatchQueue.main.async {
                         self.noMemberPositiveReviewPopWindow()
                     }
-                }
+                }*/
             }
         } fail: { code, msg in
         }
     }
     
+    //判断是不是这两个渠道 ASA渠道和自然流量两个渠道
+    func areThisTwoChannel() -> Bool {
+        if self.clickCompanyChannel == "Apple Search Ads" || self.clickCompanyChannel == "natural" {
+            return false
+        }
+        return true
+    }
+    
     ///领取好评引导奖励请求
     func requestForReceivingGoodReviewGuidance() {
         QSLNetwork().request(.guideReceiveReward(dict: [String: Any]())) { response in
@@ -156,13 +170,13 @@ extension QSLGuideusersToCommentManager {
         inputtr.append(titleTwoAttr)
         
         if let currentWindow = UIApplication.keyWindow {
-            QSLVipAlertView.alert(view: currentWindow, title: "", titleAttring: inputtr, content: "你的一条五星好评是我们前进的动力", isOneBtn: true, oneBtnText: "立即好评", oneBtnClosure:  { [weak self] in
+            QSLVipAlertView.alert(view: currentWindow, title: "", titleAttring: inputtr, content: "你的一条五星好评是我们前进的动力", isOneBtn: true, oneBtnText: "立即好评", oneBtnClosure:  {
                 // 同步调用
                 QSLInAppReviewmanager.requestReview()
                 
-                DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                /*DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                     self?.requestForReceivingGoodReviewGuidance()
-                }
+                }*/
             })
         }
     }
@@ -186,15 +200,14 @@ extension QSLGuideusersToCommentManager {
         inputtr.append(titleOneAttr)
         
         if let currentWindow = UIApplication.keyWindow {
-            QSLVipAlertView.alert(view: currentWindow, title: "", titleAttring: inputtr, content: "我们将回馈用户更多的优惠福利", isOneBtn: true, oneBtnText: "立即好评", oneBtnClosure:  { [weak self] in
-                
+            QSLVipAlertView.alert(view: currentWindow, title: "", titleAttring: inputtr, content: "我们将回馈用户更多的优惠福利", isOneBtn: true, oneBtnText: "立即好评", oneBtnClosure: {
                 // 同步调用
                 QSLInAppReviewmanager.requestReview()
                 
                 // 延迟1秒执行
-                DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+                /*DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
                     self?.requestForReceivingGoodReviewGuidance()
-                }
+                }*/
                 //self?.requestAddFri()
             })
         }