Skip to content

Commit

Permalink
Add AccessoryManager.Configuration.default
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Mar 4, 2024
1 parent 243b9e6 commit eeab667
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
20 changes: 1 addition & 19 deletions Xcode/BluetoothAccessory/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import BluetoothAccessoryKit
struct BluetoothAccessoryApp: App {

static let accessoryManager = AccessoryManager(
configuration: Self.configuration
configuration: .default
)

#if os(macOS)
Expand Down Expand Up @@ -49,24 +49,6 @@ struct BluetoothAccessoryApp: App {
}
}

extension BluetoothAccessoryApp {

static var configuration: AccessoryManager.Configuration {
AccessoryManager.Configuration(
central: NativeCentral.Options(
showPowerAlert: true,
restoreIdentifier: "com.colemancda.BluetoothAccessory.CBCentralManager"
),
appGroup: "group.com.colemancda.BluetoothAccessory",
keychain: (
service: "com.colemancda.BluetoothAccessory",
group: "4W79SG34MW.com.colemancda.BluetoothAccessory"
),
cloud: "iCloud.com.colemancda.BluetoothAccessory"
)
}
}

private extension App {

static func didLaunch(_ accessoryManager: AccessoryManager) async {
Expand Down
18 changes: 18 additions & 0 deletions Xcode/BluetoothAccessoryKit/Model/AccessoryManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,21 @@ public extension AccessoryManager {
}
}
}

public extension AccessoryManager.Configuration {

static var `default`: AccessoryManager.Configuration {
AccessoryManager.Configuration(
central: NativeCentral.Options(
showPowerAlert: true,
restoreIdentifier: "com.colemancda.BluetoothAccessory.CBCentralManager"
),
appGroup: "group.com.colemancda.BluetoothAccessory",
keychain: (
service: "com.colemancda.BluetoothAccessory",
group: "4W79SG34MW.com.colemancda.BluetoothAccessory"
),
cloud: "iCloud.com.colemancda.BluetoothAccessory"
)
}
}

0 comments on commit eeab667

Please sign in to comment.