Browse Source

[feat]增加引导界面,增加支付功能

Destiny 6 months ago
parent
commit
e1c4151d32
2 changed files with 26 additions and 0 deletions
  1. 26 0
      ios/Runner/FlutterMethodChannelManager.swift
  2. BIN
      ios/tbmct.ttf

+ 26 - 0
ios/Runner/FlutterMethodChannelManager.swift

@@ -126,4 +126,30 @@ class FlutterMethodChannelManager: NSObject {
         
         return currentKeyboardName == appDisplayName
     }
+    
+    // 是否添加键盘
+    func isKeyboardEnabled() -> Bool {
+        
+        // 获取系统中已安装的键盘列表
+        let keyboards = UserDefaults.standard.dictionaryRepresentation()
+            .filter { $0.key.contains("Keyboard") }
+        if let keyboardList = keyboards["AppleKeyboards"] as? [String] {
+            
+            let keyboardBundleId = "com.qihuan.zhuiaijianpan.AiKeyboard"
+            let isAdded = keyboardList.contains(keyboardBundleId)
+            return isAdded
+        }
+        return false
+    }
+    
+    // 是否为默认键盘
+    func isCustomKeybroad() -> Bool {
+        
+        let currentKeyboardName = (((UITextInputMode.activeInputModes as NSArray).filtered(using: NSPredicate(format: "isDisplayed = YES"))).last as? NSObject)?.value(forKey: "extendedDisplayName") as? String
+        
+        let infoDictionary = Bundle.main.infoDictionary!
+        let appDisplayName = infoDictionary["CFBundleDisplayName"] as? String
+        
+        return currentKeyboardName == appDisplayName
+    }
 }

BIN
ios/tbmct.ttf