Play Integrity API

Native Play Integrity API.

Summary

Enumerations

IntegrityDialogResponseCode enum
Status returned when showing the integrity dialog.
IntegrityErrorCode{
  INTEGRITY_NO_ERROR = 0,
  INTEGRITY_API_NOT_AVAILABLE = -1,
  INTEGRITY_PLAY_STORE_NOT_FOUND = -2,
  INTEGRITY_NETWORK_ERROR = -3,
  INTEGRITY_PLAY_STORE_ACCOUNT_NOT_FOUND = -4,
  INTEGRITY_APP_NOT_INSTALLED = -5,
  INTEGRITY_PLAY_SERVICES_NOT_FOUND = -6,
  INTEGRITY_APP_UID_MISMATCH = -7,
  INTEGRITY_TOO_MANY_REQUESTS = -8,
  INTEGRITY_CANNOT_BIND_TO_SERVICE = -9,
  INTEGRITY_NONCE_TOO_SHORT = -10,
  INTEGRITY_NONCE_TOO_LONG = -11,
  INTEGRITY_GOOGLE_SERVER_UNAVAILABLE = -12,
  INTEGRITY_NONCE_IS_NOT_BASE64 = -13,
  INTEGRITY_PLAY_STORE_VERSION_OUTDATED = -14,
  INTEGRITY_PLAY_SERVICES_VERSION_OUTDATED = -15,
  INTEGRITY_CLOUD_PROJECT_NUMBER_IS_INVALID = -16,
  INTEGRITY_CLIENT_TRANSIENT_ERROR = -17,
  INTEGRITY_INTERNAL_ERROR = -100,
  INTEGRITY_INITIALIZATION_NEEDED = -101,
  INTEGRITY_INITIALIZATION_FAILED = -102,
  INTEGRITY_INVALID_ARGUMENT = -103
}
enum
Errors that can be encountered while using the integrity API.
IntegrityResponseStatus{
  INTEGRITY_RESPONSE_UNKNOWN = 0,
  INTEGRITY_RESPONSE_PENDING = 1,
  INTEGRITY_RESPONSE_COMPLETED = 2
}
enum
Status returned when requesting integrity tokens/providers.
StandardIntegrityErrorCode{
  STANDARD_INTEGRITY_API_NOT_AVAILABLE = -1,
  STANDARD_INTEGRITY_PLAY_STORE_NOT_FOUND = -2,
  STANDARD_INTEGRITY_NETWORK_ERROR = -3,
  STANDARD_INTEGRITY_APP_NOT_INSTALLED = -5,
  STANDARD_INTEGRITY_PLAY_SERVICES_NOT_FOUND = -6,
  STANDARD_INTEGRITY_APP_UID_MISMATCH = -7,
  STANDARD_INTEGRITY_TOO_MANY_REQUESTS = -8,
  STANDARD_INTEGRITY_CANNOT_BIND_TO_SERVICE = -9,
  STANDARD_INTEGRITY_GOOGLE_SERVER_UNAVAILABLE = -12,
  STANDARD_INTEGRITY_PLAY_STORE_VERSION_OUTDATED = -14,
  STANDARD_INTEGRITY_PLAY_SERVICES_VERSION_OUTDATED = -15,
  CLOUD_PROJECT_NUMBER_IS_INVALID = -16,
  STANDARD_REQUEST_HASH_TOO_LONG = -17,
  STANDARD_CLIENT_TRANSIENT_ERROR = -18,
  STANDARD_INTEGRITY_TOKEN_PROVIDER_INVALID = -19,
  STANDARD_INTEGRITY_INTERNAL_ERROR = -100,
  STANDARD_INTEGRITY_INITIALIZATION_NEEDED = -101,
  STANDARD_INTEGRITY_INITIALIZATION_FAILED = -102,
  STANDARD_INTEGRITY_INVALID_ARGUMENT = -103
}
enum
Errors that can be encountered while using the standard integrity API.

Typedefs

IntegrityDialogRequest typedef
struct IntegrityDialogRequest_
An opaque struct used to provide information about an integrity dialog request.
IntegrityDialogResponse typedef
struct IntegrityDialogResponse_
An opaque struct used to access information about an integrity dialog response.
IntegrityTokenRequest typedef
struct IntegrityTokenRequest_
An opaque struct used to provide information about an integrity token request.
IntegrityTokenResponse typedef
struct IntegrityTokenResponse_
An opaque struct used to access information about an integrity token response.
PrepareIntegrityTokenRequest typedef
struct PrepareIntegrityTokenRequest_
An opaque struct used to represent a prepare integrity token request.
StandardIntegrityDialogRequest typedef
struct StandardIntegrityDialogRequest_
An opaque struct used to represent a standard integrity dialog request.
StandardIntegrityDialogResponse typedef
struct StandardIntegrityDialogResponse_
An opaque struct used to represent a standard integrity dialog response.
StandardIntegrityToken typedef
struct StandardIntegrityToken_
An opaque struct used to represent a standard integrity token response.
StandardIntegrityTokenProvider typedef
struct StandardIntegrityTokenProvider_
An opaque struct used to represent a standard integrity token provider.
StandardIntegrityTokenRequest typedef
struct StandardIntegrityTokenRequest_
An opaque struct used to represent a standard integrity token request.

Functions

