Skip to content

Commit

Permalink
Fix issue: Repeat to create LPC connect/disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
tatthangcntt committed Jun 5, 2024
1 parent dd2828d commit 6186b5b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 49 deletions.
7 changes: 6 additions & 1 deletion ios/BrekekeLPC/Settings/SettingsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ class SettingsManager: NSObject {
.eraseToAnyPublisher()
private let settingsWillWriteSubject = PassthroughSubject<Void, Never>()
private static let settingsKey = "settings"
static var appGroupName = Settings
.bundleIdentifier == "com.brekeke.phonedev" ? "group.com.brekeke.lpcdev" :
"group.com.brekeke.lpc"
private static let userDefaults =
UserDefaults(suiteName: "group.com.brekeke.lpc")!
UserDefaults(suiteName: appGroupName)!
private let settingsSubject: CurrentValueSubject<Settings, Never>
private static let logger = Logger(
prependString: "SettingsManager",
Expand All @@ -29,6 +32,8 @@ class SettingsManager: NSObject {
override init() {
var settings = Self.fetch()
SettingsManager.logger.log("settings init(): \(settings)")
SettingsManager.logger
.log("settings init()::appGroupName:: \(SettingsManager.appGroupName)")
if settings == nil {
settings = Settings(
token: "",
Expand Down
25 changes: 12 additions & 13 deletions ios/BrekekeLPCExtension/BrekekeLPCExtension.entitlements
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?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">
<?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.developer.networking.networkextension</key>
<array>
<string>app-push-provider</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.brekeke.lpc</string>
</array>
</dict>
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-push-provider</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.brekeke.lpcdev</string>
</array>
</dict>
</plist>
69 changes: 34 additions & 35 deletions ios/BrekekePhone/BrekekePhone.entitlements
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
<?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">
<?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>aps-environment</key>
<string>production</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-push-provider</string>
</array>
<key>com.apple.developer.networking.wifi-info</key>
<true />
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.brekeke.lpc</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.brekeke.phonedev</string>
</array>
</dict>
<dict>
<key>aps-environment</key>
<string>production</string>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.icloud-services</key>
<array>
<string>CloudDocuments</string>
</array>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>app-push-provider</string>
</array>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.$(CFBundleIdentifier)</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.brekeke.lpcdev</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.brekeke.phonedev</string>
</array>
</dict>
</plist>

0 comments on commit 6186b5b

Please sign in to comment.