Request runtime permissions
Request runtime permissions for microphone access on Android.
읽는 시간 1분최근 업데이트: 7달 전
To ensure that your Unreal Android application will properly work with the Vivox SDK, you need to request the and, on Android 12 and later, the permissions at runtime. To do this, use to check if these permissions are granted, and to request the permission for the user.
android.permission.RECORD_AUDIOandroid.permission.BLUETOOTH_CONNECTUAndroidPermissionFunctionLibrary::CheckPermissionUAndroidPermissionFunctionLibrary::AcquirePermissionsThe following code is an example of this process:
#if PLATFORM_ANDROIDconst FString BluetoothConnectPermission = TEXT("android.permission.BLUETOOTH_CONNECT");if (!UAndroidPermissionFunctionLibrary::CheckPermission(BluetoothConnectPermission)) { permissions.Add(BluetoothConnectPermission); UAndroidPermissionFunctionLibrary::AcquirePermissions(permissions);}#endif
You also need to add the module into the dependency in the file. For example:
AndroidPermission[PROJECT].build.csPublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "AndroidPermission" });
For more information on how to request permissions by using the Blueprint API, refer to the the Unreal documentation on Android Permission.