接入feedback view,差评的功能还未实现

This commit is contained in:
bluesea 2024-04-12 16:34:31 +08:00
parent 69fee51f46
commit 1e4e9874d5
7 changed files with 42 additions and 5 deletions

View File

@ -16,6 +16,7 @@ class UserInfo: NSObject {
var paymentProductIdentifier:String? //id
var isMemberShip:Bool {
get {
return true
return paymentState
}
}

View File

@ -8,7 +8,8 @@
import UIKit
import AVKit
import AVFoundation
import Firebase
import FirebaseCore
class ExternalSceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@ -37,12 +38,19 @@ class ExternalSceneDelegate: UIResponder, UIWindowSceneDelegate {
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
print("ExternalSceneDelegate sceneDidDisconnect")
Analytics.logEvent("equipment_disconnect", parameters: nil)
FeedbackView.show {//
} negativeCallback: {//
}
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
print("ExternalSceneDelegate sceneDidBecomeActive")
Analytics.logEvent("equipment_connect", parameters: nil)
}

View File

@ -55,6 +55,11 @@ class MembershipVC: BaseController {
psubscribeBtn?.isEnabled = false
}
FeedbackView.show {//
} negativeCallback: {//
}
}
}

View File

@ -44,6 +44,12 @@ class VRPhotoTransformController: BaseController {
pv.transformActionBlock = {//
pv.isHidden = true
Analytics.logEvent("result_continue_click", parameters: nil)
FeedbackView.show {//
} negativeCallback: {//
}
}
return pv
}()

View File

@ -71,6 +71,11 @@ class VRVideoTransformController: BaseController {
pv.transformActionBlock = {//
pv.isHidden = true
Analytics.logEvent("result_continue_click", parameters: nil)
FeedbackView.show {//
} negativeCallback: {//
}
}
return pv
}()

View File

@ -7,6 +7,7 @@
import Foundation
import UIKit
import StoreKit
class FeedbackView: UIView {
var scenterBgView:UIView?
var alphaBgView:UIView?
@ -122,6 +123,10 @@ class FeedbackView: UIView {
return
}
praiseCallback()
guard let kw = KWindow else {
return
}
SKStoreReviewController.requestReview(in: kw.windowScene!)
}
@objc func negativeAction(sender:UIButton) {
@ -145,6 +150,12 @@ class FeedbackView: UIView {
}
class func show(praiseCallback:@escaping ()->Void,negativeCallback:@escaping ()->Void) {
let hasShowFeedback = UserDefaults.standard.bool(forKey: "khasShowFeedbackKey")
if hasShowFeedback {
return
}
let fbView = FeedbackView(frame: .zero)
fbView.praiseCallback = praiseCallback
fbView.negativeCallback = negativeCallback
@ -156,6 +167,8 @@ class FeedbackView: UIView {
}
KWindow?.layoutIfNeeded()
fbView.show()
UserDefaults.standard.set(true, forKey: "khasShowFeedbackKey")
UserDefaults.standard.synchronize()
}
@objc func hiddenSelf() {

View File

@ -6,8 +6,7 @@
//
import UIKit
import Firebase
import FirebaseCore
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
@ -26,14 +25,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
print("sceneDidDisconnect")
Analytics.logEvent("equipment_disconnect", parameters: nil)
}
func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
print("sceneDidBecomeActive")
Analytics.logEvent("equipment_connect", parameters: nil)
}
func sceneWillResignActive(_ scene: UIScene) {