Is there any way to known about Bluetooth on/off in my watch application because to update that status to the user.
I only want to know bluetooth on or off nothing else(not want to connect with any device).
Is there any way to known about Bluetooth on/off in my watch application because to update that status to the user.
I only want to know bluetooth on or off nothing else(not want to connect with any device).
If you test state, you should know if on or off.
ClassCBManager
Core Bluetooth
Declaration
class CBManager : NSObjectTopics
Accessing the Manager’s Properties
var state: CBManagerStateThe current state of the manager.
Manager States
case poweredOffA state that indicates Bluetooth is currently powered off.
case poweredOnA state that indicates Bluetooth is currently powered on and available to use.
case resettingA state that indicates the connection with the system service was momentarily lost.
case unauthorizedA state that indicates the application isn’t authorized to use the Bluetooth low energy role.
case unknownThe manager’s state is unknown.
case unsupportedA state that indicates this device doesn’t support the Bluetooth low energy central or client role.
Thank you.
I go through your solution, so I get state value unknown (or some time unsupported).
I check it in the simulator maybe for that it give this result.
To check this real device required or simulator can work??
There are functions involving system status that can only be checked on device.
A simple way is to print the result into a label on the watch, to make sure it runs independantly.