diff --git a/CustomKeyboard/CustomKeyboard.entitlements b/CustomKeyboard/CustomKeyboard.entitlements
index 47b6869..5ea4409 100644
--- a/CustomKeyboard/CustomKeyboard.entitlements
+++ b/CustomKeyboard/CustomKeyboard.entitlements
@@ -2,10 +2,13 @@
- keychain-access-groups
-
- $(AppIdentifierPrefix)com.loveKey.nyx.shared
-
+ com.apple.security.application-groups
+
+ group.com.loveKey.nyx
+
+ keychain-access-groups
+
+ $(AppIdentifierPrefix)com.loveKey.nyx.shared
+
-
diff --git a/CustomKeyboard/KeyboardViewController.m b/CustomKeyboard/KeyboardViewController.m
index 37bf554..30007f1 100644
--- a/CustomKeyboard/KeyboardViewController.m
+++ b/CustomKeyboard/KeyboardViewController.m
@@ -48,6 +48,10 @@ static CGFloat KEYBOARDHEIGHT = 256 + 20;
[self kb_applyTheme];
}];
[self kb_applyTheme];
+
+// NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:AppGroup];
+// NSString *value = [sharedDefaults objectForKey:@"TestSharedString"];
+// NSLog(@"[Keyboard] 读取到的数据: %@", value);
}
diff --git a/Shared/KBConfig.h b/Shared/KBConfig.h
index 00b85c6..c242718 100644
--- a/Shared/KBConfig.h
+++ b/Shared/KBConfig.h
@@ -13,9 +13,13 @@
#import
#endif
-
+/// APP名称
#define AppName @"Key of Love"
+/// APP Groups
+#define AppGroup @"group.com.loveKey.nyx"
+
+
// 基础baseUrl
#ifndef KB_BASE_URL
//#define KB_BASE_URL @"https://m1.apifoxmock.com/m1/5438099-5113192-default/"
diff --git a/keyBoard/Class/Home/VC/HomeMainVC.m b/keyBoard/Class/Home/VC/HomeMainVC.m
index 4e6c27e..0c77ca7 100644
--- a/keyBoard/Class/Home/VC/HomeMainVC.m
+++ b/keyBoard/Class/Home/VC/HomeMainVC.m
@@ -51,6 +51,13 @@
KBGuideVC *vc = [KBGuideVC new];
[weakSelf.navigationController pushViewController:vc animated:true];
};
+
+ /// 测试groups
+// NSUserDefaults *sharedDefaults = [[NSUserDefaults alloc] initWithSuiteName:AppGroup];
+// // 写入一个简单字符串
+// [sharedDefaults setObject:@"Hello From Main App" forKey:@"TestSharedString"];
+// [sharedDefaults synchronize];
+// NSLog(@"[MainApp] 写入完成");
}
// 在界面可见后做“首次安装”检查,避免在 viewDidLoad 期间 push 引起的转场警告
diff --git a/keyBoard/keyBoard.entitlements b/keyBoard/keyBoard.entitlements
index eabbbc8..a7f7eb5 100644
--- a/keyBoard/keyBoard.entitlements
+++ b/keyBoard/keyBoard.entitlements
@@ -10,6 +10,10 @@
applinks:app.tknb.net
+ com.apple.security.application-groups
+
+ group.com.loveKey.nyx
+
keychain-access-groups
$(AppIdentifierPrefix)com.loveKey.nyx.shared