Skip to main content

Android Nearby Permission Prompted by Default

Solution​

To use the bHaptics Device in Unity for Android builds, you need to have the Bluetooth permission (Near by devices).

In the bHaptics SDK2, when you initialize it, it requests the Bluetooth permission.

If you want to prevent the Bluetooth permission (Near by devices) dialog from appearing as soon as the built app is launched, you can set the value of the "autoRequestBluetoothPermission" variable to false in "Assets/Bhaptics/SDK2/Scripts/Core/BhapticsSDK2.cs".

Code

public class BhapticsSDK2 : MonoBehaviour
{
private static BhapticsSDK2 instance;

[Header("Only for PC")]
[Tooltip("If bHaptics Player(PC) is not turned on when this program starts, it automatically runs bHaptics Player.")]
[SerializeField] private bool autoRunBhapticsPlayer = false;

// If you do not want bHapticsSDK2 to request Bluetooth permission when initialized,
// change the value to false.
private bool autoRequestBluetoothPermission = true;

private BhapticsSettings bhapticsSettings;
// ...
}