|
|
1 năm trước cách đây | |
|---|---|---|
| .. | ||
| AppAttestExample | 1 năm trước cách đây | |
| AppAttestExample.xcodeproj | 1 năm trước cách đây | |
| AppAttestExampleForPod.xcodeproj | 1 năm trước cách đây | |
| AppAttestExampleTests | 1 năm trước cách đây | |
| AppAttestExample.xctestplan | 1 năm trước cách đây | |
| Podfile | 1 năm trước cách đây | |
| README.md | 1 năm trước cách đây | |
In the ../Samples/Swift/AppAttestExample/ folder, run the following
CocoaPods command.
pod install
Open the generated workspace:
open AppAttestExample.xcworkspace
Run the AppAttestExampleForPod target.
In the ../Samples/Swift/AppAttestExample/ folder, open the project:
open AppAttestExample.xcodeproj
Run the AppAttestExample target.
You will need a provisioning profile with the App Attest entitlement.
This example app shows how you might hide your web API key and debug token
(used during CI; AppCheckCore manages the debug token running locally in the
simulator). Both of these are required. Inside the Secrets/ directory, we
include a placeholder file entitled AppCheckDefaultSecrets.xcconfig. We have
also set that as a configuration file for the project, which means that it will
be used to find the web API key during debug builds on the simulator (for
example). You can either make a new file to fill in the stubbed data in
AppCheckDefaultSecrets.xcconfig (which will require that you update where the
projects finds its configurations), or you can add your API key there yourself.
Do make sure that you do not commit this API key, or you will risk exposing
this information on your repository.
In builds running under continuous integration, make sure to use environment
variables and AppCheckSecretReader.swift will find your web API key and debug
token if you provide them to your xcodebuild command.
We show how you might hide your app's web API key and debug token when running locally and in CI environments. See GitHub's secrets documentation for how you might set those values in your repo.
Locally, both the web API key and the debug token need to be passed to
xcodebuild as arguments:
xcodebuild <other args> APP_CHECK_WEB_API_KEY=... AppCheckDebugToken=....