IntegrityDialogRequest_create(IntegrityDialogRequest **out_request)
Creates a new IntegrityDialogRequest opaque struct.
IntegrityDialogRequest_destroy(IntegrityDialogRequest *request)
void
Releases the specified IntegrityDialogRequest and any references it holds.
IntegrityDialogRequest_setActivity(IntegrityDialogRequest *request, jobject android_activity)
Sets the Android Activity to show the dialog on.
IntegrityDialogRequest_setIntegrityTokenResponse(IntegrityDialogRequest *request, IntegrityTokenResponse *token_response)
Associates an IntegrityTokenResponse generated from a IntegrityManager_requestIntegrityToken() with an IntegrityDialogRequest.
IntegrityDialogRequest_setTypeCode(IntegrityDialogRequest *request, int type_code)
Sets the type of the dialog to show.
IntegrityDialogResponse_destroy(IntegrityDialogResponse *response)
void
Releases the specified IntegrityDialogResponse and any references it holds.
IntegrityDialogResponse_getResponseCode(IntegrityDialogResponse *response, IntegrityDialogResponseCode *out_response_code)
Retrieves the current status and result of an IntegrityManager_showDialog() operation.
IntegrityManager_destroy()
void
Frees up memory allocated for the Integrity API.
IntegrityManager_init(JavaVM *jvm, jobject android_context)
Initialize the Play Integrity API, making the other functions available to call.
IntegrityManager_requestIntegrityToken(IntegrityTokenRequest *request, IntegrityTokenResponse **out_response)
Starts an asynchronous operation to obtain a Play Integrity API token.
IntegrityManager_showDialog(IntegrityDialogRequest *request, IntegrityDialogResponse **out_response)
Initiates an asynchronous operation to show a dialog to the user.
IntegrityTokenRequest_create(IntegrityTokenRequest **out_request)
Creates a new IntegrityTokenRequest opaque struct.
IntegrityTokenRequest_destroy(IntegrityTokenRequest *request)
void
Releases the specified IntegrityTokenRequest and any references it holds.
IntegrityTokenRequest_setCloudProjectNumber(IntegrityTokenRequest *request, int64_t cloudProjectNumber)
Sets the cloud project number to link to the integrity token.
IntegrityTokenRequest_setNonce(IntegrityTokenRequest *request, const char *nonce)
Sets the nonce in an IntegrityTokenRequest with a given string.
IntegrityTokenResponse_destroy(IntegrityTokenResponse *response)
void
Releases the specified IntegrityTokenResponse and any references it holds.
IntegrityTokenResponse_getDialogResponseCode(IntegrityTokenResponse *token_response, IntegrityDialogResponseCode *out_response_code) Deprecated. Use IntegrityManager_showDialog() to show dialogs and IntegrityDialogResponse_getResponseCode() to get the response code instead.
Gets the response code for the dialog shown by IntegrityTokenResponse_showDialog.
IntegrityTokenResponse_getIsRemediable(IntegrityTokenResponse *response, bool *out_is_remediable)
Checks if the error associated with a given IntegrityTokenResponse is remediable.
IntegrityTokenResponse_getStatus(IntegrityTokenResponse *response, IntegrityResponseStatus *out_status)
Gets the status of an ongoing IntegrityManager_requestIntegrityToken() asynchronous operation.
IntegrityTokenResponse_getToken(IntegrityTokenResponse *response)
const char *
Gets the token retrieved by a successful IntegrityManager_requestIntegrityToken() asynchronous operation, returns null pointer otherwise.
IntegrityTokenResponse_showDialog(IntegrityTokenResponse *token_response, jobject android_activity, int type_code) Deprecated. Use IntegrityManager_showDialog() instead.
Displays a dialog to the user.
PrepareIntegrityTokenRequest_create(PrepareIntegrityTokenRequest **out_request)
Creates a new PrepareIntegrityTokenRequest opaque struct.
PrepareIntegrityTokenRequest_destroy(PrepareIntegrityTokenRequest *request)
void
Releases the specified PrepareIntegrityTokenRequest and any references it holds.
PrepareIntegrityTokenRequest_setCloudProjectNumber(PrepareIntegrityTokenRequest *request, int64_t cloud_project_number)
Sets the given cloud project number in PrepareIntegrityTokenRequest.
StandardIntegrityDialogRequest_create(StandardIntegrityDialogRequest **out_request)
Creates a new StandardIntegrityDialogRequest opaque struct.
StandardIntegrityDialogRequest_destroy(StandardIntegrityDialogRequest *request)
void
Releases the specified StandardIntegrityDialogRequest and any references it holds.
StandardIntegrityDialogRequest_setActivity(StandardIntegrityDialogRequest *request, jobject android_activity)
Sets the Android Activity to show the dialog on.
StandardIntegrityDialogRequest_setStandardIntegrityToken(StandardIntegrityDialogRequest *request, StandardIntegrityToken *token)
Associates a StandardIntegrityToken response from a StandardIntegrityTokenProvider_request() with a StandardIntegrityDialogRequest.
StandardIntegrityDialogRequest_setStandardIntegrityTokenProvider(StandardIntegrityDialogRequest *request, StandardIntegrityTokenProvider *provider)
Associates a StandardIntegrityTokenProvider response from a StandardIntegrityManager_prepareIntegrityToken() call with a StandardIntegrityDialogRequest.
StandardIntegrityDialogRequest_setTypeCode(StandardIntegrityDialogRequest *request, int type_code)
Sets the type of the dialog to show.
StandardIntegrityDialogResponse_destroy(StandardIntegrityDialogResponse *response)
void
Releases the specified StandardIntegrityDialogResponse and any references it holds.
StandardIntegrityDialogResponse_getResponseCode(StandardIntegrityDialogResponse *response, IntegrityDialogResponseCode *out_response_code)
Retrieves the current status and result of a StandardIntegrityManager_showDialog() operation.
StandardIntegrityManager_destroy()
void
Frees up memory allocated for the Standard Integrity Manager.
StandardIntegrityManager_init(JavaVM *jvm, jobject android_context)
Initialize the Standard Integrity Manager, making the other methods available to call.
StandardIntegrityManager_prepareIntegrityToken(PrepareIntegrityTokenRequest *request, StandardIntegrityTokenProvider **out_provider)
Asynchronously prepares the integrity token and makes it available for requesting via StandardIntegrityTokenProvider.
StandardIntegrityManager_showDialog(StandardIntegrityDialogRequest *request, StandardIntegrityDialogResponse **out_response)
Initiates an asynchronous operation to show a dialog to the user.
StandardIntegrityTokenProvider_destroy(StandardIntegrityTokenProvider *provider)
void
Releases the specified StandardIntegrityTokenProvider and any references it holds.
StandardIntegrityTokenProvider_getIsRemediable(StandardIntegrityTokenProvider *provider, bool *out_is_remediable)
Checks if an error that occurred during the StandardIntegrityManager_prepareIntegrityToken() operation is remediable.
StandardIntegrityTokenProvider_getStatus(StandardIntegrityTokenProvider *provider, IntegrityResponseStatus *out_status)
Gets the status of an ongoing StandardIntegrityManager_prepareIntegrityToken() asynchronous operation.
StandardIntegrityTokenProvider_request(StandardIntegrityTokenProvider *provider, StandardIntegrityTokenRequest *request, StandardIntegrityToken **out_token)
Asynchronously generates and returns a token for integrity-related enquiries.
StandardIntegrityTokenRequest_create(StandardIntegrityTokenRequest **out_request)
Creates a new StandardIntegrityTokenRequest opaque struct.
StandardIntegrityTokenRequest_destroy(StandardIntegrityTokenRequest *request)
void
Releases the specified StandardIntegrityTokenRequest and any references it holds.
StandardIntegrityTokenRequest_setRequestHash(StandardIntegrityTokenRequest *request, const char *request_hash)
Sets a request hash in a StandardIntegrityTokenRequest; the integrity token will be bound to this request hash.
StandardIntegrityTokenRequest_setVerdictOptOut(StandardIntegrityTokenRequest *request, std::set< int > verdict_opt_out)
Sets a set of verdicts that should be opted out when requesting the token.
StandardIntegrityToken_destroy(StandardIntegrityToken *token)
void
Releases the specified StandardIntegrityToken and any references it holds.
StandardIntegrityToken_getDialogResponseCode(StandardIntegrityToken *token, IntegrityDialogResponseCode *out_response_code) Deprecated. Use StandardIntegrityManager_showDialog() to show dialogs and StandardIntegrityDialogResponse_getResponseCode() to get the response code instead.
Gets the response code for the dialog shown by StandardIntegrityToken_showDialog.
StandardIntegrityToken_getIsRemediable(StandardIntegrityToken *token, bool *out_is_remediable)
Checks if the error associated with a given StandardIntegrityToken is remediable.
StandardIntegrityToken_getStatus(StandardIntegrityToken *token, IntegrityResponseStatus *out_status)
Gets the status of an ongoing StandardIntegrityTokenProvider_request asynchronous operation.
StandardIntegrityToken_getToken(StandardIntegrityToken *token)
const char *
Gets the token retrieved by a completed StandardIntegrityTokenProvider_request asynchronous operation, returns null pointer otherwise.
StandardIntegrityToken_showDialog(StandardIntegrityToken *token, jobject android_activity, int typeCode) Deprecated. Use StandardIntegrityManager_showDialog() instead.
Displays a dialog to the user.

Enumerations

IntegrityDialogResponseCode

 IntegrityDialogResponseCode

Status returned when showing the integrity dialog.

IntegrityErrorCode

 IntegrityErrorCode

Errors that can be encountered while using the integrity API.

Properties
INTEGRITY_API_NOT_AVAILABLE

Integrity API is not available.

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

  • Make sure that Integrity API is enabled in Google Play Console.
  • Ask the user to update Play Store.

INTEGRITY_APP_NOT_INSTALLED

The calling app is not installed.

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

INTEGRITY_APP_UID_MISMATCH

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

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

INTEGRITY_CANNOT_BIND_TO_SERVICE

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.

INTEGRITY_CLIENT_TRANSIENT_ERROR

There was a transient error in the client device.

Introduced in Play Core Java library 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.

INTEGRITY_CLOUD_PROJECT_NUMBER_IS_INVALID

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 Play Integrity API is enabled.

INTEGRITY_GOOGLE_SERVER_UNAVAILABLE

Unknown internal Google server error.

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

INTEGRITY_INITIALIZATION_FAILED

There was an error initializing the Integrity API.

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

INTEGRITY_INITIALIZATION_NEEDED

IntegrityManager is not initialized.

Call IntegrityManager_init() first.

INTEGRITY_INTERNAL_ERROR

Unknown internal error.

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

INTEGRITY_INVALID_ARGUMENT

Invalid argument passed to the Integrity API.

Retry with correct argument.

INTEGRITY_NETWORK_ERROR

No available network is found.

Ask the user to check for a connection.

INTEGRITY_NONCE_IS_NOT_BASE64

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

Retry with correct nonce format.

INTEGRITY_NONCE_TOO_LONG

Nonce length is too long.

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

Retry with a shorter nonce.

INTEGRITY_NONCE_TOO_SHORT

Nonce length is too short.

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

Retry with a longer nonce.

INTEGRITY_NO_ERROR

No error has occurred.

INTEGRITY_PLAY_SERVICES_NOT_FOUND

Play Services is not available or version is too old.

Ask the user to Install or Update Play Services.

INTEGRITY_PLAY_SERVICES_VERSION_OUTDATED

Play Services needs to be updated.

Ask the user to update Google Play Services.

INTEGRITY_PLAY_STORE_ACCOUNT_NOT_FOUND

No Play Store account is found on device.

Note that the Play Integrity 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.

INTEGRITY_PLAY_STORE_NOT_FOUND

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.

INTEGRITY_PLAY_STORE_VERSION_OUTDATED

The Play Store needs to be updated.

Ask the user to update the Google Play Store.

INTEGRITY_TOO_MANY_REQUESTS

The calling app has made too many requests to the API and has been throttled, or your app has exceeded its daily request quota.

Retry with an exponential backoff. Request an increase to your daily request quota if you're at your daily request limit.

IntegrityResponseStatus

 IntegrityResponseStatus

Status returned when requesting integrity tokens/providers.

Properties
INTEGRITY_RESPONSE_COMPLETED

The asynchronous operation has finished.

INTEGRITY_RESPONSE_PENDING

Waiting for asynchronous operation to finish.

INTEGRITY_RESPONSE_UNKNOWN

The response status is unknown.

StandardIntegrityErrorCode

 StandardIntegrityErrorCode

Errors that can be encountered while using the standard integrity API.

Properties
CLOUD_PROJECT_NUMBER_IS_INVALID

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 Play Integrity API is enabled.

STANDARD_CLIENT_TRANSIENT_ERROR

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.

STANDARD_INTEGRITY_API_NOT_AVAILABLE

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 allowlisted to use Standard Integrity API.
  • Make sure that Integrity API is enabled in Google Play Console.
  • Ask the user to update Play Store.

STANDARD_INTEGRITY_APP_NOT_INSTALLED

The calling app is not installed.

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

STANDARD_INTEGRITY_APP_UID_MISMATCH

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

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

STANDARD_INTEGRITY_CANNOT_BIND_TO_SERVICE

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.

STANDARD_INTEGRITY_GOOGLE_SERVER_UNAVAILABLE

Unknown internal Google server error.

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

STANDARD_INTEGRITY_INITIALIZATION_FAILED

There was an error initializing the Standard Integrity API.

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

STANDARD_INTEGRITY_INITIALIZATION_NEEDED

StandardIntegrityManager is not initialized.

Call StandardIntegrityManager_init() first.

STANDARD_INTEGRITY_INTERNAL_ERROR

Unknown internal error.

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

STANDARD_INTEGRITY_INVALID_ARGUMENT

Invalid argument passed to the Standard Integrity API.

Retry with correct argument.

STANDARD_INTEGRITY_NETWORK_ERROR

No available network is found.

Ask the user to check for a connection.

STANDARD_INTEGRITY_PLAY_SERVICES_NOT_FOUND

Play Services is not available or version is too old.

Ask the user to Install or Update Play Services.

STANDARD_INTEGRITY_PLAY_SERVICES_VERSION_OUTDATED

Play Services needs to be updated.

