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.