# RequestUserAuthorization(UserAuthorization)

> Request authorization to use the webcam or microphone on iOS or Web.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static AsyncOperation RequestUserAuthorization(UserAuthorization mode)
```

### Parameters

**** (\[UserAuthorization]\(/engine/6000.6/script-reference/unityengine/userauthorization)):&#x20;

### Returns

| Type                                                                            | Description |
| ------------------------------------------------------------------------------- | ----------- |
| [AsyncOperation](/engine/6000.6/script-reference/unityengine/asyncoperation.md) |             |

### Remarks

`Application.RequestUserAuthorization` is called to request permission for microphone and camera. The application shows a dialog box to the user and waits for the operation to complete before being able to use these features.

**Note:** Use [Application.HasUserAuthorization](/engine/6000.6/script-reference/unityengine/application/hasuserauthorization.md) to query the result of the operation.

### Examples

```csharp
using UnityEngine;
using UnityEngine.iOS;
using System.Collections;

// Show WebCams and Microphones on an iPhone/iPad.
// Make sure NSCameraUsageDescription and NSMicrophoneUsageDescription
// are in the Info.plist.

public class ExampleClass : MonoBehaviour
{
    IEnumerator Start()
    {
        FindWebCams();

        yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
        if (Application.HasUserAuthorization(UserAuthorization.WebCam))
        {
            Debug.Log("webcam found");
        }
        else
        {
            Debug.Log("webcam not found");
        }

        FindMicrophones();

        yield return Application.RequestUserAuthorization(UserAuthorization.Microphone);
        if (Application.HasUserAuthorization(UserAuthorization.Microphone))
        {
            Debug.Log("Microphone found");
        }
        else
        {
            Debug.Log("Microphone not found");
        }
    }

    void FindWebCams()
    {
        foreach (var device in WebCamTexture.devices)
        {
            Debug.Log("Name: " + device.name);
        }
    }

    void FindMicrophones()
    {
        foreach (var device in Microphone.devices)
        {
            Debug.Log("Name: " + device);
        }
    }
}
```
