iOS - connection to Bluetooth peripheral not working when shortcut option 'Show When Run' is disabled

In my app the shortcut intent handler is scanning for Bluetooth devices and based of a given selection it connects to them devices and perform some actions.

Now as soon the option 'Show When Run' is set to disabled, the Bluetooth centralManager does no longer connect to any peripheral, device scanning is still working though and running the shortcut by Siri is working as well. As a result, automation doesn't work and apparently I cannot use the shortcut as widget on lockscreen.

What else does the 'Show When Run' option apart from raising a user notification after the shortcut completed?

Could this be a missing permission issue? I already added required keys on the info.plist for Bluetooth access and added Bluetooth background option on both app and shortcut targets.

Post not yet marked as solved Up vote post of deelay05 Down vote post of deelay05
1.6k views

Replies

Hi: I have the exact same issue. The Intent gets through centralManager.scanForPeripherals(withServices: nil, options: nil) but never enters centralManager(_ central: CBCentralManager, didDiscover

Thanks

Did you find any documentation about that? We have the same issue as above, when central manager just doesn't discover any peripherals when the app is launched from intent interaction. Seems like it's some kind of privacy limitation.