Backport: defer CBPeripheralManager creation (no Bluetooth prompt at app launch) - #1
Open
sethforprivacy wants to merge 3 commits into
Open
sethforprivacy wants to merge 3 commits into
sethforprivacy wants to merge 3 commits into
Conversation
…in iOS 13.1 or newer by @MrCyjaneK
…avideck#242) * Defer CBPeripheralManager creation until peripheral APIs are used * Refactor advertising state management in UniversalBlePeripheralPlugin - Introduced completeStopIfNeeded() method to handle stopping logic more cleanly. - Updated stopAdvertising() to ensure proper state transitions and callback invocations. - Improved handling of peripheralManager's state during advertising stop process. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Navideck Labs <130186950+navidecklabs@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> (cherry picked from commit df0dd9d)
Conflict in UniversalBlePlugin.swift: this branch added the `isBluetoothAuthorized()` iOS 13.1 availability guard where upstream added `activateStateRestoration()`. Kept both, and applied the same `#available` guard to upstream's new `hasBluetoothPermission` / `availabilityStateFromAuthorization` so the Xcode "'authorization' is only available in iOS 13.1 or newer" fix still holds. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of upstream df0dd9d (Navideck#242) onto the commit Cake Wallet currently pins (6735c1b).
The peripheral plugin's initializer accessed
peripheralManager.isAdvertising, which instantiatesCBPeripheralManagerduring plugin registration, so iOS shows the Bluetooth permission prompt on every first app launch before the app has done anything Bluetooth related. With this backport the manager is created on first use of the peripheral API, matching the central side.mainalready has this via Navideck#242; this branch exists so Cake Wallet can pin a commit compatible with its current universal_ble API without taking the 2.x rework yet. Cake Wallet pins it in cake-tech/cake_wallet#3631.🤖 Generated with Claude Code