Destiny 7 місяців тому
батько
коміт
dfbfbf0d0e

+ 10 - 0
ios/AiKeyboard/AiKeyboard.entitlements

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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.security.application-groups</key>
+	<array>
+		<string>group.com.qihuan.zhuiaijianpan</string>
+	</array>
+</dict>
+</plist>

+ 4 - 4
ios/AiKeyboard/Info.plist

@@ -9,10 +9,6 @@
 		<key>NSAllowsArbitraryLoads</key>
 		<true/>
 	</dict>
-	<key>UIAppFonts</key>
-	<array>
-		<string>淘宝买菜体.ttf</string>
-	</array>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionAttributes</key>
@@ -31,5 +27,9 @@
 		<key>NSExtensionPrincipalClass</key>
 		<string>$(PRODUCT_MODULE_NAME).KeyboardViewController</string>
 	</dict>
+	<key>UIAppFonts</key>
+	<array>
+		<string>淘宝买菜体.ttf</string>
+	</array>
 </dict>
 </plist>

Різницю між файлами не показано, бо вона завелика
+ 11 - 2
ios/AiKeyboard/Network/KeyboardApi.swift


+ 3 - 0
ios/AiKeyboard/Network/KeyboardNetworkManager.swift

@@ -96,6 +96,9 @@ struct KeyboardNetworkManager {
                             success(response)
                         } else {
                             fail(responseData.code, responseData.msg ?? "")
+                            if responseData.code == 1006 {
+                                KeyboardApi.updateAuthToken(authToken: "")
+                            }
                         }
                     } else {
                         fail(500, "解析失败")

+ 2 - 2
ios/KeyboardSharedDataManager.swift

@@ -12,7 +12,7 @@ class KeyboardSharedDataManager {
     static let shared = KeyboardSharedDataManager()
     
     // App Group标识符,需要在主应用和键盘扩展中保持一致
-    private let appGroupIdentifier = "group.com.yourdomain.AiKeyboard2025"
+    private let appGroupIdentifier = "com.qihuan.zhuiaijianpan.AiKeyboard"
     
     // 共享的UserDefaults
     private lazy var sharedUserDefaults: UserDefaults? = {
@@ -33,7 +33,7 @@ class KeyboardSharedDataManager {
     }
     
     // 清除所有数据
-    func clearAllData() {
+    func clearAuthToken() {
         sharedUserDefaults?.removeObject(forKey: "user_token")
         sharedUserDefaults?.synchronize()
     }

+ 1 - 1
ios/Podfile

@@ -1,6 +1,6 @@
 # Uncomment this line to define a global platform for your project
 # platform :ios, '12.0'
-
+source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
 # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
 ENV['COCOAPODS_DISABLE_STATS'] = 'true'
 

+ 26 - 26
ios/Podfile.lock

@@ -19,12 +19,12 @@ PODS:
   - Kingfisher (8.3.1)
   - lottie-ios (4.5.1)
   - MarqueeLabel (4.5.0)
-  - MMKV (2.1.0):
-    - MMKVCore (~> 2.1.0)
-  - mmkv_ios (2.1.0):
+  - MMKV (2.2.1):
+    - MMKVCore (~> 2.2.1)
+  - mmkv_ios (2.2.1):
     - Flutter
-    - MMKV (< 2.2, >= 2.1.0)
-  - MMKVCore (2.1.1)
+    - MMKV (< 2.3, >= 2.2.1)
+  - MMKVCore (2.2.1)
   - Moya (14.0.0):
     - Moya/Core (= 14.0.0)
   - Moya-ObjectMapper (2.9):
@@ -95,7 +95,7 @@ DEPENDENCIES:
   - wechat_kit (from `.symlinks/plugins/wechat_kit/ios`)
 
 SPEC REPOS:
-  trunk:
+  https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git:
     - Alamofire
     - JXSegmentedView
     - Kingfisher
@@ -147,35 +147,35 @@ EXTERNAL SOURCES:
 
 SPEC CHECKSUMS:
   Alamofire: 7193b3b92c74a07f85569e1a6c4f4237291e7496
-  app_tracking_transparency: 3d84f147f67ca82d3c15355c36b1fa6b66ca7c92
-  audio_session: 9bb7f6c970f21241b19f5a3658097ae459681ba0
-  device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe
+  app_tracking_transparency: e169b653478da7bb15a6c61209015378ca73e375
+  audio_session: 19e9480dbdd4e5f6c4543826b2e8b0e4ab6145fe
+  device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342
   Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
-  in_app_purchase_storekit: d1a48cb0f8b29dbf5f85f782f5dd79b21b90a5e6
-  just_audio: 4e391f57b79cad2b0674030a00453ca5ce817eed
+  in_app_purchase_storekit: a1ce04056e23eecc666b086040239da7619cd783
+  just_audio: a42c63806f16995daf5b219ae1d679deb76e6a79
   JXSegmentedView: cd73555ce2134d1656db2cb383ba9c2f36fb5078
-  keyboard_android: 91ed2f079946f75dce51e2eb8850b4808daf4a3b
+  keyboard_android: f9c2c09930d97b29711ca9d4addc3ffa6253799d
   Kingfisher: 3204d23de16b5ea53541c44ca5a8efb55741dec3
   lottie-ios: 248b380fa1b97d18e792c37d90da7ab2aa0d6562
   MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
-  MMKV: ce484c1ac40bf76d5f09a0195d2ec5b3d3840d55
-  mmkv_ios: d0e1c7aae5feba9ca6d097cced432f0adf991a5f
-  MMKVCore: 1eb661c6c498ab88e3df9ce5d8ff94d05fcc0567
+  MMKV: 383ccfa10ae23ff2a9c0f6130b7136b37b55ac10
+  mmkv_ios: 5272ec85db0f92128a273e9474cb89a973a4ce05
+  MMKVCore: b0e4c420da85636d7adaa535a53dfade59a22f5c
   Moya: 5b45dacb75adb009f97fde91c204c1e565d31916
   Moya-ObjectMapper: 967a99d9ea3aa9c93ddbe112aeca3667f53bfe93
   ObjectMapper: e6e4d91ff7f2861df7aecc536c92d8363f4c9677
-  package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499
-  path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
-  photo_manager: d2fbcc0f2d82458700ee6256a15018210a81d413
+  package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
+  path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
+  photo_manager: ff695c7a1dd5bc379974953a2b5c0a293f7c4c8a
   SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
-  sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
+  sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
   Toast-Swift: 7a03a532afe3a560d4044bc7c237e2864d295173
-  url_launcher_ios: 694010445543906933d732453a59da0a173ae33d
-  video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b
-  wakelock_plus: e29112ab3ef0b318e58cfa5c32326458be66b556
-  webview_flutter_wkwebview: 1821ceac936eba6f7984d89a9f3bcb4dea99ebb2
-  wechat_kit: b50b40a52ad88cb9e378a32e300a2d8bdc0e4726
+  url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
+  video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
+  wakelock_plus: 76957ab028e12bfa4e66813c99e46637f367fc7e
+  webview_flutter_wkwebview: a4af96a051138e28e29f60101d094683b9f82188
+  wechat_kit: b6853fe0933b9a60a008a508e709c14f6ed2dc70
 
-PODFILE CHECKSUM: 1093286201867f6042ac86595dbdf5340ebd761d
+PODFILE CHECKSUM: 4a3947bced29d08f1f837fd4bf69285442e7aec8
 
-COCOAPODS: 1.16.2
+COCOAPODS: 1.15.2

+ 39 - 15
ios/Runner.xcodeproj/project.pbxproj

@@ -54,6 +54,7 @@
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
 		97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
 		A21E1420BB362BC7E3EB4811 /* Pods_AiKeyboard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B5EF92DE43959D6CF5B50A3 /* Pods_AiKeyboard.framework */; };
+		FE8F000A2DCC4D6F00AA2562 /* FlutterMethodChannelManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE8F00092DCC4D6F00AA2562 /* FlutterMethodChannelManager.swift */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -163,6 +164,8 @@
 		B77EC1F8B12A295BD1DC6742 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		C33B8387B7ED09CA498E0EC7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		D50315B08E93289C08ED808C /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
+		FE8F00052DCC4A7B00AA2562 /* AiKeyboard.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AiKeyboard.entitlements; sourceTree = "<group>"; };
+		FE8F00092DCC4D6F00AA2562 /* FlutterMethodChannelManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterMethodChannelManager.swift; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -196,6 +199,7 @@
 		045828712DB897D400C1792D /* AiKeyboard */ = {
 			isa = PBXGroup;
 			children = (
+				FE8F00052DCC4A7B00AA2562 /* AiKeyboard.entitlements */,
 				04582A452DC07EB700C1792D /* Model */,
 				04582A2B2DBF2A4E00C1792D /* 淘宝买菜体.ttf */,
 				04582A192DBB7BBB00C1792D /* Animate */,
@@ -396,6 +400,7 @@
 				1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
 				74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
 				74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
+				FE8F00092DCC4D6F00AA2562 /* FlutterMethodChannelManager.swift */,
 			);
 			path = Runner;
 			sourceTree = "<group>";
@@ -711,6 +716,7 @@
 				043D62372DCB0E7A005D12EE /* KeyboardSharedDataManager.swift in Sources */,
 				74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
 				1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
+				FE8F000A2DCC4D6F00AA2562 /* FlutterMethodChannelManager.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -761,14 +767,15 @@
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_ENTITLEMENTS = AiKeyboard/AiKeyboard.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_USER_SCRIPT_SANDBOXING = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu17;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = AiKeyboard/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = AiKeyboard;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
@@ -780,7 +787,7 @@
 				MARKETING_VERSION = 1.0;
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
 				MTL_FAST_MATH = YES;
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo.AiKeyboard;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan.AiKeyboard;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
@@ -803,14 +810,15 @@
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_ENTITLEMENTS = AiKeyboard/AiKeyboard.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_USER_SCRIPT_SANDBOXING = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu17;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = AiKeyboard/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = AiKeyboard;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
@@ -821,7 +829,7 @@
 				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
 				MARKETING_VERSION = 1.0;
 				MTL_FAST_MATH = YES;
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo.AiKeyboard;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan.AiKeyboard;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_EMIT_LOC_STRINGS = YES;
@@ -842,14 +850,15 @@
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_ENTITLEMENTS = AiKeyboard/AiKeyboard.entitlements;
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 1;
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_USER_SCRIPT_SANDBOXING = YES;
 				GCC_C_LANGUAGE_STANDARD = gnu17;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = AiKeyboard/Info.plist;
-				INFOPLIST_KEY_CFBundleDisplayName = AiKeyboard;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				INFOPLIST_KEY_NSHumanReadableCopyright = "";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
@@ -860,7 +869,7 @@
 				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
 				MARKETING_VERSION = 1.0;
 				MTL_FAST_MATH = YES;
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo.AiKeyboard;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan.AiKeyboard;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_EMIT_LOC_STRINGS = YES;
@@ -930,18 +939,23 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = Runner/Info.plist;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Profile;
@@ -1116,19 +1130,24 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = Runner/Info.plist;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Debug;
@@ -1142,18 +1161,23 @@
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
 				CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
-				DEVELOPMENT_TEAM = XNBM7JZRCC;
+				DEVELOPMENT_TEAM = ZX23DXLT68;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = Runner/Info.plist;
+				INFOPLIST_KEY_CFBundleDisplayName = "追爱小键盘";
 				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				LD_RUNPATH_SEARCH_PATHS = (
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				PRODUCT_BUNDLE_IDENTIFIER = com.atmob.keyboard.demo;
+				PRODUCT_BUNDLE_IDENTIFIER = com.qihuan.zhuiaijianpan;
 				PRODUCT_NAME = "$(TARGET_NAME)";
+				SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+				SUPPORTS_MACCATALYST = NO;
+				SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
 				SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
 				SWIFT_VERSION = 5.0;
+				TARGETED_DEVICE_FAMILY = 1;
 				VERSIONING_SYSTEM = "apple-generic";
 			};
 			name = Release;

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

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

+ 6 - 2
ios/Runner/AppDelegate.swift

@@ -7,7 +7,11 @@ import UIKit
     _ application: UIApplication,
     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
   ) -> Bool {
-    GeneratedPluginRegistrant.register(with: self)
-    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
+      GeneratedPluginRegistrant.register(with: self)
+      
+      let controller = window?.rootViewController as! FlutterViewController
+      FlutterMethodChannelManager.shared.setupMethodChannels(controller: controller)
+      
+      return super.application(application, didFinishLaunchingWithOptions: launchOptions)
   }
 }

+ 69 - 0
ios/Runner/FlutterMethodChannelManager.swift

@@ -0,0 +1,69 @@
+//
+//  FlutterMethodChannelManager.swift
+//  Runner
+//
+//  Created by Destiny on 2025/5/8.
+//
+
+import Flutter
+import UIKit
+
+class FlutterMethodChannelManager: NSObject {
+    
+    // 单例模式
+    static let shared = FlutterMethodChannelManager()
+    
+    // 方法通道
+    private var keyboardChannel: FlutterMethodChannel?
+    
+    // 私有初始化方法
+    private override init() {
+        super.init()
+    }
+    
+    // 设置方法通道
+    func setupMethodChannels(controller: FlutterViewController) {
+        // 创建键盘相关的方法通道
+        keyboardChannel = FlutterMethodChannel(
+            name: "keyboard_ios",
+            binaryMessenger: controller.binaryMessenger)
+        
+        // 设置方法调用处理器
+        keyboardChannel?.setMethodCallHandler { [weak self] (call, result) in
+            guard let self = self else { return }
+            
+            switch call.method {
+            case "saveAuthToken":
+                if let args = call.arguments as? [String: Any],
+                   let token = args["token"] as? String {
+                    KeyboardSharedDataManager.shared.saveToken(token)
+                    result(true)
+                } else {
+                    result(FlutterError(code: "INVALID_ARGUMENTS", message: "无效的参数", details: nil))
+                }
+            case "clearAuthToken":
+                KeyboardSharedDataManager.shared.clearAuthToken()
+                result(true)
+            default:
+                result(FlutterMethodNotImplemented)
+            }
+        }
+    }
+    
+    // 保存认证Token到App Group共享存储
+    private func saveAuthToken(_ token: String) {
+        if let userDefaults = UserDefaults(suiteName: "group.com.yourcompany.aikeyboard") {
+            userDefaults.set(token, forKey: "auth_token")
+            userDefaults.synchronize()
+            print("认证Token已保存到共享存储")
+        } else {
+            print("无法访问App Group共享存储")
+        }
+    }
+    
+    // 从App Group共享存储获取认证Token
+    private func getAuthToken() -> String? {
+        let userDefaults = UserDefaults(suiteName: "group.com.yourcompany.aikeyboard")
+        return userDefaults?.string(forKey: "auth_token")
+    }
+}

+ 7 - 9
ios/Runner/Info.plist

@@ -2,16 +2,12 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>ITSAppUsesNonExemptEncryption</key>
-	<false/>
-	<key>NSUserTrackingUsageDescription</key>
-	<string>追爱小键盘需要使用您的广告标识符以显示个性化广告</string>
 	<key>CADisableMinimumFrameDurationOnPhone</key>
 	<true/>
 	<key>CFBundleDevelopmentRegion</key>
 	<string>$(DEVELOPMENT_LANGUAGE)</string>
 	<key>CFBundleDisplayName</key>
-	<string>Keyboard</string>
+	<string>追爱小键盘</string>
 	<key>CFBundleExecutable</key>
 	<string>$(EXECUTABLE_NAME)</string>
 	<key>CFBundleIdentifier</key>
@@ -28,8 +24,12 @@
 	<string>????</string>
 	<key>CFBundleVersion</key>
 	<string>$(FLUTTER_BUILD_NUMBER)</string>
+	<key>ITSAppUsesNonExemptEncryption</key>
+	<false/>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
+	<key>NSUserTrackingUsageDescription</key>
+	<string>追爱小键盘需要使用您的广告标识符以显示个性化广告</string>
 	<key>UIApplicationSupportsIndirectInputEvents</key>
 	<true/>
 	<key>UILaunchStoryboardName</key>
@@ -39,15 +39,13 @@
 	<key>UISupportedInterfaceOrientations</key>
 	<array>
 		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationLandscapeLeft</string>
-		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
 	<key>UISupportedInterfaceOrientations~ipad</key>
 	<array>
-		<string>UIInterfaceOrientationPortrait</string>
-		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 		<string>UIInterfaceOrientationLandscapeLeft</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 	</array>
 </dict>
 </plist>

+ 6 - 1
ios/Runner/Runner.entitlements

@@ -1,5 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
-<dict/>
+<dict>
+	<key>com.apple.security.application-groups</key>
+	<array>
+		<string>group.com.qihuan.zhuiaijianpan</string>
+	</array>
+</dict>
 </plist>

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

@@ -1,5 +1,7 @@
 import 'dart:async';
+import 'dart:io';
 
+import 'package:flutter/services.dart';
 import 'package:get/get.dart';
 import 'package:injectable/injectable.dart';
 import 'package:keyboard/data/api/atmob_api.dart';
@@ -204,6 +206,7 @@ class AccountRepository {
   void onLoginSuccess(String phoneNum, String authToken) {
     GravityHelper.onLogin();
     AccountRepository.token = authToken;
+    saveAuthToken(authToken);
     loginPhoneNum.value = phoneNum;
     refreshUserInfo();
     KVUtil.putString(keyAccountLoginPhoneNum, phoneNum);
@@ -227,6 +230,7 @@ class AccountRepository {
 
   void logout() {
     token = null;
+    clearAuthToken();
     KVUtil.putString(keyAccountLoginPhoneNum, null);
     KVUtil.putString(keyAccountLoginToken, null);
     memberStatusInfo.value = null;
@@ -249,6 +253,24 @@ 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');
+    }
+  }
+
   // 意见反馈
   Future<void> complaintSubmit(String? phone, String content) {
     return atmobApi

Різницю між файлами не показано, бо вона завелика
+ 208 - 208
pubspec.lock