Ask the user to update Google Play Services.

STANDARD_INTEGRITY_PLAY_STORE_NOT_FOUND

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.

STANDARD_INTEGRITY_PLAY_STORE_VERSION_OUTDATED

The Play Store needs to be updated.

Ask the user to update the Google Play Store.

STANDARD_INTEGRITY_TOKEN_PROVIDER_INVALID

The StandardIntegrityTokenProvider is invalid (e.g.

it is outdated). This error can only be returned for StandardIntegrityTokenProvider_request().

Request a new integrity token provider by calling StandardIntegrityManager_prepareIntegrityToken().

STANDARD_INTEGRITY_TOO_MANY_REQUESTS

The calling app has made too many requests to the API and has been throttled, or your app has exceeded its daily request quota.

Retry with an exponential backoff. Request an increase to your daily request quota if you're at your daily request limit.

STANDARD_REQUEST_HASH_TOO_LONG

The provided request hash is too long.

The request hash length must be less than 500 bytes.

Retry with a shorter request hash.

Typedefs

IntegrityDialogRequest

struct IntegrityDialogRequest_ IntegrityDialogRequest

An opaque struct used to provide information about an integrity dialog request.

IntegrityDialogResponse

struct IntegrityDialogResponse_ IntegrityDialogResponse

An opaque struct used to access information about an integrity dialog response.

IntegrityTokenRequest

struct IntegrityTokenRequest_ IntegrityTokenRequest

An opaque struct used to provide information about an integrity token request.

IntegrityTokenResponse

struct IntegrityTokenResponse_ IntegrityTokenResponse

An opaque struct used to access information about an integrity token response.

PrepareIntegrityTokenRequest

struct PrepareIntegrityTokenRequest_ PrepareIntegrityTokenRequest

An opaque struct used to represent a prepare integrity token request.

StandardIntegrityDialogRequest

struct StandardIntegrityDialogRequest_ StandardIntegrityDialogRequest

An opaque struct used to represent a standard integrity dialog request.

StandardIntegrityDialogResponse

struct StandardIntegrityDialogResponse_ StandardIntegrityDialogResponse

An opaque struct used to represent a standard integrity dialog response.

StandardIntegrityToken

struct StandardIntegrityToken_ StandardIntegrityToken

An opaque struct used to represent a standard integrity token response.

StandardIntegrityTokenProvider

struct StandardIntegrityTokenProvider_ StandardIntegrityTokenProvider

An opaque struct used to represent a standard integrity token provider.

StandardIntegrityTokenRequest

struct StandardIntegrityTokenRequest_ StandardIntegrityTokenRequest

An opaque struct used to represent a standard integrity token request.

Functions

IntegrityDialogRequest_create

IntegrityErrorCode IntegrityDialogRequest_create(
  IntegrityDialogRequest **out_request
)

Creates a new IntegrityDialogRequest opaque struct.

See also: IntegrityDialogRequest_destroy

Details
Parameters
out_request
An out parameter for receiving the result.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that the out parameter shouldn't be used.

IntegrityDialogRequest_destroy

void IntegrityDialogRequest_destroy(
  IntegrityDialogRequest *request
)

Releases the specified IntegrityDialogRequest and any references it holds.

Details
Parameters
request
The request to free.

IntegrityDialogRequest_setActivity

IntegrityErrorCode IntegrityDialogRequest_setActivity(
  IntegrityDialogRequest *request,
  jobject android_activity
)

Sets the Android Activity to show the dialog on.

Details
Parameters
request
The IntegrityDialogRequest for which to set the activity.
android_activity
The Android Activity to show the dialog on.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that this operation has failed.

IntegrityDialogRequest_setIntegrityTokenResponse

IntegrityErrorCode IntegrityDialogRequest_setIntegrityTokenResponse(
  IntegrityDialogRequest *request,
  IntegrityTokenResponse *token_response
)

Associates an IntegrityTokenResponse generated from a IntegrityManager_requestIntegrityToken() with an IntegrityDialogRequest.

This is required because a dialog can only be requested after an integrity token request has been made.

Details
Parameters
request
The IntegrityDialogRequest for which to set the integrity response.
token_response
The IntegrityTokenResponse to associate with the dialog request.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that this operation has failed.

IntegrityDialogRequest_setTypeCode

IntegrityErrorCode IntegrityDialogRequest_setTypeCode(
  IntegrityDialogRequest *request,
  int type_code
)

Sets the type of the dialog to show.

Details
Parameters
request
The IntegrityDialogRequest for which to set the type.
type_code
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that this operation has failed.

IntegrityDialogResponse_destroy

void IntegrityDialogResponse_destroy(
  IntegrityDialogResponse *response
)

Releases the specified IntegrityDialogResponse and any references it holds.

Details
Parameters
response
The response to free.

IntegrityDialogResponse_getResponseCode

IntegrityErrorCode IntegrityDialogResponse_getResponseCode(
  IntegrityDialogResponse *response,
  IntegrityDialogResponseCode *out_response_code
)

Retrieves the current status and result of an IntegrityManager_showDialog() operation.

This function can be used to poll for the completion of a call to IntegrityManager_showDialog(). The function does not make any JNI calls, hence can be called every frame.

Details
Parameters
response
The IntegrityDialogResponse for which to get status.
out_response_code
An out parameter for receiving the IntegrityDialogResponseCode.
Returns
INTEGRITY_NO_ERROR if the poll operation succeeded and the response code was retrieved successfully; any other value indicates an error, which could have occurred either while showing the dialog or while retrieving the response code.

IntegrityManager_destroy

void IntegrityManager_destroy()

Frees up memory allocated for the Integrity API.

Does nothing if IntegrityManager_init() hasn't been called.

IntegrityManager_init

IntegrityErrorCode IntegrityManager_init(
  JavaVM *jvm,
  jobject android_context
)

Initialize the Play Integrity API, making the other functions available to call.

In case of failure the Play Integrity API is unavailable, and there will be an error in logcat. The most common reason for failure is that the PlayCore AAR is missing or some of its classes/methods weren't retained by ProGuard. See also:IntegrityManager_destroy

Details
Parameters
jvm
The app's single JavaVM, for example from ANativeActivity's "vm" field.
android_context
An Android Context, for example from ANativeActivity's "clazz" field.
Returns
INTEGRITY_NO_ERROR if initialization succeeded, or an error if failed.

IntegrityManager_requestIntegrityToken

IntegrityErrorCode IntegrityManager_requestIntegrityToken(
  IntegrityTokenRequest *request,
  IntegrityTokenResponse **out_response
)

Starts an asynchronous operation to obtain a Play Integrity API token.

For an ongoing asynchronous operation, use IntegrityTokenResponse_getStatus() to poll for the status of the IntegrityTokenResponse. When the status reaches INTEGRITY_RESPONSE_COMPLETED with INTEGRITY_NO_ERROR, use IntegrityTokenResponse_getToken() to acquire the resulting token.

See also: IntegrityTokenResponse_destroy

Details
Parameters
request
The request containing the nonce.
out_response
An out parameter for receiving the result.
Returns
INTEGRITY_NO_ERROR if the request started successfully, corresponding error if failed.

IntegrityManager_showDialog

IntegrityErrorCode IntegrityManager_showDialog(
  IntegrityDialogRequest *request,
  IntegrityDialogResponse **out_response
)

Initiates an asynchronous operation to show a dialog to the user.

Use IntegrityDialogResponse_getResponseCode() with the returned out_response object to poll for the final result of the operation.

See also: IntegrityDialogResponse_destroy

Details
Parameters
request
The IntegrityDialogRequest which contains all the information required to show the dialog.
out_response
An out parameter for receiving the result.
Returns
INTEGRITY_NO_ERROR if the request started successfully, corresponding error if failed.

IntegrityTokenRequest_create

IntegrityErrorCode IntegrityTokenRequest_create(
  IntegrityTokenRequest **out_request
)

Creates a new IntegrityTokenRequest opaque struct.

See also: IntegrityTokenRequest_destroy

Details
Parameters
out_request
An out parameter for receiving the result.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that the out parameter shouldn't be used.

IntegrityTokenRequest_destroy

void IntegrityTokenRequest_destroy(
  IntegrityTokenRequest *request
)

Releases the specified IntegrityTokenRequest and any references it holds.

Details
Parameters
request
The request to free.

IntegrityTokenRequest_setCloudProjectNumber

IntegrityErrorCode IntegrityTokenRequest_setCloudProjectNumber(
  IntegrityTokenRequest *request,
  int64_t cloudProjectNumber
)

Sets the cloud project number to link to the integrity token.

This field is required for apps exclusively distributed outside of Google Play and SDKs. For apps distributed on Google Play, the cloud project number is configured in the Play Console and need not be set on the request.

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

Calls to decrypt the token on Google's server must be authenticated using the cloud account that was linked to the token in this request.

Details
Parameters
request
The IntegrityTokenRequest to set cloudProjectNumber.
cloudProjectNumber
The cloudProjectNumber for the request.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that this operation has failed.

IntegrityTokenRequest_setNonce

IntegrityErrorCode IntegrityTokenRequest_setNonce(
  IntegrityTokenRequest *request,
  const char *nonce
)

Sets the nonce in an IntegrityTokenRequest with a given string.

It must be base64 encoded in web-safe no-wrap form.

See https://developer.android.com/google/play/integrity/verdict#nonce for details about the nonce requirements and recommendations.

Details
Parameters
request
The IntegrityTokenRequest for which to set token.
nonce
The nonce for the request.
Returns
An IntegrityErrorCode, which if not INTEGRITY_NO_ERROR indicates that this operation has failed.

IntegrityTokenResponse_destroy

void IntegrityTokenResponse_destroy(
  IntegrityTokenResponse *response
)

Releases the specified IntegrityTokenResponse and any references it holds.

Details
Parameters
response
The response to free.

IntegrityTokenResponse_getDialogResponseCode

IntegrityErrorCode IntegrityTokenResponse_getDialogResponseCode(
  IntegrityTokenResponse *token_response,
  IntegrityDialogResponseCode *out_response_code
)

Gets the response code for the dialog shown by IntegrityTokenResponse_showDialog.

Deprecated. Use IntegrityManager_showDialog() to show dialogs and IntegrityDialogResponse_getResponseCode() to get the response code instead.

Details
Parameters
token_response
The IntegrityTokenResponse for which to get status.
out_response_code
An out parameter for receiving the IntegrityDialogResponseCode. This is set if the call to IntegrityTokenResponse_showDialog was successful.
Returns
INTEGRITY_NO_ERROR if IntegrityTokenResponse_showDialog was successful; any other value indicates an error that has occurred while showing the dialog or requesting the dialog response code.

IntegrityTokenResponse_getIsRemediable

IntegrityErrorCode IntegrityTokenResponse_getIsRemediable(
  IntegrityTokenResponse *response,
  bool *out_is_remediable
)

Checks if the error associated with a given IntegrityTokenResponse is remediable.

An error is considered remediable if the user can potentially fix the issue by taking action through a dialog shown by the Integrity API. This function helps determine if calling the IntegrityManager_showDialog() is appropriate.

The function's return value indicates the status of the check operation itself. The boolean result of whether the error is remediable is returned via the 'out_is_remediable' output parameter.

For more details on error remediation, please see the Play Integrity API documentation: https://developer.android.com/google/play/integrity/remediation

See also: IntegrityTokenResponse_getStatus

Details
Parameters
response
The IntegrityTokenResponse to check. Must not be NULL.
out_is_remediable
Output parameter to receive the boolean result. Must not be NULL. Set to true if the error is remediable, false otherwise. This value is only meaningful if the function returns INTEGRITY_NO_ERROR.
Returns
INTEGRITY_NO_ERROR if the check was performed successfully. An IntegrityErrorCode value indicating an error during the check itself (e.g., invalid arguments like NULL pointers).

IntegrityTokenResponse_getStatus

IntegrityErrorCode IntegrityTokenResponse_getStatus(
  IntegrityTokenResponse *response,
  IntegrityResponseStatus *out_status
)

Gets the status of an ongoing IntegrityManager_requestIntegrityToken() asynchronous operation.

This function can be used to poll for the completion of a call to IntegrityManager_requestIntegrityToken(). This function does not make any JNI calls and can be called every frame.

Details
Parameters
response
The IntegrityTokenResponse for which to get status.
out_status
An out parameter for receiving the IntegrityResponseStatus.
Returns
An IntegrityErrorCode indicating the error associated with the given IntegrityTokenResponse.

IntegrityTokenResponse_getToken

const char * IntegrityTokenResponse_getToken(
  IntegrityTokenResponse *response
)

Gets the token retrieved by a successful IntegrityManager_requestIntegrityToken() asynchronous operation, returns null pointer otherwise.

The JSON payload is signed and encrypted as a nested JWT, that is JWE of JWS.

JWE uses A256KW as a key wrapping algorithm and A256GCM as a content encryption algorithm. JWS uses ES256 as a signing algorithm.

