Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
IntegrityTokenRequest.Builder
public
static
abstract
class
IntegrityTokenRequest.Builder
extends Object
java.lang.Object |
↳ |
com.google.android.play.core.integrity.IntegrityTokenRequest.Builder
|
Trình tạo cho IntegrityTokenRequest
.
Tóm tắt
Các phương thức kế thừa |
Từ loại
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Hàm khởi tạo công khai
Trình tạo
public Builder ()
Phương thức công khai
setCloudProjectNumber
public abstract IntegrityTokenRequest.Builder setCloudProjectNumber (long cloudProjectNumber)
Số dự án trên đám mây để liên kết với mã thông báo về tính toàn vẹn.
Trường này là bắt buộc đối với các ứng dụng được phân phối độc quyền bên ngoài Google Play và các SDK. Đối với các ứng dụng được phân phối trên Google Play, số dự án trên đám mây được định cấu hình trong Play Console và không cần đặt theo yêu cầu.
Bạn có thể tìm thấy số dự án trên đám mây trong phần Thông tin dự án trên Google Cloud Console của dự án trên đám mây đã bật API Tính toàn vẹn của Play.
Các lệnh gọi đến giải mã mã thông báo trên máy chủ của Google phải được xác thực bằng tài khoản đám mây đã liên kết với mã thông báo trong yêu cầu này.
Các tham số |
cloudProjectNumber |
long |
setNonce
public abstract IntegrityTokenRequest.Builder setNonce (String nonce)
Nonces (số chỉ dùng một lần) để liên kết mã thông báo tính toàn vẹn.
Tệp phải được mã hóa base64 ở dạng không đóng gói, an toàn cho web.
Hãy xem thông tin chi tiết về các yêu cầu và đề xuất đối với nonce (số chỉ cùng một lần).
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# IntegrityTokenRequest.Builder\n\nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nIntegrityTokenRequest.Builder\n=============================\n\n\n`\npublic\nstatic\n\nabstract\nclass\nIntegrityTokenRequest.Builder\n`\n\n\n`\n\nextends `[Object](https://developer.android.com/reference/java/lang/Object.html)`\n\n\n`\n\n`\n\n\n`\n\n|---|----------------------------------------------------------------------|\n| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||\n| ↳ | com.google.android.play.core.integrity.IntegrityTokenRequest.Builder |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nBuilder for [IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html).\n\nSummary\n-------\n\n| ### Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[Builder](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html#Builder())`() ` |\n\n| ### Public methods ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html) | ` `[build](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html#build())`() ` Builds a [IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html). |\n| ` abstract `[IntegrityTokenRequest.Builder](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html) | ` `[setCloudProjectNumber](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html#setCloudProjectNumber(long))`(long cloudProjectNumber) ` A cloud project number to link to the integrity token. |\n| ` abstract `[IntegrityTokenRequest.Builder](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html) | ` `[setNonce](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html#setNonce(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String.html)` nonce) ` A nonce to bind the integrity token to. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` boolean` | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` `[String](https://developer.android.com/reference/java/lang/String.html) | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\npublic Builder ()\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### build\n\n```\npublic abstract IntegrityTokenRequest build ()\n```\n\nBuilds a [IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html).\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------------------------------------------------------------------------------------------|--------|\n| [IntegrityTokenRequest](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.html) | \u003cbr /\u003e |\n\n### setCloudProjectNumber\n\n```\npublic abstract IntegrityTokenRequest.Builder setCloudProjectNumber (long cloudProjectNumber)\n```\n\nA cloud project number to link to the integrity token.\n\nThis field is required for apps exclusively distributed outside of Google Play and SDKs. For\napps distributed on Google Play, the cloud project number is configured in the Play Console and\nneed not be set on the request.\n\nCloud project number can be found in Project info in your Google Cloud Console for the\ncloud project where Play Integrity API is enabled.\n\nCalls to [decrypt the token on Google's server](https://developer.android.com/google/play/integrity/classic#decrypt-verify-google-servers) must be authenticated using the cloud account that\nwas linked to the token in this request.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------------|---------------|\n| `cloudProjectNumber` | `long` \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|--------|\n| [IntegrityTokenRequest.Builder](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html) | \u003cbr /\u003e |\n\n### setNonce\n\n```\npublic abstract IntegrityTokenRequest.Builder setNonce (String nonce)\n```\n\nA nonce to bind the integrity token to.\n\nIt must be base64 encoded in web-safe no-wrap form.\n\nSee [details](https://developer.android.com/google/play/integrity/classic#nonce) about the nonce requirements and recommendations.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-----------------|\n| `nonce` | `String` \u003cbr /\u003e |\n\n| Returns ||\n|-------------------------------------------------------------------------------------------------------------------------------------------|--------|\n| [IntegrityTokenRequest.Builder](../../../../../../../reference/com/google/android/play/core/integrity/IntegrityTokenRequest.Builder.html) | \u003cbr /\u003e |"]]