Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ README.private.md
######################
.env
.env.local
.env.development.local
.env.development.local
# Superpowers process artifacts (specs/plans) - do not commit to product PRs
docs/superpowers/
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.verifiertutorial

// Constants
// These values are specific to your own MATTR VII tenant and to the Verifier
// Application configuration you create within it.
// Replace both placeholders before running a real verification:
// - TENANT_HOST: the base URL of your MATTR VII tenant.
// - APPLICATION_ID: the `id` returned when you create the Verifier Application
// configuration on your tenant.
object Constants {
const val TENANT_HOST = "https://your-tenant.vii.mattr.global"
const val APPLICATION_ID = "<YOUR_VERIFIER_APPLICATION_ID>"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.navigation.compose.rememberNavController
import com.example.verifiertutorial.ui.theme.VerifierTutorialTheme
import global.mattr.mobilecredential.verifier.dto.MobileCredentialResponse
import global.mattr.mobilecredential.verifier.MobileCredentialVerifier
import global.mattr.mobilecredential.common.platformconfig.PlatformConfiguration
import global.mattr.mobilecredential.verifier.platformconfig.PlatformConfiguration
import global.mattr.mobilecredential.verifier.exception.VerifierException.FailedToRegisterException
import global.mattr.mobilecredential.verifier.exception.VerifierException.InvalidLicenseException
import kotlinx.coroutines.launch
Expand All @@ -38,8 +38,8 @@ class MainActivity : ComponentActivity() {
// registers this app instance with the tenant and obtains a license, so a PlatformConfiguration
// pointing at your tenant and Verifier Application is required.
val platformConfiguration = PlatformConfiguration(
tenantHost = URL("https://your-tenant.vii.mattr.global"),
applicationId = "<YOUR_VERIFIER_APPLICATION_ID>"
tenantHost = URL(Constants.TENANT_HOST),
applicationId = Constants.APPLICATION_ID
)
try {
// This function initializes storage, registers the app instance, obtains a license,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.example.mobileverifiertutorial.ui.theme.MobileVerifierTutorialTheme
import global.mattr.mobilecredential.verifier.MobileCredentialVerifier
import global.mattr.mobilecredential.verifier.OnlinePresentationSessionResult
import global.mattr.mobilecredential.common.platformconfig.PlatformConfiguration
import global.mattr.mobilecredential.verifier.platformconfig.PlatformConfiguration
import global.mattr.mobilecredential.verifier.deviceretrieval.devicerequest.DataElements
import global.mattr.mobilecredential.verifier.deviceretrieval.devicerequest.NameSpaces
import global.mattr.mobilecredential.verifier.dto.MobileCredentialPresentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "This app uses Bluetooth to connect to the holder's wallet and receive the mDoc during in-person verification.";
INFOPLIST_KEY_NSCameraUsageDescription = "This app uses the camera to scan the QR code that initiates an in-person verification session.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down Expand Up @@ -297,6 +299,8 @@
DEVELOPMENT_TEAM = "";
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "This app uses Bluetooth to connect to the holder's wallet and receive the mDoc during in-person verification.";
INFOPLIST_KEY_NSCameraUsageDescription = "This app uses the camera to scan the QR code that initiates an in-person verification session.";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ class DocumentViewModel {
self.docType = presentation.docType
self.verificationResult = presentation.verificationResult.verified ? "Verified" : "Invalid"
// From v6.0.0, the failure detail is exposed via `failureType` (was `reason`).
self.verificationFailedReason = presentation.verificationResult.failureType?.message
// `MobileCredentialVerificationFailureType` is a String-backed enum; its `rawValue`
// is the human-readable failure message (e.g. "mDoc authentication failed").
self.verificationFailedReason = presentation.verificationResult.failureType?.rawValue

self.namespacesAndClaims = presentation.claims?.reduce(into: [String: [String: String]]()) { result, outerElement in
let (outerKey, innerDict) = outerElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ class DocumentViewModel: ObservableObject {
self.docType = presentation.docType
self.verificationResult = presentation.verificationResult.verified ? "Verified" : "Invalid"
// From v6.0.0, the failure detail is exposed via `failureType` (was `reason`).
self.verificationFailedReason = presentation.verificationResult.failureType?.message
// `MobileCredentialVerificationFailureType` is a String-backed enum; its `rawValue`
// is the human-readable failure message (e.g. "mDoc authentication failed").
self.verificationFailedReason = presentation.verificationResult.failureType?.rawValue

self.namespacesAndClaims = presentation.claims?.reduce(into: [String: [String: String]]()) { result, outerElement in
let (outerKey, innerDict) = outerElement
Expand Down
Loading