All decryption and verification should be done within a secure server environment. Do not decrypt or verify the received token from within the client app. In particular, never expose any decryption keys to the client app.

See https://developer.android.com/google/play/integrity/verdict#token-format.

The string returned here is owned by the API, and the pointer will be valid until the corresponding IntegrityTokenResponse is freed by calling IntegrityTokenResponse_destroy().

Details
Parameters
response
The IntegrityTokenResponse specifying the asynchronous operation.
Returns
A token which contains the response for the integrity related enquiries.

IntegrityTokenResponse_showDialog

IntegrityErrorCode IntegrityTokenResponse_showDialog(
  IntegrityTokenResponse *token_response,
  jobject android_activity,
  int type_code
)

Displays a dialog to the user.

This method can only be called once per Integrity API response. See also:IntegrityTokenResponse_getDialogResponseCode Deprecated. Use IntegrityManager_showDialog() instead.

Details
Parameters
token_response
The IntegrityTokenResponse for which to show the dialog.
android_activity
The Android Activity to show the dialog on.
type_code
Returns
A IntegrityErrorCode representing the result of the operation.

PrepareIntegrityTokenRequest_create

StandardIntegrityErrorCode PrepareIntegrityTokenRequest_create(
  PrepareIntegrityTokenRequest **out_request
)

Creates a new PrepareIntegrityTokenRequest opaque struct.

See also: PrepareIntegrityTokenRequest_destroy

Details
Parameters
out_request
An out parameter for receiving the result.
Returns
STANDARD_INTEGRITY_NO_ERROR if initialized successfully; any other value indicates that an error has occurred and the out parameter shouldn't be used.

PrepareIntegrityTokenRequest_destroy

void PrepareIntegrityTokenRequest_destroy(
  PrepareIntegrityTokenRequest *request
)

Releases the specified PrepareIntegrityTokenRequest and any references it holds.

Details
Parameters
request
A PrepareIntegrityTokenRequest to free.

PrepareIntegrityTokenRequest_setCloudProjectNumber

StandardIntegrityErrorCode PrepareIntegrityTokenRequest_setCloudProjectNumber(
  PrepareIntegrityTokenRequest *request,
  int64_t cloud_project_number
)

Sets the given cloud project number in PrepareIntegrityTokenRequest.

This method should be called after initialising the request via PrepareIntegrityTokenRequest_create method.

Details
Parameters
request
A PrepareIntegrityTokenRequest for which to set the cloud project number.
cloud_project_number
The cloud project number.
Returns
STANDARD_INTEGRITY_NO_ERROR on success; any other value indicates that an error has occurred due to invalid arguments.

StandardIntegrityDialogRequest_create

StandardIntegrityErrorCode StandardIntegrityDialogRequest_create(
  StandardIntegrityDialogRequest **out_request
)

Creates a new StandardIntegrityDialogRequest opaque struct.

See also: StandardIntegrityDialogRequest_destroy

Details
Parameters
out_request
An out parameter for receiving the result.
Returns
STANDARD_INTEGRITY_NO_ERROR if initialized successfully; any other value indicates that an error has occurred and the out parameter shouldn't be used.

StandardIntegrityDialogRequest_destroy

void StandardIntegrityDialogRequest_destroy(
  StandardIntegrityDialogRequest *request
)

Releases the specified StandardIntegrityDialogRequest and any references it holds.

Details
Parameters
request
The request to free.

StandardIntegrityDialogRequest_setActivity

StandardIntegrityErrorCode StandardIntegrityDialogRequest_setActivity(
  StandardIntegrityDialogRequest *request,
  jobject android_activity
)

Sets the Android Activity to show the dialog on.

Details
Parameters
request
The StandardIntegrityDialogRequest for which to set the activity.
android_activity
The Android Activity to show the dialog on.
Returns
An StandardIntegrityErrorCode, which if not STANDARD_INTEGRITY_NO_ERROR indicates that this operation has failed.

StandardIntegrityDialogRequest_setStandardIntegrityToken

StandardIntegrityErrorCode StandardIntegrityDialogRequest_setStandardIntegrityToken(
  StandardIntegrityDialogRequest *request,
  StandardIntegrityToken *token
)

Associates a StandardIntegrityToken response from a StandardIntegrityTokenProvider_request() with a StandardIntegrityDialogRequest.

Note that calling this method automatically unsets any previous StandardIntegrityTokenProvider that may have been attached to the request via StandardIntegrityDialogRequest_setStandardIntegrityTokenProvider(). This is because an integrity dialog request can only be associated with one type of underlying integrity issue.

Details
Parameters
request
The IntegrityDialogRequest for which to set the integrity response.
token
The StandardIntegrityToken to associate with the dialog request.
Returns
An StandardIntegrityErrorCode, which if not STANDARD_INTEGRITY_NO_ERROR indicates that this operation has failed.

StandardIntegrityDialogRequest_setStandardIntegrityTokenProvider

StandardIntegrityErrorCode StandardIntegrityDialogRequest_setStandardIntegrityTokenProvider(
  StandardIntegrityDialogRequest *request,
  StandardIntegrityTokenProvider *provider
)

Associates a StandardIntegrityTokenProvider response from a StandardIntegrityManager_prepareIntegrityToken() call with a StandardIntegrityDialogRequest.

This is typically used when constructing a dialog request to resolve certain errors that may occur during the StandardIntegrityManager_prepareIntegrityToken() call.

For more details on error remediation, please see the Play Integrity API documentation: https://developer.android.com/google/play/integrity/remediation

Note that calling this method automatically unsets any previous StandardIntegrityToken that may have been attached to the request via StandardIntegrityDialogRequest_setStandardIntegrityToken(). This is because an integrity dialog request can only be associated with one type of underlying integrity issue.

See also: StandardIntegrityTokenProvider_getIsRemediable

Details
Parameters
request
The IntegrityDialogRequest for which to set the integrity response.
provider
The StandardIntegrityTokenProvider to associate with the dialog request.
Returns
An StandardIntegrityErrorCode, which if not STANDARD_INTEGRITY_NO_ERROR indicates that this operation has failed.

StandardIntegrityDialogRequest_setTypeCode

StandardIntegrityErrorCode StandardIntegrityDialogRequest_setTypeCode(
  StandardIntegrityDialogRequest *request,
  int type_code
)

Sets the type of the dialog to show.

Details
Parameters
request
The StandardIntegrityDialogRequest for which to set the type.
type_code
Returns
An StandardIntegrityErrorCode, which if not STANDARD_INTEGRITY_NO_ERROR indicates that this operation has failed.

StandardIntegrityDialogResponse_destroy

void StandardIntegrityDialogResponse_destroy(
  StandardIntegrityDialogResponse *response
)

Releases the specified StandardIntegrityDialogResponse and any references it holds.

Details
Parameters
response
The response to free.

StandardIntegrityDialogResponse_getResponseCode

StandardIntegrityErrorCode StandardIntegrityDialogResponse_getResponseCode(
  StandardIntegrityDialogResponse *response,
  IntegrityDialogResponseCode *out_response_code
)

Retrieves the current status and result of a StandardIntegrityManager_showDialog() operation.

This function is used to poll the result of an asynchronous dialog request initiated by StandardIntegrityManager_showDialog(). It does not perform any JNI calls, hence it is safe and efficient to call every frame.

See also: StandardIntegrityDialogResponse_destroy

Details
Parameters
response
The response object returned by StandardIntegrityManager_showDialog().
out_response_code
An output parameter for receiving the IntegrityDialogResponseCode.
Returns
STANDARD_INTEGRITY_NO_ERROR if the poll operation succeeded and the response code was retrieved successfully; any other value indicates an error, which could have occurred either while showing the dialog or while retrieving the response code.

StandardIntegrityManager_destroy

void StandardIntegrityManager_destroy()

Frees up memory allocated for the Standard Integrity Manager.

Does nothing if StandardIntegrityManager_init() hasn't been called.

StandardIntegrityManager_init

StandardIntegrityErrorCode StandardIntegrityManager_init(
  JavaVM *jvm,
  jobject android_context
)

Initialize the Standard Integrity Manager, making the other methods available to call.

In case of failure, the Standard Integrity API is unavailable, and there will be an error in logcat. The most common reason for failure is that the PlayCore AAR is missing or some of its classes/methods weren't retained by ProGuard. See also:StandardIntegrityManager_destroy

Details
Parameters
jvm
The app's single JavaVM. For example, from ANativeActivity's "vm" field.
android_context
An Android Context. For example, from ANativeActivity's "clazz" field.
Returns
STANDARD_INTEGRITY_NO_ERROR if initialization succeeded, or an error on failure.

StandardIntegrityManager_prepareIntegrityToken

StandardIntegrityErrorCode StandardIntegrityManager_prepareIntegrityToken(
  PrepareIntegrityTokenRequest *request,
  StandardIntegrityTokenProvider **out_provider
)

Asynchronously prepares the integrity token and makes it available for requesting via StandardIntegrityTokenProvider.

This method can be called from time to time to refresh the resulting StandardIntegrityTokenProvider. Note that this API makes a call to Google servers and hence requires a network connection.

Note that the API is in beta mode.

See also: StandardIntegrityTokenProvider_destroy

Details
Parameters
request
The request containing the cloud project number.
out_provider
An out parameter for receiving the token provider.
Returns
STANDARD_INTEGRITY_NO_ERROR if request started successfully; any other value indicates that an error has occurred and the out parameter shouldn't be used.

StandardIntegrityManager_showDialog

StandardIntegrityErrorCode StandardIntegrityManager_showDialog(
  StandardIntegrityDialogRequest *request,
  StandardIntegrityDialogResponse **out_response
)

Initiates an asynchronous operation to show a dialog to the user.

Use StandardIntegrityDialogResponse_getResponseCode() with the returned out_response object to poll for the final result of the operation.

Details
Parameters
request
The StandardIntegrityDialogRequest which contains all the information required to show the dialog.
out_response
An out parameter for receiving the result of the dialog request. This is set if the call to StandardIntegrityManager_showDialog was successful.
Returns
STANDARD_INTEGRITY_NO_ERROR if StandardIntegrityManager_showDialog was successful; any other value indicates an error that has occurred while requesting the dialog response code.

StandardIntegrityTokenProvider_destroy

void StandardIntegrityTokenProvider_destroy(
  StandardIntegrityTokenProvider *provider
)

Releases the specified StandardIntegrityTokenProvider and any references it holds.

Details
Parameters
provider
The provider object to free.

StandardIntegrityTokenProvider_getIsRemediable

StandardIntegrityErrorCode StandardIntegrityTokenProvider_getIsRemediable(
  StandardIntegrityTokenProvider *provider,
  bool *out_is_remediable
)

Checks if an error that occurred during the StandardIntegrityManager_prepareIntegrityToken() operation is remediable.

An error is considered remediable if the user can potentially fix the underlying issue by taking action through a dialog shown by the Integrity API. This function helps determine if calling the StandardIntegrityManager_showDialog() is appropriate.

The function's return value indicates the status of the check operation itself. The boolean result of whether the error is remediable is returned via the 'out_is_remediable' output parameter.

For more details on error remediation, please see the Play Integrity API documentation: https://developer.android.com/google/play/integrity/remediation

See also: StandardIntegrityTokenProvider_getStatus See also: StandardIntegrityDialogRequest_setStandardIntegrityTokenProvider

Details
Parameters
provider
The StandardIntegrityTokenProvider for which to check. Must not be NULL.
out_is_remediable
Output parameter to receive the boolean result. Must not be NULL. Set to true if the error is remediable, false otherwise. This value is only meaningful if the function returns STANDARD_INTEGRITY_NO_ERROR.
Returns
STANDARD_INTEGRITY_NO_ERROR if the check was performed successfully. An IntegrityErrorCode value indicating an error during the check itself (e.g., invalid arguments like NULL pointers).

StandardIntegrityTokenProvider_getStatus

StandardIntegrityErrorCode StandardIntegrityTokenProvider_getStatus(
  StandardIntegrityTokenProvider *provider,
  IntegrityResponseStatus *out_status
)

Gets the status of an ongoing StandardIntegrityManager_prepareIntegrityToken() asynchronous operation.

See also: StandardIntegrityTokenProvider_getIsRemediable

Details
Parameters
provider
The StandardIntegrityTokenProvider for which to get status.
out_status
An out parameter for receiving the IntegrityResponseStatus.
Returns
STANDARD_INTEGRITY_NO_ERROR if the request is successful or in progress; any other value indicates an error that has occurred while requesting token provider.

StandardIntegrityTokenProvider_request

StandardIntegrityErrorCode StandardIntegrityTokenProvider_request(
  StandardIntegrityTokenProvider *provider,
  StandardIntegrityTokenRequest *request,
  StandardIntegrityToken **out_token
)

Asynchronously generates and returns a token for integrity-related enquiries.

This must be called after StandardIntegrityManager_prepareIntegrityToken completes.

Note that the API is in beta mode.

See also: StandardIntegrityToken_destroy

