# ShouldShowRequestPermissionRationale(string)

> Check whether to display the UI explaining the reason for permission before requesting it.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Android](/engine/6000.7/script-reference/unityengine/android.md)
* **Assembly:** UnityEngine.AndroidJNIModule

```csharp
public static bool ShouldShowRequestPermissionRationale(string permission)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A string identifier for permission. This is the value of Android constant.

### Returns

| Type                                                          | Description                                      |
| ------------------------------------------------------------- | ------------------------------------------------ |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | The value returned by equivalent Android method. |

### Remarks

For more information on this method, refer to [Android developer documentation](https://developer.android.com/reference/android/app/Activity#shouldShowRequestPermissionRationale\(java.lang.String\)).

### Examples

```csharp
using UnityEngine;
using UnityEngine.Android;

public class RequestPermissionScript : MonoBehaviour
{
    internal void PermissionCallbacks_PermissionDeniedAndDontAskAgain(string permissionName)
    {
        Debug.Log($"{permissionName} PermissionDeniedAndDontAskAgain");
    }

    internal void PermissionCallbacks_PermissionGranted(string permissionName)
    {
        Debug.Log($"{permissionName} PermissionCallbacks_PermissionGranted");
    }

    internal void PermissionCallbacks_PermissionDenied(string permissionName)
    {
        Debug.Log($"{permissionName} PermissionCallbacks_PermissionDenied");
    }

    void Start()
    {
        if (Permission.HasUserAuthorizedPermission(Permission.Microphone))
        {
            // The user authorized use of the microphone.
        }
        else
        {
            // The user has not authorized microphone usage.
            // Check whether you need to display the rationale for requesting permission
            bool useCallbacks = false;
            if (!useCallbacks)
            {
                if (Permission.ShouldShowRequestPermissionRationale(Permission.Microphone))
                    {
                    // Show a message or inform the user in other ways why your application needs the microphone permission.
                    }
                // Ask for permission or proceed without the functionality enabled.
                Permission.RequestUserPermission(Permission.Microphone);
            }
            else
            {
                var callbacks = new PermissionCallbacks();
                callbacks.PermissionDenied += PermissionCallbacks_PermissionDenied;
                callbacks.PermissionGranted += PermissionCallbacks_PermissionGranted;
                callbacks.PermissionDeniedAndDontAskAgain += PermissionCallbacks_PermissionDeniedAndDontAskAgain;
                Permission.RequestUserPermission(Permission.Microphone, callbacks);
            }
        }
    }
}
```
