|
1 | 1 | package com.credman.cmwallet.createcred |
2 | 2 |
|
3 | 3 | import android.net.Uri |
4 | | -import android.os.Bundle |
5 | 4 | import android.util.Base64 |
6 | 5 | import android.util.Log |
7 | 6 | import androidx.compose.runtime.getValue |
8 | 7 | import androidx.compose.runtime.mutableStateOf |
9 | 8 | import androidx.compose.runtime.setValue |
10 | 9 | import androidx.credentials.CreateCredentialResponse |
11 | | -import androidx.credentials.CreateCustomCredentialResponse |
12 | | -import androidx.credentials.DigitalCredential |
| 10 | +import androidx.credentials.CreateDigitalCredentialResponse |
13 | 11 | import androidx.credentials.ExperimentalDigitalCredentialApi |
14 | 12 | import androidx.credentials.provider.ProviderCreateCredentialRequest |
15 | 13 | import androidx.lifecycle.ViewModel |
@@ -409,16 +407,13 @@ class CreateCredentialViewModel : ViewModel() { |
409 | 407 | } |
410 | 408 |
|
411 | 409 | private fun onResponse(newEntryId: String) { |
412 | | - val testResponse = CreateCustomCredentialResponse( |
413 | | - type = DigitalCredential.TYPE_DIGITAL_CREDENTIAL, |
414 | | - data = Bundle().apply { |
415 | | - putString( |
416 | | - "androidx.credentials.BUNDLE_KEY_RESPONSE_JSON", |
417 | | - JSONObject().put("protocol", "openid4vci").put("data", JSONObject()).toString() |
418 | | - ) |
419 | | - }, |
| 410 | + val ackResponse = CreateDigitalCredentialResponse( |
| 411 | + JSONObject() |
| 412 | + .put("protocol", "openid4vci") |
| 413 | + .put("data", JSONObject()) |
| 414 | + .toString() |
420 | 415 | ) |
421 | | - uiState = uiState.copy(state = Result.Response(testResponse, newEntryId)) |
| 416 | + uiState = uiState.copy(state = Result.Response(ackResponse, newEntryId)) |
422 | 417 | } |
423 | 418 |
|
424 | 419 | private fun onError(msg: String? = null) { |
|
0 commit comments