Last active
June 22, 2023 11:23
-
-
Save Naveen-spritle/04bba277751c2d885eb073308a4ff8d9 to your computer and use it in GitHub Desktop.
Perform the Scan BLE device Operation if Bluetooth adapter state is ON and Granted the required Permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CUSTOM HOOK | |
const isBluetoothOn = useBluetoothListener(); // We made above the code snippet, Whenever needed import and use it. | |
useEffect(() => { | |
// Perform the Scan BLE device Operation if Bluetooth adapter state is ON and Granted the required Permissions | |
isBluetoothOn && accessPermission && scanAvailableBleDevice(); | |
}, [isBluetoothOn, accessPermission]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment