when app enter background,sometimes crash at
BSXPCCnx:com.apple.backboard.hid-services.xpc (BSCnx:client:BKHIDEventDeliveryManager)
this is crash stack:
0 libsystem_pthread.dylib 0x3b30 pthread_mutex_lock + 12
1 ilink_live 0xbd884 (缺少 UUID 973fe6c5058c35bda98679b0c8aa0129)
2 ilink_live 0xb75fc (缺少 UUID 973fe6c5058c35bda98679b0c8aa0129)
3 libsystem_c.dylib 0x23d68 __cxa_finalize_ranges + 492
4 libsystem_c.dylib 0x23b64 exit + 32
5 BackBoardServices 0x579ec -[BKSHIDEventDeliveryManager _initForTestingWithService:] + 98
6 BoardServices 0xbae8 __31-[BSServiceConnection activate]_block_invoke.182 + 128
7 BoardServices 0x17620 __61-[BSXPCServiceConnectionEventHandler _connectionInvalidated:]_block_invoke + 196
8 BoardServices 0x8f64 BSXPCServiceConnectionExecuteCallOut + 240
9 BoardServices 0x18e5c -[BSXPCServiceConnectionEventHandler _connectionInvalidated:] + 180
10 libdispatch.dylib 0x2370 _dispatch_call_block_and_release + 32
11 libdispatch.dylib 0x40d0 _dispatch_client_callout + 20
12 libdispatch.dylib 0xb6d8 _dispatch_lane_serial_drain + 744
13 libdispatch.dylib 0xc214 _dispatch_lane_invoke + 432
14 libdispatch.dylib 0x17258 _dispatch_root_queue_drain_deferred_wlh + 288
15 libdispatch.dylib 0x16aa4 _dispatch_workloop_worker_thread + 540
16 libsystem_pthread.dylib 0x4c7c _pthread_wqthread + 288
17 libsystem_pthread.dylib 0x1488 start_wqthread + 8
when crash happened ,most of time app recieved CBManagerStateResetting and CBManagerStateUnsupported event
Core Bluetooth
RSS for tagCommunicate with Bluetooth 4.0 low energy devices using Core Bluetooth.
Posts under Core Bluetooth tag
180 Posts
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Assuming that there is a strong reference to the device, the delegate, and the central manager, is didDiscoverServices guaranteed? Or if the peripheral device is wacky or has some BLE bug, is it possible for the callback to not be triggered?
Hello,
Our device firmware has a companion iOS app that allows a user to rename it. We are connected to the iPhone via BT Classic. The new name is reflected on the app, however, the iPhone BT device list still shows the old name. It doesn't seem to get updated to the new name unless we unpair/re-pair the device to the phone.
Is there a way to get the iPhone to update to the new name in the Settings BT device list without unpairing the device? Is this possible in BT Classic?
Thanks.
Topic:
App & System Services
SubTopic:
Core OS
Tags:
IOBluetooth
Playground Bluetooth
Core Bluetooth
Hello Apple, I am a Bluetooth peripheral developer.
Recently, I encountered the following issue while developing a Bluetooth smartwatch on iOS:
I have a Bluetooth smartwatch that supports CTKD connections. After pairing and connecting with an iOS device, notifications from iOS can be sent to the watch normally. However, after a few days, I noticed that my watch stopped receiving any iOS notifications.
Upon checking my phone's Bluetooth settings, I found that the watch's Bluetooth connection on the phone system had disconnected and did not automatically reconnect. After manually reconnecting, I observed that only the BT (classic Bluetooth) connection was established, while the BLE (Bluetooth Low Energy) connection remained disconnected.
I would like to understand what could be causing this issue and how to resolve the problem of Bluetooth reconnection.
I know this will sound like a weird use case, but it is potentially relevant to a product I am working on.
If I were to link two or more iPhones to the same iCloud account (I know this is uncommon and generally a bad idea, but it is possible so I have to consider it). Next I pair a BLE device to one of the phones using my app which has the background bluetooth permission with the app acting as the central so it can automatically restore a connection when the BLE device comes back into range.
I then install the same app on the other iPhone(s) linked to this account and separate them physically so they are out of BLE range of each other.
The BLE device is taken out of range of the first phone and into range of one of the others.
First question is will the BLE device automatically connect to the other iPhone?
If yes, will the app have any way of determining that it's running on a different iPhone with the same device connected?
If yes, can the app prevent connection to the other phones in some way?
My test was conducted by changing the pink dice to have a 16 bit UUID using the ASKSampleAccessory app. Afterwards, I ran AccessorySetupKit Picker in the ASKSample app, but Pink dice was not found.
We confirmed that Pink dice was searched well in other apps.
Does AccessorySetupKit not support 16 bit UUID?
AccessorySetupKit Sample code : https://developer.apple.com/documentation/AccessorySetupKit/authorizing-a-bluetooth-accessory-to-share-a-dice-roll
I am making an app that communicates between WatchOS and MacOS. I was able to connect and discover service characteristics one night and almost succeeded in showing the bluetooth transmited data on MacOS part, before xcode could no longer install newer app to WatchOS.
After I reboot my mac, calling central!.connect(peripheral) on WatchOS will attempt to connect but can't trigger the didConnect call back anymore.
I've installed bluetooth packet logger and BT debugging profile, but they are not that helpful for me at least.
We are reaching out to discuss an issue we have encountered with our app's activation process while running in the background. Currently, we are employing an iBeacon-based activation scheme, but we have noticed that after the app is activated, it is unable to receive UUID data from the scan-response while in the background.
We are considering the possibility of embedding the UUID data into the advertisement so that the app can receive it once activated by the iBeacon. Additionally, we are preparing to use both Core Bluetooth’s “Performing Long-Term Actions in the Background” feature and the iBeacon scheme simultaneously for app activation. We would like to know if these two methods can coexist without any mutual interference.
Currently, we are utilizing a method of updating the beacon advertisement after connection and disconnection to enhance the app's activation capability. However, in some scenarios where the signal is weak, the app does not detect the vehicle after being activated and will not be reactivated by the same beacon after going into sleep mode. Our current approach is to update the beacon advertisement every 10 seconds to improve this capability.
We have outlined our proposed changes and would appreciate your confirmation on whether they could lead to better optimization:
1.Embedding the UUID from the scan-response into the advertisement.
2.Updating the iBeacon advertisement content every 10 seconds.
3. Simultaneously using Core Bluetooth's "Performing Long-Term Actions in the Background" feature along with the iBeacon scheme for app activation.
Additionally, we would like to know if these changes could potentially cause any other issues.
Thank you for your assistance, and I look forward to your insights on this matter.
Hi,
I am developing an application using Flutter to connect to a Bluetooth Classic device (device is also developed by me), as Flutter is multi-platform I have tested this functionality in Android devices and it works fine, but when I want to develop the functionality of scanning BT devices, connect and send commands it is not possible due to I haven't found classic BT libraries to make this actions for iOS, do you know any library? There is any reason why isn't it possible?
Does iOS Automatically Reconnect to Disconnected BLE Devices, or Is It App-Driven?
I have a few questions regarding BLE device reconnections in iOS:
When a BLE device gets disconnected, does iOS automatically attempt to reconnect to it, or is it the app’s responsibility to handle the reconnection logic?
If the app doesn’t initiate a BLE scan, will the OS still attempt to reconnect to previously paired devices, or is manual intervention by the app necessary?
What is the recommended approach to re-establish a BLE connection when:
The app has been deleted.
The BLE device remains connected in the iPhone's Bluetooth settings.
The app is reinstalled later.
Any insights or best practices would be greatly appreciated!
Is it possible for the Bluetooth permissions of an app to be turned off due to changes in the iOS application's Bluetooth library, possibly because of Apple's security requirements or OS-related factors?
There are two applications, Application A and Application B, that control Bluetooth devices.
Application A uses a third-party Bluetooth library to control the Bluetooth devices.
Application B also uses a third-party Bluetooth library to control the Bluetooth devices.
The Bluetooth libraries used by Application A and Application B are different, but both applications work without any issues.
However, when the Bluetooth library used in Application B was changed to the one used in Application A, the Bluetooth permissions for Application B sometimes turned off.
Since Application A and Application B operate without any issues on their own, we believe the problem is not with the Bluetooth libraries themselves.
Given the above situation, is it possible that changing the Bluetooth library used could cause the Bluetooth permissions of the app to be turned off due to Apple's security requirements or OS-related factors?
Hello,
I'm using an HMSoft Bluetooth module that connects reliably to Android devices, maintaining a stable connection. However, when I try to connect it to my iPhone 12, the connection randomly disconnects after a few minutes (usually around 3 minutes). This issue occurs even when using apps like LightBlue and other BLE-based medical equipment apps, so it doesn't seem related to my app code.
Any suggestions on what I can do to prevent these unexpected disconnects? Should I change any specific settings on my iPhone or the module itself?
In the YouTube video
WWDC24: Meet AccessorySetupKit | Apple
two apps are demonstrated to showcase the functionality of AccessorySetupKit. Does anyone know where I can find the source code for these demo apps?
I'm developing an app which supports for connect with an BLE device. There are some views for showing data from bluetooth. The code below for an example:
@EnvironmentObject var bleManager: BLEManager // a class implemented CBCentralManagerDelegate
var body: some View {
// bleConnected is a CBPeripheral
if let bleConnected = bleManager.bleConnected {
if let services = bleConnected.services {
ForEach(services, id:\.self) { service in
// UI for print uuid, descriptions ...
showServiceDescriptionView(services)
if let characteristics = service.characteristics {
ForEach(characteristics, id:\.self) { characteristic in
// UI for print uuid, data for each characteristic
showCharacteristicsDetailView(characteristic)
}
}
}
}
}
}
}
But it seems that Xcode Preview do not support connect to a real bluetooth device. So the preview window in Xcode will always be a empty view.
I only can see the data on the real device. But it's important for me to design UI on the preview. So are there any method to mock a fake CBPeripheral in the Previewer? Or are there any other way to achieve this?
I created a locked camera capture extension as explained in Apple's documentation.
I'm trying to explore the possibilities of using a bluetooth peripheral from that extension - anybody knows if this is possible?
The CBCentralManagerDelegate reports .unsupported in func centralManagerDidUpdateState, even if I have provided all the permissions in Info.plist.
On iPhone, we can use iBeacon to wake up the APP in the background for Bluetooth scanning connection, now we want to port the function to AppleWatch APP, but the API related to iBeacon is not applicable on watchOS, does watchOS have a similar wake up mechanism?
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
WatchKit
watchOS
Maps and Location
Core Bluetooth
iOS 17
advertisementData:
{
kCBAdvDataIsConnectable = 1;
kCBAdvDataLocalName = CZL2;
kCBAdvDataRxPrimaryPHY = 1;
kCBAdvDataRxSecondaryPHY = 0;
kCBAdvDataServiceUUIDs = (
FFE0
);
kCBAdvDataTimestamp = "750419647.067132";
}
iOS 18
advertisementData:
{
kCBAdvDataIsConnectable = 0;
kCBAdvDataRxPrimaryPHY = 0;
kCBAdvDataRxSecondaryPHY = 0;
kCBAdvDataServiceUUIDs = (
FFE0
);
kCBAdvDataTimestamp = "750420105.457082";
}
What should I do if the key value pair of kCBAdvDataLocalName disappears?
I have an application built with .NET MAUI that uses the CoreBluetooth API to scan for our devices. As we need extanded advertisings we want to check if the device supports it. Our problem is that the query by using the "supports" method of CBCentralManger with argument "extendedScanAndConnect" gives us not always the same result.
When called at the app start we get false (=> not supported)
When called when the state of CBCentralManager changes to "poweredOn" we get false (=> not supported)
When called later when a button to scan is pressed we get true (=> supported)
How can we get the information if extended scan is supported at startup of our app?
Hardware: iPhone 14
OS: iOS 18.0.1
We have a USB dongle that would like to connect to the iPhone for power (using USB-C). Since it is not MFi, we will then use bluetooth for communication between the dongle and an app.
When doing bluetooth pairing between the dongle and iPhone, it would be ideal to only see the dongle that is plugged into the iPhone listed in the app. This is to avoid connecting to other dongles that may be in the area.
We think this could be possible using USB descriptors. We assume the iPhone can read the USB descriptors for non-MFi dongles.
Our question is, can our app see the USB-descriptors of the dongle? Is iOS able to pass that info to the app?
Then, we could have a unique USB descriptor for each dongle and the app could only list bluetooth devices with that descriptor (effectively filtering out any other dongles in the area).
Any help and/or feedback is greatly appreciated :)
I'm encountering an issue where a specific BLE device (a Telematics Control Unit) is being discovered by some iPhone models but not others, all running the same iOS version (18.0.1).
Here's the breakdown:
Successful discovery: iPhone 11, iPhone 14 Plus, iPhone 6s
No discovery: iPhone 13, iPhone 12 mini
Firmware: The TCU firmware is up-to-date.
BLE: Bluetooth is enabled on all devices.
I've tried basic troubleshooting like restarting devices and resetting network settings, but the issue persists. Could this be related to differences in Bluetooth chipsets or antenna designs between iPhone models, even with the same iOS version? Are there any known compatibility issues between this TCU and specific iPhone models?
Any insights or suggestions for further debugging issue would be greatly appreciated!