Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have crash in willRestoreState #262

Open
bluendev opened this issue Apr 21, 2022 · 0 comments
Open

I have crash in willRestoreState #262

bluendev opened this issue Apr 21, 2022 · 0 comments

Comments

@bluendev
Copy link

Summary:
I used backgroundRestoreMode at bluejay.start mode.
But I have a crash in this code when my app start.

public func centralManager(_ central: CBCentralManager, willRestoreState dict: [String: Any]) {
    
    debugLog("Central manager will restore state.")

    guard let peripherals = dict[CBCentralManagerRestoredStatePeripheralsKey] as? [CBPeripheral], let cbPeripheral = peripherals.first else {
        debugLog("No peripherals found during state restoration.")
        endStartupBackgroundTask()
        return
    }

    let peripheral = Peripheral(delegate: self, cbPeripheral: cbPeripheral, bluejay: self)
    precondition(peripherals.count == 1, "Invalid number of peripheral to restore.")
    debugLog("Peripheral state to restore: \(cbPeripheral.state.string())")

I have problem this line " precondition(peripherals.count == 1, "Invalid number of peripheral to restore.") " in bluejay.swif code

Don't other people have this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant