← ClaudeAtlas

core-bluetoothlisted

Scan, connect, and communicate with Bluetooth Low Energy peripherals and publish local peripheral services using Core Bluetooth. Use when implementing BLE central or peripheral roles, discovering services and characteristics, reading and writing characteristic values, subscribing to notifications, configuring background BLE modes, restoring state after app relaunch, or working with CBCentralManager, CBPeripheral, CBPeripheralManager, CBService, CBCharacteristic, CBUUID, or Bluetooth Low Energy workflows.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# Core Bluetooth Scan for, connect to, and exchange data with Bluetooth Low Energy (BLE) devices. Covers the central role (scanning and connecting to peripherals), the peripheral role (advertising services), background modes, and state restoration. Targets Swift 6.3 / iOS 26+. ## Contents - [Setup](#setup) - [Central Role: Scanning](#central-role-scanning) - [Central Role: Connecting](#central-role-connecting) - [Discovering Services and Characteristics](#discovering-services-and-characteristics) - [Reading, Writing, and Notifications](#reading-writing-and-notifications) - [Peripheral Role: Advertising](#peripheral-role-advertising) - [Background BLE](#background-ble) - [State Restoration](#state-restoration) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Setup ### Info.plist Keys | Key | Purpose | |---|---| | `NSBluetoothAlwaysUsageDescription` | Required. Explains why the app uses Bluetooth | | `UIBackgroundModes` with `bluetooth-central` | Background scanning and connecting | | `UIBackgroundModes` with `bluetooth-peripheral` | Background advertising | ### Bluetooth Authorization iOS prompts for Bluetooth permission automatically when you create a `CBCentralManager` or `CBPeripheralManager`. The usage description from `NSBluetoothAlwaysUsageDescription` is shown in the permission dialog. ## Central Role: Scanning ### Creating the Central Manager Always wait for the `poweredOn` state before scanning. `