فهرست منبع

[feat]添加键盘跳转主客户端逻辑

Destiny 7 ماه پیش
والد
کامیت
7fbd9eb053

+ 4 - 0
ios/AiKeyboard/Info.plist

@@ -2,6 +2,10 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>LSApplicationQueriesSchemes</key>
+	<array>
+		<string>com.qihuan.zhuiaijianpan</string>
+	</array>
 	<key>ITSAppUsesNonExemptEncryption</key>
 	<false/>
 	<key>NSAppTransportSecurity</key>

+ 92 - 8
ios/AiKeyboard/KeyboardViewController.swift

@@ -66,6 +66,15 @@ class KeyboardViewController: UIInputViewController {
         return animate
     }()
     
+    lazy var heartLabel: UILabel = {
+       
+        let label = UILabel()
+        label.text = "30%"
+        label.font = .boldSystemFont(ofSize: 10)
+        label.textColor = .white
+        return label
+    }()
+    
     lazy var exchangeBtn: UIButton = {
         
         let button = UIButton()
@@ -184,10 +193,21 @@ class KeyboardViewController: UIInputViewController {
     lazy var menuView: KeyboardMenuView = {
         
         let view = KeyboardMenuView()
+        view.isHidden = true
         view.delegate = self
         return view
     }()
     
+    lazy var loginView: KeyboardLoginTipView = {
+       
+        let view = KeyboardLoginTipView()
+        view.isHidden = true
+        view.loginBtnClosure = {
+            self.navigateToLogin()
+        }
+        return view
+    }()
+    
     var nowShowView: UIView?
     
     override func viewWillAppear(_ animated: Bool) {
@@ -346,6 +366,10 @@ extension KeyboardViewController {
             self.view.toast(text: error)
             print(error)
             complete("")
+            
+            if code == 1006 {
+                self.popLoginView()
+            }
         }
     }
     
@@ -368,6 +392,10 @@ extension KeyboardViewController {
             self.view.toast(text: error)
             print(error)
             complete([String]())
+            
+            if code == 1006 {
+                self.popLoginView()
+            }
         }
     }
     
@@ -388,6 +416,10 @@ extension KeyboardViewController {
             self.view.toast(text: error)
             print(error)
             complete([String]())
+            
+            if code == 1006 {
+                self.popLoginView()
+            }
         }
     }
 }
@@ -407,12 +439,7 @@ extension KeyboardViewController: KeyboardMenuViewDelegate, KeyboardExchangeView
     @objc func menuBtnClickAction() {
         
         clearPopView()
-        
-        self.view.addSubview(menuView)
-        menuView.snp.makeConstraints { make in
-            make.left.right.bottom.equalTo(0)
-            make.top.equalTo(menuBtn.snp.bottom)
-        }
+        self.menuView.isHidden = false
     }
     
     // 菜单按钮返回
@@ -422,6 +449,41 @@ extension KeyboardViewController: KeyboardMenuViewDelegate, KeyboardExchangeView
         self.nowShowView?.isHidden = false
     }
     
