Skip to content

Commit 454750d

Browse files
committed
Generate app group related keys dynamically
1 parent 7bd5284 commit 454750d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import Foundation
22

3+
private var teamIDPrefix: String {
4+
Bundle.main.infoDictionary?["TEAM_ID_PREFIX"] as? String ?? ""
5+
}
6+
7+
private var bundleIdentifierBase: String {
8+
Bundle.main.infoDictionary?["BUNDLE_IDENTIFIER_BASE"] as? String ?? ""
9+
}
10+
311
public var userDefaultSuiteName: String {
4-
"5YKZ4Y3DAW.group.com.intii.CopilotForXcode"
12+
"\(teamIDPrefix)group.\(bundleIdentifierBase)"
513
}
614

715
public var keychainAccessGroup: String {
8-
#if DEBUG
9-
return "5YKZ4Y3DAW.dev.com.intii.CopilotForXcode.Shared"
10-
#else
11-
return "5YKZ4Y3DAW.com.intii.CopilotForXcode.Shared"
12-
#endif
16+
return "\(teamIDPrefix)\(bundleIdentifierBase).Shared"
1317
}
1418

1519
public var keychainService: String {
16-
#if DEBUG
17-
return "dev.com.intii.CopilotForXcode"
18-
#else
19-
return "com.intii.CopilotForXcode"
20-
#endif
20+
return bundleIdentifierBase
2121
}
2222

0 commit comments

Comments
 (0)