## Resource: PlayIntegrityConfig

An app's Play Integrity configuration object. This configuration controls certain properties of the `https://firebase.google.com/docs/reference/appcheck/rest/v1/AppCheckToken` returned by `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps/exchangePlayIntegrityToken#google.firebase.appcheck.v1.TokenExchangeService.ExchangePlayIntegrityToken`, such as its `https://firebase.google.com/docs/reference/appcheck/rest/v1/AppCheckToken#FIELDS.ttl`.

Note that your registered SHA-256 certificate fingerprints are used to validate tokens issued by the Play Integrity API; please register them via the Firebase Console or programmatically via the [Firebase Management Service](https://firebase.google.com/docs/projects/api/reference/rest/v1beta1/projects.androidApps.sha/create).

| JSON representation |
|---|
| ``` { "name": string, "tokenTtl": string, "appIntegrity": { object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#AppIntegrity`) }, "deviceIntegrity": { object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceIntegrity`) }, "accountDetails": { object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#AccountDetails`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The relative resource name of the Play Integrity configuration object, in the format: projects/{project_number}/apps/{app_id}/playIntegrityConfig |
| `tokenTtl` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#duration` format)`` Specifies the duration for which App Check tokens exchanged from Play Integrity tokens will be valid. If unset, a default value of 1 hour is assumed. Must be between 30 minutes and 7 days, inclusive. A duration in seconds with up to nine fractional digits, ending with '`s`'. Example: `"3.5s"`. |
| `appIntegrity` | ``object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#AppIntegrity`)`` Specifies application integrity requirements for Android devices running your app. These settings correspond to requirements on the [**application integrity** field](https://developer.android.com/google/play/integrity/verdicts#application-integrity-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary. The default values for these settings work for most apps, and are recommended. |
| `deviceIntegrity` | ``object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceIntegrity`)`` Specifies device integrity requirements for Android devices running your app. These settings correspond to requirements on the [**device integrity** field](https://developer.android.com/google/play/integrity/verdicts#device-integrity-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary. Warning: There are also [conditional](https://developer.android.com/google/play/integrity/setup#conditional) as well as [optional](https://developer.android.com/google/play/integrity/setup#optional_device_information) responses that you can receive, but requires additional explicit opt-in from you. The App Check API is **not** responsible for any such opt-ins. The default values for these settings work for most apps, and are recommended. |
| `accountDetails` | ``object (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#AccountDetails`)`` Specifies account requirements for Android devices running your app. These settings correspond to requirements on the [**account details** field](https://developer.android.com/google/play/integrity/verdicts#account-details-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary. The default values for these settings work for most apps, and are recommended. |

## AppIntegrity

A settings object specifying application integrity requirements for Android devices running your app.

These settings correspond to requirements on the [**application integrity** field](https://developer.android.com/google/play/integrity/verdicts#application-integrity-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary.

The default values for these settings work for most apps, and are recommended.

| JSON representation |
|---|
| ``` { "allowUnrecognizedVersion": boolean } ``` |

| Fields ||
|---|---|
| `allowUnrecognizedVersion` | `boolean` Specifies whether your running app is allowed to have the `UNRECOGNIZED_VERSION` [app recognition verdict](https://developer.android.com/google/play/integrity/verdicts#application-integrity-field). Note that the app recognition verdict `PLAY_RECOGNIZED` is a strong, comprehensive integrity signal that takes into account various other signals, including conditional and optional device integrity responses that you have opted into. If your app is published off-Play, this field should be set to `true` to allow instances of your app installed from off-Play sources to function. If set to `false`, only `PLAY_RECOGNIZED` verdicts are allowed, and both `UNRECOGNIZED_VERSION` and `UNEVALUATED` will be rejected. If set to `true`, any app recognition verdict is allowed. The default value is `false`. |

## DeviceIntegrity

A settings object specifying device integrity requirements for Android devices running your app.

These settings correspond to requirements on the [**device integrity** field](https://developer.android.com/google/play/integrity/verdicts#device-integrity-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary.

Warning: There are also [conditional](https://developer.android.com/google/play/integrity/setup#conditional) as well as [optional](https://developer.android.com/google/play/integrity/setup#optional_device_information) responses that you can receive, but requires additional explicit opt-in from you. The App Check API is **not** responsible for any such opt-ins.

The default values for these settings work for most apps, and are recommended.

| JSON representation |
|---|
| ``` { "minDeviceRecognitionLevel": enum (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceRecognitionLevel`) } ``` |

| Fields ||
|---|---|
| `minDeviceRecognitionLevel` | ``enum (`https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceRecognitionLevel`)`` Specifies the minimum device integrity level in order for the device to be considered valid. Any device with a device recognition verdict lower than this level will be rejected. If this is unspecified, the default level is `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceRecognitionLevel.ENUM_VALUES.NO_INTEGRITY`. |

## DeviceRecognitionLevel

The possible levels of [device recognition verdicts](https://developer.android.com/google/play/integrity/verdicts#device-integrity-field).

| Enums ||
|---|---|
| `DEVICE_RECOGNITION_LEVEL_UNSPECIFIED` | Default value. Do not specify this value directly. If this value is detected in a configuration, it will have the same effect as the value `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#DeviceRecognitionLevel.ENUM_VALUES.NO_INTEGRITY`. |
| `NO_INTEGRITY` | If this level is set, no explicit device integrity label requirements will be checked. However, because Play Integrity's other features may perform (and require) their own intrinsic device integrity checks, your `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#PlayIntegrityConfig.FIELDS.app_integrity` and `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#PlayIntegrityConfig.FIELDS.account_details` settings may still cause some device integrity checks to be performed. |
| `MEETS_BASIC_INTEGRITY` | This level corresponds to the `MEETS_BASIC_INTEGRITY` [optional device recognition label](https://developer.android.com/google/play/integrity/verdicts#optional-device-labels). This value represents the most basic level of device integrity, and is the minimum allowed in App Check's standard implementation of Play Integrity. Warning: Because this is an optional response, you **must** first explicitly [opt in your app in the Play Console](https://developer.android.com/google/play/integrity/setup#optional) in order to receive this label. Without this opt-in, **your app may break** for any user whose device is eligible for `MEETS_BASIC_INTEGRITY` but not `MEETS_DEVICE_INTEGRITY`. This API is **not** responsible for any such opt-ins. |
| `MEETS_DEVICE_INTEGRITY` | This level corresponds to the `MEETS_DEVICE_INTEGRITY` [device recognition verdict](https://developer.android.com/google/play/integrity/verdicts#device-integrity-field). Any app integrated with Play Integrity will automatically be eligible to receive this label without any additional action from you. At this level, devices that have the `MEETS_BASIC_INTEGRITY` label but **not** the `MEETS_DEVICE_INTEGRITY` label will be rejected. |
| `MEETS_STRONG_INTEGRITY` | This level corresponds to the `MEETS_STRONG_INTEGRITY` [optional device recognition label](https://developer.android.com/google/play/integrity/verdicts#optional-device-labels). This value represents the highest level of device integrity. At this level, devices that have the `MEETS_BASIC_INTEGRITY` or `MEETS_DEVICE_INTEGRITY` but **not** the `MEETS_STRONG_INTEGRITY` label will be rejected. Warning: Because this is an optional response, you **must** first explicitly [opt in your app in the Play Console](https://developer.android.com/google/play/integrity/setup#optional) in order to receive this label. Without this opt-in, **your app may break** for any user whose device is eligible for `MEETS_STRONG_INTEGRITY`. This API is **not** responsible for any such opt-ins. |

## AccountDetails

A settings object specifying account requirements for Android devices running your app.

These settings correspond to requirements on the [**account details** field](https://developer.android.com/google/play/integrity/verdicts#account-details-field) obtained from the Play Integrity API. See the [default responses table](https://developer.android.com/google/play/integrity/setup#default) for a quick summary.

The default values for these settings work for most apps, and are recommended.

| JSON representation |
|---|
| ``` { "requireLicensed": boolean } ``` |

| Fields ||
|---|---|
| `requireLicensed` | `boolean` Specifies whether the caller must have received the [`LICENSED` verdict](https://developer.android.com/google/play/integrity/verdicts#account-details-field). For additional details about scenarios where your users will receive this `LICENSED` label, see [the default responses table](https://developer.android.com/google/play/integrity/setup#default). If set to `true`, apps without the `LICENSED` app licensing verdict will be rejected. If set to `false`, any app licensing verdict is allowed. The default value is `false`. |

| ## Methods ||
|---|---|
| ### `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig/batchGet` | Atomically gets the `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#PlayIntegrityConfig`s for the specified list of apps. |
| ### `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig/get` | Gets the `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#PlayIntegrityConfig` for the specified app. |
| ### `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig/patch` | Updates the `https://firebase.google.com/docs/reference/appcheck/rest/v1/projects.apps.playIntegrityConfig#PlayIntegrityConfig` for the specified app. |