Google.Play.Integrity

Summary

Enumerations

IntegrityDialogResponseCode{
  DialogUnavailable = 0,
  DialogFailed = 1,
  DialogCancelled = 2,
  DialogSuccessful = 3
}
enum
Status returned when showing the integrity dialog
IntegrityErrorCode{
  NoError = 0,
  ApiNotAvailable = 1,
  PlayStoreNotFound = 2,
  NetworkError = 3,
  PlayStoreAccountNotFound = 4,
  AppNotInstalled = 5,
  PlayServicesNotFound = 6,
  AppUidMismatch = 7,
  TooManyRequests = 8,
  CannotBindToService = 9,
  GoogleServerUnavailable = 10,
  NonceTooShort = 11,
  NonceTooLong = 12,
  NonceIsNotBase64 = 13,
  PlayStoreVersionOutdated = 14,
  PlayServicesVersionOutdated = 15,
  CloudProjectNumberIsInvalid = 16,
  ClientTransientError = 17,
  InternalError = 100
}
enum
Error codes for Integrity API
StandardIntegrityErrorCode{
  ApiNotAvailable = -1,
  PlayStoreNotFound = -2,
  NetworkError = -3,
  AppNotInstalled = -5,
  PlayServicesNotFound = -6,
  AppUidMismatch = -7,
  TooManyRequests = -8,
  CannotBindToService = -9,
  GoogleServerUnavailable = -12,
  PlayStoreVersionOutdated = -14,
  PlayServicesVersionOutdated = -15,
  CloudProjectNumberIsInvalid = -16,
  RequestHashTooLong = -17,
  ClientTransientError = -18,
  IntegrityTokenProviderInvalid = -19,
  InternalError = -100
}
enum
Error codes for Standard Integrity API.

Classes

Google.Play.Integrity.IntegrityManager

Manages requests for integrity information.

Google.Play.Integrity.IntegrityTokenRequest

Request for IntegrityManager.RequestIntegrityToken.

Google.Play.Integrity.IntegrityTokenResponse

Response for IntegrityManager.RequestIntegrityToken.

Google.Play.Integrity.PrepareIntegrityTokenRequest

Request for StandardIntegrityManager.PrepareIntegrityToken.

Google.Play.Integrity.StandardIntegrityManager

Manages requests for integrity information.

Google.Play.Integrity.StandardIntegrityToken

Response of StandardIntegrityTokenProvider.Request.

Google.Play.Integrity.StandardIntegrityTokenProvider

Standard integrity token provider.

Google.Play.Integrity.StandardIntegrityTokenRequest

Request for StandardIntegrityTokenProvider.Request.

Enumerations

IntegrityDialogResponseCode

 IntegrityDialogResponseCode

Status returned when showing the integrity dialog

Properties
DialogCancelled

The user was shown the Integrity Dialog, but did not interact with it.

DialogFailed

An error occurred when trying to show the Integrity Dialog.

DialogSuccessful

The user was shown the Integrity Dialog, and successfully interacted with it.

DialogUnavailable

The Integrity Dialog is unavailable.

IntegrityErrorCode

 IntegrityErrorCode

Error codes for Integrity API

Properties
ApiNotAvailable

Integrity API is not available.

Integrity API is not enabled, or the Play Store version might be old. Recommended actions:

AppNotInstalled

The calling app is not installed.

Something is wrong (possibly an attack). Non-actionable.

AppUidMismatch

The calling app UID (user id) does not match the one from Package Manager.

Something is wrong (possibly an attack). Non-actionable.

CannotBindToService

Binding to the service in the Play Store has failed.

This can be due to having an old Play Store version installed on the device.

Ask the user to update Play Store.

ClientTransientError

There was a transient error in the client device.

Retry with an exponential backoff.

Introduced in IntegrityPlay Core version 1.1.0 (prior versions returned a token with empty Device Integrity Verdict). If the error persists after a few retries, you should assume that the device has failed integrity checks and act accordingly.

CloudProjectNumberIsInvalid

