添加app groups

This commit is contained in:
2025-11-18 14:41:35 +08:00
parent ced0b88ca4
commit 254e65906a
5 changed files with 28 additions and 6 deletions

View File

@@ -2,10 +2,13 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.loveKey.nyx.shared</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.loveKey.nyx</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.loveKey.nyx.shared</string>
</array>
</dict>
</plist>

View File

@@ -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);
}

View File

@@ -13,9 +13,13 @@
#import <UIKit/UIKit.h>
#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/"

View File

@@ -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

View File

@@ -10,6 +10,10 @@
<array>
<string>applinks:app.tknb.net</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.loveKey.nyx</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.loveKey.nyx.shared</string>