+    // 会员按钮点击
+    func vipBtnClickAction() {
+        
+        navigateToMembership()
+    }
+    
+    // 跳转到主应用的登录页面
+    @objc func navigateToLogin() {
+        let url = URL(string: "com.qihuan.zhuiaijianpan:///login")!
+        openURL(url)
+    }
+
+    // 跳转到主应用的会员页面
+    @objc func navigateToMembership() {
+        let url = URL(string: "com.qihuan.zhuiaijianpan:///member")!
+        openURL(url)
+    }
+
+    // 通用的打开URL方法
+    private func openURL(_ url: URL) {
+        var responder = self as UIResponder?
+        while (responder != nil && !(responder is UIApplication)) {
+            responder = responder?.next
+        }
+        if responder != nil {
+            let selectorOpenURL = sel_registerName("openURL:")
+            if responder!.responds(to: selectorOpenURL) {
+                responder?.perform(selectorOpenURL, with: url)
+            }
+        }
+        
+        // 不知道为什么无法使用
+//        self.extensionContext?.open(url, completionHandler: nil)
+    }
+    
     // 选择键盘按钮点击
     @objc func changeBtnClickAction() {
         
@@ -697,10 +759,17 @@ extension KeyboardViewController: KeyboardBaseViewDelegate {
 
 extension KeyboardViewController {
     
+    // 跳转登录页
+    func popLoginView() {
+        
+        self.clearPopView()
+        self.loginView.isHidden = false
+    }
+    
     // 关闭其他弹出页
     func clearPopView() {
         
-        self.menuView.removeFromSuperview()
+        self.menuView.isHidden = true
         self.exchangeView.isHidden = true
         self.helpView.isHidden = true
         self.teachView.isHidden = true
@@ -770,7 +839,6 @@ extension KeyboardViewController {
     }
     
     func setUI() {
-        
         self.view.addSubview(bgImageView)
         bgImageView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
@@ -791,6 +859,11 @@ extension KeyboardViewController {
         }
         heartAnimation.play()
         
+        self.view.addSubview(heartLabel)
+        heartLabel.snp.makeConstraints { make in
+            make.center.equalTo(heartAnimation.center)
+        }
+        
         self.view.addSubview(exchangeBtn)
         exchangeBtn.snp.makeConstraints { make in
             make.size.equalTo(CGSize(width: 34, height: 34))
@@ -830,6 +903,17 @@ extension KeyboardViewController {
             make.left.right.bottom.equalTo(0)
         }
         
+        self.view.addSubview(menuView)
+        menuView.snp.makeConstraints { make in
+            make.left.right.bottom.equalTo(0)
+            make.top.equalTo(menuBtn.snp.bottom)
+        }
+        
+        self.view.addSubview(loginView)
+        loginView.snp.makeConstraints { make in
+            make.top.left.right.bottom.equalTo(0)
+        }
+        
         chooseView.addSubview(functionView)
         functionView.snp.makeConstraints { make in
             make.top.left.equalTo(1)

+ 1 - 1
ios/AiKeyboard/Network/KeyboardApi.swift

@@ -18,7 +18,7 @@ enum NetworkEnvironment {
 
 struct KeyboardApi {
     
-    static let env: NetworkEnvironment = .dev
+    static let env: NetworkEnvironment = .prod
     
     static let localUrl = "http://192.168.10.113:8880"
     

+ 8 - 0
ios/AiKeyboard/View/PopView/KeyboardLoginTipView.swift

@@ -9,6 +9,8 @@ import UIKit
 
 class KeyboardLoginTipView: UIView {
     
+    var loginBtnClosure: (() -> ())?
+    
     lazy var bgImageView: UIImageView = {
        
         let imageView = UIImageView()
@@ -53,6 +55,7 @@ class KeyboardLoginTipView: UIView {
             btn.backgroundColor = UIColor(patternImage: image)
         }
         
+        btn.addTarget(self, action: #selector(loginBtnClickAction), for: .touchUpInside)
         return btn
     }()
     
@@ -64,6 +67,11 @@ class KeyboardLoginTipView: UIView {
     required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
+    
+    @objc func loginBtnClickAction() {
+        
+        loginBtnClosure?()
+    }
 }
 
 extension KeyboardLoginTipView {

+ 7 - 1
ios/AiKeyboard/View/PopView/KeyboardMenuView.swift

@@ -10,6 +10,8 @@ import UIKit
 protocol KeyboardMenuViewDelegate: NSObjectProtocol {
     
     func menuBackBtnClickAction()
+    
+    func vipBtnClickAction()
 }
 
 class KeyboardMenuView: UIView {
@@ -71,6 +73,7 @@ class KeyboardMenuView: UIView {
         btn.titleLabel?.textAlignment = .center
         btn.setImage(UIImage(named: "keyboard_menu_vip"), for: .normal)
         btn.setImageTitleLayout(.imgTop, spacing: 8)
+        btn.addTarget(self, action: #selector(vipBtnClickAction), for: .touchUpInside)
         return btn
     }()
     
@@ -87,9 +90,12 @@ class KeyboardMenuView: UIView {
 extension KeyboardMenuView {
     
     @objc func backBtnClickAction() {
-        self.removeFromSuperview()
         delegate?.menuBackBtnClickAction()
     }
+    
+    @objc func vipBtnClickAction() {
+        delegate?.vipBtnClickAction()
+    }
 }
 
 extension KeyboardMenuView {

+ 10 - 0
ios/KeyboardSharedDataManager.swift

@@ -38,6 +38,16 @@ class KeyboardSharedDataManager {
         sharedUserDefaults?.synchronize()
     }
     
+    // 保存亲密度
+    func saveIntimacy() {
+        
+    }
+    
+    // 获取亲密度
+    func getIntimacy() {
+        
+    }
+    
     // 检查是否已登录
     func isLoggedIn() -> Bool {
         return getToken() != nil

+ 9 - 0
ios/Podfile

@@ -27,6 +27,8 @@ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelpe
 
 flutter_ios_podfile_setup
 
+platform:ios, '13.0'
+
 target 'Runner' do
   use_frameworks!
 
@@ -63,4 +65,11 @@ post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
   end
+  installer.generated_projects.each do |project|
+    project.targets.each do |target|
+        target.build_configurations.each do |config|
+            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
+         end
+    end
+  end
 end

+ 42 - 8
ios/Podfile.lock

@@ -1,12 +1,22 @@
 PODS:
   - Alamofire (5.10.2)
+  - app_settings (5.1.1):
+    - Flutter
   - app_tracking_transparency (0.0.1):
     - Flutter
   - audio_session (0.0.1):
     - Flutter
+  - Bugly (2.6.1)
   - device_info_plus (0.0.1):
     - Flutter
   - Flutter (1.0.0)
+  - flutter_bugly (0.0.1):
+    - Bugly (= 2.6.1)
+    - Flutter
+  - flutter_umeng (0.0.1):
+    - Flutter
+  - gravity_engine (0.0.1):
+    - Flutter
   - in_app_purchase_storekit (0.0.1):
     - Flutter
     - FlutterMacOS
@@ -16,15 +26,15 @@ PODS:
   - JXSegmentedView (1.4.1)
   - keyboard_android (0.0.1):
     - Flutter
-  - Kingfisher (8.3.1)
+  - Kingfisher (8.3.2)
   - lottie-ios (4.5.1)
   - MarqueeLabel (4.5.0)
-  - MMKV (2.2.1):
-    - MMKVCore (~> 2.2.1)
+  - MMKV (2.2.2):
+    - MMKVCore (~> 2.2.2)
   - mmkv_ios (2.2.1):
     - Flutter
     - MMKV (< 2.3, >= 2.2.1)
-  - MMKVCore (2.2.1)
+  - MMKVCore (2.2.2)
   - Moya (14.0.0):
     - Moya/Core (= 14.0.0)
   - Moya-ObjectMapper (2.9):
@@ -40,6 +50,8 @@ PODS:
   - path_provider_foundation (0.0.1):
     - Flutter
     - FlutterMacOS
+  - permission_handler_apple (9.3.0):
+    - Flutter
   - photo_manager (2.0.0):
     - Flutter
     - FlutterMacOS
@@ -68,10 +80,14 @@ PODS:
     - Flutter
 
 DEPENDENCIES:
+  - app_settings (from `.symlinks/plugins/app_settings/ios`)
   - app_tracking_transparency (from `.symlinks/plugins/app_tracking_transparency/ios`)
   - audio_session (from `.symlinks/plugins/audio_session/ios`)
   - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
   - Flutter (from `Flutter`)
+  - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`)
+  - flutter_umeng (from `.symlinks/plugins/flutter_umeng/ios`)
+  - gravity_engine (from `.symlinks/plugins/gravity_engine/ios`)
   - in_app_purchase_storekit (from `.symlinks/plugins/in_app_purchase_storekit/darwin`)
   - just_audio (from `.symlinks/plugins/just_audio/darwin`)
   - JXSegmentedView
@@ -84,6 +100,7 @@ DEPENDENCIES:
   - Moya-ObjectMapper
   - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
   - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
+  - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
   - photo_manager (from `.symlinks/plugins/photo_manager/ios`)
   - SnapKit (~> 5.0.0)
   - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`)
@@ -97,6 +114,7 @@ DEPENDENCIES:
 SPEC REPOS:
   https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
     - Alamofire
+    - Bugly
     - JXSegmentedView
     - Kingfisher
     - lottie-ios
@@ -110,6 +128,8 @@ SPEC REPOS:
     - Toast-Swift
 
 EXTERNAL SOURCES:
+  app_settings:
+    :path: ".symlinks/plugins/app_settings/ios"
   app_tracking_transparency:
     :path: ".symlinks/plugins/app_tracking_transparency/ios"
   audio_session:
@@ -118,6 +138,12 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/device_info_plus/ios"
   Flutter:
     :path: Flutter
+  flutter_bugly:
+    :path: ".symlinks/plugins/flutter_bugly/ios"
+  flutter_umeng:
+    :path: ".symlinks/plugins/flutter_umeng/ios"
+  gravity_engine:
+    :path: ".symlinks/plugins/gravity_engine/ios"
   in_app_purchase_storekit:
     :path: ".symlinks/plugins/in_app_purchase_storekit/darwin"
   just_audio:
@@ -130,6 +156,8 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/package_info_plus/ios"
   path_provider_foundation:
     :path: ".symlinks/plugins/path_provider_foundation/darwin"
+  permission_handler_apple:
+    :path: ".symlinks/plugins/permission_handler_apple/ios"
   photo_manager:
     :path: ".symlinks/plugins/photo_manager/ios"
   sqflite_darwin:
@@ -147,25 +175,31 @@ EXTERNAL SOURCES:
 
 SPEC CHECKSUMS:
   Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
+  app_settings: 58017cd26b604ae98c3e65acbdd8ba173703cc82
   app_tracking_transparency: e169b653478da7bb15a6c61209015378ca73e375
   audio_session: 19e9480dbdd4e5f6c4543826b2e8b0e4ab6145fe
+  Bugly: 217ac2ce5f0f2626d43dbaa4f70764c953a26a31
   device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
   Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
+  flutter_bugly: bf35df32a9c5d50b8aacdd35bd8ddc5b55150dae
+  flutter_umeng: 9005e3f776ff69868f0d75fbb2f11b33fbafc850
+  gravity_engine: 750c5f2424a042f334f1154ece41d916eb148d6a
   in_app_purchase_storekit: a1ce04056e23eecc666b086040239da7619cd783
   just_audio: a42c63806f16995daf5b219ae1d679deb76e6a79
   JXSegmentedView: cd73555ce2134d1656db2cb383ba9c2f36fb5078
   keyboard_android: f9c2c09930d97b29711ca9d4addc3ffa6253799d
-  Kingfisher: 3204d23de16b5ea53541c44ca5a8efb55741dec3
+  Kingfisher: 0621d0ac0c78fecb19f6dc5303bde2b52abaf2f5
   lottie-ios: 248b380fa1b97d18e792c37d90da7ab2aa0d6562
   MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
-  MMKV: 383ccfa10ae23ff2a9c0f6130b7136b37b55ac10
+  MMKV: b4802ebd5a7c68fc0c4a5ccb4926fbdfb62d68e0
   mmkv_ios: 5272ec85db0f92128a273e9474cb89a973a4ce05
-  MMKVCore: b0e4c420da85636d7adaa535a53dfade59a22f5c
+  MMKVCore: a255341a3746955f50da2ad9121b18cb2b346e61
   Moya: 5b45dacb75adb009f97fde91c204c1e565d31916
   Moya-ObjectMapper: 967a99d9ea3aa9c93ddbe112aeca3667f53bfe93
   ObjectMapper: e6e4d91ff7f2861df7aecc536c92d8363f4c9677
   package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
   path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
+  permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
   photo_manager: ff695c7a1dd5bc379974953a2b5c0a293f7c4c8a
   SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
   sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
@@ -176,6 +210,6 @@ SPEC CHECKSUMS:
   webview_flutter_wkwebview: a4af96a051138e28e29f60101d094683b9f82188
   wechat_kit: b6853fe0933b9a60a008a508e709c14f6ed2dc70
 
-PODFILE CHECKSUM: 4a3947bced29d08f1f837fd4bf69285442e7aec8
+PODFILE CHECKSUM: 7617064a1505ff5219c52712b08fe512373c13de
 
 COCOAPODS: 1.15.2

+ 22 - 4
ios/Runner.xcodeproj/project.pbxproj

@@ -458,6 +458,7 @@
 				97C146EB1CF9000F007C117D /* Frameworks */,
 				97C146EC1CF9000F007C117D /* Resources */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+				983A7A17C703B56965F0AE2C /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
 			);
@@ -621,7 +622,24 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
+			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
+		};
+		983A7A17C703B56965F0AE2C /* [CP] Copy Pods Resources */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
+			);
+			name = "[CP] Copy Pods Resources";
+			outputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
+			showEnvVarsInLog = 0;
 		};
 		C84FD05E1687413028FE5569 /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -921,7 +939,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				SUPPORTED_PLATFORMS = iphoneos;
@@ -1059,7 +1077,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				MTL_ENABLE_DEBUG_INFO = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -1110,7 +1128,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				SUPPORTED_PLATFORMS = iphoneos;

+ 6 - 5
ios/Runner.xcodeproj/xcshareddata/xcschemes/AiKeyboard.xcscheme

@@ -2,7 +2,7 @@
 <Scheme
    LastUpgradeVersion = "1500"
    wasCreatedForAppExtension = "YES"
-   version = "1.7">
+   version = "2.0">
    <BuildAction
       parallelizeBuildables = "YES"
       buildImplicitDependencies = "YES">
@@ -49,13 +49,14 @@
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
       launchStyle = "0"
+      askForAppToLaunch = "Yes"
       useCustomWorkingDirectory = "NO"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
       debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
+      allowLocationSimulation = "YES"
+      launchAutomaticallySubstyle = "2">
+      <MacroExpansion>
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "97C146ED1CF9000F007C117D"
@@ -63,7 +64,7 @@
             BlueprintName = "Runner"
             ReferencedContainer = "container:Runner.xcodeproj">
          </BuildableReference>
-      </BuildableProductRunnable>
+      </MacroExpansion>
    </LaunchAction>
    <ProfileAction
       buildConfiguration = "Release"

+ 19 - 0
ios/Runner/AppDelegate.swift

@@ -14,4 +14,23 @@ import UIKit
       
       return super.application(application, didFinishLaunchingWithOptions: launchOptions)
   }
+    
+    override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
+        
+        // 解析URL参数
+        let components = URLComponents(url: url, resolvingAgainstBaseURL: true)
+        let path = url.path
+        
+        // 将URL信息传递给Flutter
+        let controller = window?.rootViewController as! FlutterViewController
+        let channel = FlutterMethodChannel(name: "keyboard_ios", binaryMessenger: controller.binaryMessenger)
+        
+        if path == "/login" {
+            channel.invokeMethod("navigateToLogin", arguments: nil)
+        } else if path == "/member" {
+            channel.invokeMethod("navigateToMember", arguments: nil)
+        }
+        
+        return true
+    }
 }

+ 18 - 0
ios/Runner/Info.plist

@@ -2,6 +2,11 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
 	<key>CADisableMinimumFrameDurationOnPhone</key>
 	<true/>
 	<key>CFBundleDevelopmentRegion</key>
@@ -22,6 +27,19 @@
 	<string>$(FLUTTER_BUILD_NAME)</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
+	<key>CFBundleURLTypes</key>
+	<array>
+		<dict>
+			<key>CFBundleTypeRole</key>
+			<string>Editor</string>
+			<key>CFBundleURLName</key>
+			<string>com.qihuan.zhuiaijianpan</string>
+			<key>CFBundleURLSchemes</key>
+			<array>
+				<string>com.qihuan.zhuiaijianpan</string>
+			</array>
+		</dict>
+	</array>
 	<key>CFBundleVersion</key>
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
 	<key>ITSAppUsesNonExemptEncryption</key>

+ 4 - 0
ios/Runner/Runner.entitlements

@@ -2,6 +2,10 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
+	<key>com.apple.developer.associated-domains</key>
+	<array>
+		<string>applinks:youyue.shop</string>
+	</array>
 	<key>com.apple.security.application-groups</key>
 	<array>
 		<string>group.com.qihuan.zhuiaijianpan</string>

+ 27 - 0
ios/build/XCBuildData/40f3d82569511a5127774f799ebd7010.xcbuilddata/build-request.json

@@ -0,0 +1,27 @@
+{
+  "buildCommand" : {
+    "command" : "build",
+    "skipDependencies" : false,
+    "style" : "buildOnly"
+  },
+  "configuredTargets" : [
+
+  ],
+  "continueBuildingAfterErrors" : false,
+  "dependencyScope" : "workspace",
+  "enableIndexBuildArena" : false,
+  "hideShellScriptEnvironment" : false,
+  "parameters" : {
+    "action" : "build",
+    "overrides" : {
+
+    }
+  },
+  "qos" : "utility",
+  "schemeCommand" : "launch",
+  "showNonLoggedProgress" : true,
+  "useDryRun" : false,
+  "useImplicitDependencies" : false,
+  "useLegacyBuildLocations" : false,
+  "useParallelTargets" : true
+}

BIN
ios/build/XCBuildData/40f3d82569511a5127774f799ebd7010.xcbuilddata/description.msgpack


+ 1 - 0
ios/build/XCBuildData/40f3d82569511a5127774f799ebd7010.xcbuilddata/manifest.json

@@ -0,0 +1 @@
+{"client":{"name":"basic","version":0,"file-system":"device-agnostic","perform-ownership-analysis":"no"},"targets":{"":["<all>"]},"commands":{"<all>":{"tool":"phony","inputs":["<WorkspaceHeaderMapVFSFilesWritten>"],"outputs":["<all>"]},"P0:::Gate WorkspaceHeaderMapVFSFilesWritten":{"tool":"phony","inputs":[],"outputs":["<WorkspaceHeaderMapVFSFilesWritten>"]}}}

+ 1 - 0
ios/build/XCBuildData/40f3d82569511a5127774f799ebd7010.xcbuilddata/target-graph.txt

@@ -0,0 +1 @@
+Target dependency graph (0 target)

BIN
ios/build/XCBuildData/40f3d82569511a5127774f799ebd7010.xcbuilddata/task-store.msgpack


+ 0 - 36
lib/data/repository/account_repository.dart

@@ -271,42 +271,6 @@ class AccountRepository {
     }
   }
 
-  // 保存token到ios端
-  Future<void> saveAuthToken(String token) async {
-    // 通知iOS键盘扩展
-    if (Platform.isIOS) {
-      const MethodChannel channel = MethodChannel('keyboard_ios');
-      channel.invokeMethod('saveAuthToken', {'token': token});
-    }
-  }
-
-  // 保存token到ios端
-  Future<void> clearAuthToken() async {
-    // 通知iOS键盘扩展
-    if (Platform.isIOS) {
-      const MethodChannel channel = MethodChannel('keyboard_ios');
-      channel.invokeMethod('clearAuthToken');
-    }
-  }
-
-  // 保存token到ios端
-  Future<void> saveAuthToken(String token) async {
-    // 通知iOS键盘扩展
-    if (Platform.isIOS) {
-      const MethodChannel channel = MethodChannel('keyboard_ios');
-      channel.invokeMethod('saveAuthToken', {'token': token});
-    }
-  }
-
-  // 保存token到ios端
-  Future<void> clearAuthToken() async {
-    // 通知iOS键盘扩展
-    if (Platform.isIOS) {
-      const MethodChannel channel = MethodChannel('keyboard_ios');
-      channel.invokeMethod('clearAuthToken');
-    }
-  }
-
   // 意见反馈
   Future<void> complaintSubmit(String? phone, String content) {
     return atmobApi

+ 3 - 0
lib/main.dart

@@ -19,6 +19,7 @@ import 'package:keyboard/utils/atmob_log.dart';
 import 'package:keyboard/utils/channel_util.dart';
 import 'package:keyboard/utils/floating_window_helper.dart';
 import 'package:keyboard/utils/mmkv_util.dart';
+import 'package:keyboard/utils/navitigation_handler.dart';
 import 'package:keyboard/utils/privacy_compliance.dart';
 import 'package:keyboard/utils/toast_util.dart';
 import 'package:keyboard/widget/app_lifecycle_widget.dart';
@@ -42,6 +43,8 @@ void main() async {
   if (Platform.isAndroid) {
     //键盘
     KeyboardAndroidPlatform.init();
+  } else if (Platform.isIOS) {
+    NavigationHandler.initialize();
   }
   AssetLottie(Assets.anim.animSurpriseDialogData).load();
   runApp(const MyApp());

+ 1 - 0
lib/module/mine/mine_controller.dart

@@ -25,6 +25,7 @@ import '../../utils/date_util.dart';
 import '../../utils/keyboard_tutorial_util.dart';
 import '../../utils/toast_util.dart';
 import '../browser/browser_page.dart';
+import '../login/login_page.dart';
 import '../store/store_page.dart';
 import '../user_profile/user_profile_page.dart';
 

+ 12 - 7
lib/utils/keyboard_tutorial_util.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:keyboard/data/consts/constants.dart';
 import 'package:keyboard/utils/mmkv_util.dart';
 
@@ -48,12 +50,15 @@ class KeyboardTutorialUtil {
 
   /// 是否完成了教程
   static Future<bool> isTutorialComplete() async {
-    // 是否有悬浮窗权限
-    bool hasFloatingWindowPermission =
-        await KeyboardAndroidPlatform.hasFloatingWindowPermission();
-    // 是否启用了键盘
-    bool hasIsUseKeyboard =
-        await KeyboardAndroidPlatform.isTargetKeyboardEnabled();
-    return hasFloatingWindowPermission && hasIsUseKeyboard;
+    if (Platform.isAndroid) {
+      // 是否有悬浮窗权限
+      bool hasFloatingWindowPermission =
+      await KeyboardAndroidPlatform.hasFloatingWindowPermission();
+      // 是否启用了键盘
+      bool hasIsUseKeyboard =
+      await KeyboardAndroidPlatform.isTargetKeyboardEnabled();
+      return hasFloatingWindowPermission && hasIsUseKeyboard;
+    }
+    return true;
   }
 }

+ 32 - 0
lib/utils/navitigation_handler.dart

@@ -0,0 +1,32 @@
+import 'package:flutter/services.dart';
+import 'package:get/get.dart';
+import 'package:keyboard/module/login/login_page.dart';
+import 'package:keyboard/module/store/store_page.dart';
+
+class NavigationHandler {
+  static final NavigationHandler _instance = NavigationHandler._internal();
+  factory NavigationHandler() => _instance;
+  NavigationHandler._internal();
+
+  static const MethodChannel _channel = MethodChannel('keyboard_ios');
+
+  static void initialize() {
+    _channel.setMethodCallHandler(_handleMethod);
+  }
+
+  static Future<dynamic> _handleMethod(MethodCall call) async {
+    switch (call.method) {
+      case 'navigateToLogin':
+        LoginPage.start();
+        break;
+      case 'navigateToMember':
+        StorePage.start();
+        break;
+      default:
+        throw PlatformException(
+          code: 'Unimplemented',
+          details: '未实现的方法: ${call.method}',
+        );
+    }
+  }
+}

+ 1 - 0
lib/utils/privacy_compliance.dart

@@ -17,6 +17,7 @@ class PrivacyCompliance {
 
   static Future<void> setPrivacyPolicy(bool isAgree) async {
     final bool oldValue = isAgreePrivacyPolicy();
+    print("同意隐私政策$isAgree");
     if (isAgree == oldValue) return;
 
     KVUtil.putBool(isPolicyGranted, isAgree);

+ 1 - 1
pubspec.yaml

@@ -220,4 +220,4 @@ flutter:
 wechat_kit:
   ios: no_pay # 默认 pay
   app_id: wx21272929e8fd33e9
-  universal_link: https://flutter.dev
+  universal_link: https://youyue.shop