The provided cloud project number is invalid.

Use the cloud project number which can be found in Project info in your Google Cloud Console for the cloud project where PlayIntegrity API is enabled.

GoogleServerUnavailable

Unknown internal Google server error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.

InternalError

Unknown internal error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.

NetworkError

No available network is found.

Ask the user to check for a connection.

NoError

No error has occurred.

NonceIsNotBase64

Nonce is not encoded as a base64 web-safe no-wrap string.

Retry with correct nonce format.

NonceTooLong

Nonce length is too long.

The nonce must be less than 500 bytes before base64 encoding.

Retry with a shorter nonce.

NonceTooShort

Nonce length is too short.

The nonce must be a minimum of 16 bytes (before base64 encoding) to allow for better security.

Retry with a longer nonce.

PlayServicesNotFound

Play Services is not available or version is too old.

Ask the user to Install or Update Play Services.

PlayServicesVersionOutdated

Play Services needs to be updated.

Ask the user to update GooglePlay Services.

PlayStoreAccountNotFound

No Play Store account is found on device.

Note that the PlayIntegrity API now supports unauthenticated requests. This error code is used only for older Play Store versions that lack support.

Ask the user to authenticate in Play Store.

PlayStoreNotFound

No Play Store app is found on device or not official version is installed.

Ask the user to install an official and recent version of Play Store.

PlayStoreVersionOutdated

The Play Store needs to be updated.

The Play Store needs to be updated.

TooManyRequests

The calling app is making too many requests to the API and hence is throttled.

Retry with an exponential backoff.

StandardIntegrityErrorCode

 StandardIntegrityErrorCode

Error codes for Standard Integrity API.

Properties
ApiNotAvailable

Standard Integrity API is not available.

Standard Integrity API is not enabled, or the Play Store version might be old. Recommended actions:

  • Make sure to be allow-listed to use Standard Integrity API.
  • Make sure that Integrity API is enabled in GooglePlay Console.
  • Ask the user to update Play Store..

AppNotInstalled

The calling app is not installed.

Something is wrong (possibly an attack). Non-actionable.

AppUidMismatch

The calling app UID (user id) does not match the one from Package Manager.

Something is wrong (possibly an attack). Non-actionable.

CannotBindToService

Binding to the service in the Play Store has failed.

This can be due to having an old Play Store version installed on the device or device memory is overloaded.

Ask the user to update Play Store.

Retry with an exponential backoff.

ClientTransientError

There was a transient error in the client device.

Retry with an exponential backoff.

If the error persists after a few retries, you should assume that the device has failed integrity checks and act accordingly.

CloudProjectNumberIsInvalid

The provided cloud project number is invalid.

Use the cloud project number which can be found in Project info in your Google Cloud Console for the cloud project where PlayIntegrity API is enabled.

GoogleServerUnavailable

Unknown internal Google server error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.

IntegrityTokenProviderInvalid

The StandardIntegrityTokenProvider is invalid (e.g.

it is outdated). This error can be returned only for StandardIntegrityTokenProvider.request

Request a new integrity token provider by calling StandardIntegrityManager.prepareIntegrityToken

InternalError

Unknown internal error.

Retry with an exponential backoff. Consider filing a bug if fails consistently.

NetworkError

No available network is found.

Ask the user to check for a connection.

PlayServicesNotFound

Play Services is not available or version is too old.

Ask the user to Install or Update Play Services.

PlayServicesVersionOutdated

Play Services needs to be updated.

Ask the user to update GooglePlay Services.

PlayStoreNotFound

No Play Store app is found on device or not official version is installed.

Ask the user to install an official and recent version of Play Store.

PlayStoreVersionOutdated

The Play Store needs to be updated.

Ask the user to update the GooglePlay Store.

RequestHashTooLong

The provided request hash is too long.

The request hash length must be less than 500 bytes.

   Retry with a shorter request hash.
     

TooManyRequests

The calling app is making too many requests to the API and hence is throttled.

Retry with an exponential backoff.