모든 문은 소비자를 염두에 두고 설계되었습니다. 문 소비자는 주 구성원이 작성한 문을 읽고 확인한 후 이 진술에 따라 조치를 취하는 사람입니다. 구체적으로 소비자는 다음과 같은 기본 단계를 수행합니다.
특정 주 구성원의 문 목록 요청
목록에 지정된 타겟과 관련하여 지정된 문이 포함되어 있는지 확인합니다.
문장의 타겟이 여러분이 생각하는 타겟 (웹사이트 또는 앱)인지 검증합니다.
원하는 경우 문에서 지정한 작업을 수행합니다.
많은 사용 사례에서 백그라운드에서 문을 사용합니다. 예를 들어, Android 앱 연결은 웹사이트에서 작성한 링크 권한 문을 사용하여 앱으로 직접 연결되는 링크를 사용 설정할 수 있습니다. 앱은 매니페스트에 특수 코드 (인텐트 핸들러)를 추가하여 그러한 모든 문의 대상이 되는 데 동의함을 나타냅니다.
위의 1단계와 2단계(명령문 요청 및 검증)는 API를 사용하거나 수동으로(자체 구현 사용) 두 가지 방법으로 수행할 수 있습니다.
Digital Asset Links API를 사용하여 문 사용
Digital Asset Links API는 문을 찾거나 확인하는 두 가지 메서드인 Check() 및 List()를 지원합니다.
Check()는 소스, 타겟, 관계를 취하여 소스가 대상에 대해 제출된 문을 작성하는지 확인합니다.
웹사이트의 문을 사용하려면 해당 문 목록에 대해 HTTP GET 요청을 실행하고 직접 파싱하면 됩니다. 예를 들어 http://example.digitalassetlinks.org 웹사이트에 해당하는 명령문 목록은 http://example.digitalassetlinks.org/.well-known/assetlinks.json에 있습니다.
Android 앱의 문을 사용하려면 해당하는 APK 패키지의 매니페스트에 액세스해야 합니다. Android 기기에서는 PackageManager 인터페이스를 사용하여 이 작업을 실행할 수 있습니다.
디지털 애셋 링크 구문의 구체적인 의미에 특히 주의하세요. 확실하지 않은 경우 애셋 링크 사양을 참조하세요.
[null,null,["최종 업데이트: 2024-06-26(UTC)"],[[["\u003cp\u003eDigital Asset Links enable websites and apps to make statements about their relationships, which other apps and services can then verify and act upon.\u003c/p\u003e\n"],["\u003cp\u003eYou can consume these statements using the Digital Asset Links API (\u003ccode\u003eCheck()\u003c/code\u003e and \u003ccode\u003eList()\u003c/code\u003e methods) or manually by retrieving and parsing the statement list.\u003c/p\u003e\n"],["\u003cp\u003eBefore implementing your own solution, check if existing mechanisms like Android App Linking already handle your desired scenario.\u003c/p\u003e\n"],["\u003cp\u003eWebsites publish their statements in a JSON file located at \u003ccode\u003e.well-known/assetlinks.json\u003c/code\u003e, while Android app statements are found within their manifest file.\u003c/p\u003e\n"],["\u003cp\u003eFor a deeper understanding of statement meanings and the underlying protocol, refer to the Asset Links Specification.\u003c/p\u003e\n"]]],[],null,["# Consuming a statement\n\nEvery statement is designed with a *consumer* in mind; the statement consumer is the one who reads and verifies a statement made by a principal, then takes action based on that statement. More specifically, a consumer performs these basic steps:\n\n1. Request the statement list from a specific principal\n2. Check to see if the list contains a given statement against a given target\n3. Validate that the target in the statement is the target (website or app) that you think it is\n4. Perform the action specified by the statement, if you choose to\n\n[Many use cases](/digital-asset-links/v1/using) consume statements for you behind the scenes. For example, Android App Linking consumes link permission statements made by a website to enable links directly into an app. An app indicates that it agrees to be a target to any such statements by adding special code (an intent handler) in its manifest.\n| Be sure to check that your scenario doesn't have a special mechanism for consuming or implementing a statement before handling it manually.\n\nYou can perform steps 1 and 2 above --- requesting and validating a statement --- in two ways: using our API or manually (using your own implementation).\n\nConsuming statements using the Digital Asset Links API\n------------------------------------------------------\n\n**The Digital Asset Links API** supports two methods: `Check()` and `List()` to find or validate statements:\n\n- [Check()](/digital-asset-links/reference/rest) takes a source, target, and relationship and verifies that the source makes the submitted statement about the target.\n- [List()](/digital-asset-links/reference/rest) lists all statements made by a given source.\n\n| In order to use the API, you need an [API key](https://support.google.com/googleapi/answer/6158862) and you must first activate the API for your project. To do that, follow these steps:\n|\n| 1. Go to the [Google Developers Console](https://console.developers.google.com/project/_/apiui/apiview/digitalassetlinks/overview).\n|\n| The console might require you to sign in first.\n| 2. Select or create a project.If you have multiple projects, make sure that you are in the project for which you want to activate the Digital Asset Links API and click **Continue** . Or, if you do not have a project, select **Create a new project** and click **Create**.\n|\n| 3. In the Digital Asset Links API overview, click **Enable API** .\n|\n| If the API is already enabled for your project, you will see **Disable API**.\n| 4. In the left-hand menu, click on **Credentials** and either select or create an API key.\n|\n| [More information about creating API keys](https://support.google.com/googleapi/answer/6158862).\n\nConsuming statements manually\n-----------------------------\n\nThe Digital Asset Links protocol is open, so you can create an implementation of it for yourself.\n\nTo consume statements made by **web sites** , you can make an HTTP GET request for the corresponding statement list and parse it yourself. For example, the corresponding statement list for the web site `http://example.digitalassetlinks.org` is at `http://example.digitalassetlinks.org/.well-known/assetlinks.json`.\n\nTo consume statements made by **Android apps** , you need to access the manifest of the corresponding APK package. On Android devices, this can be accomplished using the [PackageManager](http://developer.android.com/reference/android/content/pm/PackageManager.html) interface.\n\nPlease pay special attention to the specific meanings of Digital Asset Links statements. Refer to the [Asset Links Specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md) if you are unsure."]]