react-native-ble-manager icon indicating copy to clipboard operation
react-native-ble-manager copied to clipboard

ios 26 and above restoreState functionality

Open Aduomas opened this issue 4 months ago • 9 comments

hello,

apple has updated their documentation about bluetooth state restoration.

Starting in iOS 26 and iPadOS 26, only apps that use AccessorySetupKit to setup Bluetooth accessories will be relaunched.

it seems that CoreBluetooth framework will not work with bluetooth restoration for ios 26 and above. https://developer.apple.com/documentation/technotes/tn3115-bluetooth-state-restoration-app-relaunch-rules/

what are the potential solutions moving forward?

Aduomas avatar Oct 06 '25 12:10 Aduomas

Hi @Aduomas , we should implement AccessorySetupKit in the library when we have the opportunity. Any PRs are welcome.

marcosinigaglia avatar Oct 06 '25 13:10 marcosinigaglia

Hi @Aduomas , we should implement AccessorySetupKit in the library when we have the opportunity. Any PRs are welcome.

understood, will see what i can do!

do you have a roadmap?

Aduomas avatar Oct 06 '25 13:10 Aduomas

Following cause I think we are having a similar issue.

Sparowhawk avatar Oct 08 '25 20:10 Sparowhawk

If we plan to introduce AccessorySetupKit, maybe we can reuse the same api exposed on Android for companion scan.

Hi @Aduomas , we should implement AccessorySetupKit in the library when we have the opportunity. Any PRs are welcome.

lucaswitch avatar Oct 08 '25 20:10 lucaswitch

If we plan to introduce AccessorySetupKit, maybe we can reuse the same api exposed on Android for companion scan.

Thats probably a reasonably good idea. We also use the companion scan on android.

However, I am currently struggling to perform any bluetooth state restoration regardless of ios version using react-native-ble-manager

I am registering restoreStateCallback before starting BLE manager and upon app launch i immediatelly start ble manager.

During the restoreStateCallback I either register characteristics if device is connected on OS level or call connect otherwise.

I am testing by terminating app through xcode, which causes it to be restored by the OS, but I do not notice any activity in JS runtime. After 10 seconds, the peripheral disconnects.

Do you have ideas why it doesnt work?

Aduomas avatar Oct 08 '25 21:10 Aduomas

I wrote a draft with the new accessorysetupkit api should look like, i'll test it tomorrow if i have time(i don't own a mac os device on my home)

https://github.com/lucaswitch/react-native-ble-manager/tree/master

lucaswitch avatar Oct 09 '25 01:10 lucaswitch

I wrote a draft with the new accessorysetupkit api should look like, i'll test it tomorrow if i have time(i don't own a mac os device on my home)

https://github.com/lucaswitch/react-native-ble-manager/tree/master

interesting, did you test it already?

Aduomas avatar Oct 10 '25 08:10 Aduomas

I wrote a draft with the new accessorysetupkit api should look like, i'll test it tomorrow if i have time(i don't own a mac os device on my home) https://github.com/lucaswitch/react-native-ble-manager/tree/master

interesting, did you test it already?

Not yet cause i need to be in the office to have mac os access.

lucaswitch avatar Oct 10 '25 18:10 lucaswitch

Not sure how to solve your problem but i'm adding accessorykit support: https://github.com/innoveit/react-native-ble-manager/pull/1389

lucaswitch avatar Oct 14 '25 21:10 lucaswitch