Details
Parameters
provider
A StandardIntegrityTokenProvider used to request token.
request
A StandardIntegrityTokenRequest containing an optional request hash.
out_token
An out parameter for receiving the result.
Returns
STANDARD_INTEGRITY_NO_ERROR if the token request was initiated successfully; any other value indicates that an error has occurred and the out parameter shouldn't be used.

StandardIntegrityTokenRequest_create

StandardIntegrityErrorCode StandardIntegrityTokenRequest_create(
  StandardIntegrityTokenRequest **out_request
)

Creates a new StandardIntegrityTokenRequest opaque struct.

See also: StandardIntegrityTokenRequest_destroy

Details
Parameters
out_request
An out parameter for receiving the result.
Returns
STANDARD_INTEGRITY_NO_ERROR if initialized successfully; any other value indicates that an error has occurred and the out parameter shouldn't be used.

StandardIntegrityTokenRequest_destroy

void StandardIntegrityTokenRequest_destroy(
  StandardIntegrityTokenRequest *request
)

Releases the specified StandardIntegrityTokenRequest and any references it holds.

Details
Parameters
request
A StandardIntegrityTokenRequest to free.

StandardIntegrityTokenRequest_setRequestHash

StandardIntegrityErrorCode StandardIntegrityTokenRequest_setRequestHash(
  StandardIntegrityTokenRequest *request,
  const char *request_hash
)

Sets a request hash in a StandardIntegrityTokenRequest; the integrity token will be bound to this request hash.

It is recommended but not required.

Details
Parameters
request
The StandardIntegrityTokenRequest for which to set the request hash.
request_hash
A request hash to bind the integrity token to. string.
Returns
STANDARD_INTEGRITY_NO_ERROR on success; any other value indicates that an error has occurred due to invalid arguments.

StandardIntegrityTokenRequest_setVerdictOptOut

StandardIntegrityErrorCode StandardIntegrityTokenRequest_setVerdictOptOut(
  StandardIntegrityTokenRequest *request,
  std::set< int > verdict_opt_out
)

Sets a set of verdicts that should be opted out when requesting the token.

Any verdicts specified here will be unevaluated.

Details
Parameters
request
The StandardIntegrityTokenRequest for which to set the verdict opt out.
verdict_opt_out
A set of integrity token verdicts that should be opted-out. See https://developer.android.com/google/play/integrity/reference/com/google/android/play/core/integrity/model/StandardIntegrityVerdictOptOut.html for more information about the supported codes for opting out from verdicts. set.
Returns
STANDARD_INTEGRITY_NO_ERROR on success; any other value indicates that an error has occurred due to invalid arguments.

StandardIntegrityToken_destroy

void StandardIntegrityToken_destroy(
  StandardIntegrityToken *token
)

Releases the specified StandardIntegrityToken and any references it holds.

Details
Parameters
token
A StandardIntegrityToken response to free.

StandardIntegrityToken_getDialogResponseCode

StandardIntegrityErrorCode StandardIntegrityToken_getDialogResponseCode(
  StandardIntegrityToken *token,
  IntegrityDialogResponseCode *out_response_code
)

Gets the response code for the dialog shown by StandardIntegrityToken_showDialog.

Deprecated. Use StandardIntegrityManager_showDialog() to show dialogs and StandardIntegrityDialogResponse_getResponseCode() to get the response code instead.

Details
Parameters
token
The StandardIntegrityToken for which to get status.
out_response_code
An out parameter for receiving the IntegrityDialogResponseCode. This is set if the call to StandardIntegrityToken_showDialog was successful.
Returns
STANDARD_INTEGRITY_NO_ERROR if StandardIntegrityToken_showDialog was successful; any other value indicates an error that has occurred while showing the dialog or requesting the dialog response code.

StandardIntegrityToken_getIsRemediable

StandardIntegrityErrorCode StandardIntegrityToken_getIsRemediable(
  StandardIntegrityToken *token,
  bool *out_is_remediable
)

Checks if the error associated with a given StandardIntegrityToken is remediable.

An error is considered remediable if the user can potentially fix the underlying issue by taking action through a dialog shown by the Integrity API. This function helps determine if calling the StandardIntegrityManager_showDialog() is appropriate.

The function's return value indicates the status of the check operation itself. The boolean result of whether the error is remediable is returned via the 'out_is_remediable' output parameter.

For more details on error remediation, please see the Play Integrity API documentation: https://developer.android.com/google/play/integrity/remediation

See also: StandardIntegrityToken_getStatus

Details
Parameters
token
The StandardIntegrityToken for which to check. Must not be NULL.
out_is_remediable
Output parameter to receive the boolean result. Must not be NULL. Set to true if the error is remediable, false otherwise. This value is only meaningful if the function returns STANDARD_INTEGRITY_NO_ERROR.
Returns
STANDARD_INTEGRITY_NO_ERROR if the check was performed successfully. An IntegrityErrorCode value indicating an error during the check itself (e.g., invalid arguments like NULL pointers).

StandardIntegrityToken_getStatus

StandardIntegrityErrorCode StandardIntegrityToken_getStatus(
  StandardIntegrityToken *token,
  IntegrityResponseStatus *out_status
)

Gets the status of an ongoing StandardIntegrityTokenProvider_request asynchronous operation.

Details
Parameters
token
The StandardIntegrityToken for which to get status.
out_status
An out parameter for receiving the IntegrityResponseStatus.
Returns
STANDARD_INTEGRITY_NO_ERROR if the request is successful or in progress; any other value indicates an error that has occurred while requesting token.

StandardIntegrityToken_getToken

const char * StandardIntegrityToken_getToken(
  StandardIntegrityToken *token
)

Gets the token retrieved by a completed StandardIntegrityTokenProvider_request asynchronous operation, returns null pointer otherwise.

The string returned here is owned by the API, and the pointer will be valid until the corresponding StandardIntegrityToken is freed by calling StandardIntegrityToken_destroy.

Details
Parameters
token
A StandardIntegrityToken response to retrieve token from.
Returns
A token which contains the response for the integrity related enquiries.

StandardIntegrityToken_showDialog

StandardIntegrityErrorCode StandardIntegrityToken_showDialog(
  StandardIntegrityToken *token,
  jobject android_activity,
  int typeCode
)

Displays a dialog to the user.

This method can only be called once per Integrity API response. See also:StandardIntegrityToken_getDialogResponseCode Deprecated. Use StandardIntegrityManager_showDialog() instead.

Details
Parameters
token
The StandardIntegrityToken for which to show the dialog.
android_activity
The Android Activity to show the dialog on.
typeCode
Returns
A StandardIntegrityErrorCode representing the result of the operation.