// android.credentials.GetCredentialException requires API level 34
Is this still relevant? `android.credentials.GetCredentialException` shouldn't be used anywhere.
var response = IntentHelper.extractGetCredentialResponse(code, data);
Now you need to retrieve either a CreateCredentialResponse or a CreateCredentialException from the result data. And here's example of how to do it:
```
// Imports
import androidx.credentials.provider.PendingIntentHandler
import androidx.credentials.CreateCredentialResponse
androidx.credentials.exceptions.CreateCredentialException
// ...
val providerData = data?.getParcelable<Intent>("androidx.identitycredentials.BUNDLE_KEY_PROVIDER_DATA")
val response = PendingIntentHandler.retrieveCreateCredentialResponse(providerData)
if (response == null) {
val exception = data.retrieveGetCredentialException()
// Handle exception
} else {
// Handle response
val responseJson = response.data.getString("androidx.credentials.BUNDLE_KEY_RESPONSE_JSON")
// This `responseJson` is the wallet generated json response
}
```
if (e instanceof GetCredentialException
this should be `androidx.credentials.exceptions.CreateCredentialException`
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
// android.credentials.GetCredentialException requires API level 34
Is this still relevant? `android.credentials.GetCredentialException` shouldn't be used anywhere.
Done
name: "DigitalCredentialsCreate",
not needed.
origin_trial_feature_name: "WebIdentityDigitalCredentialsIssuance",
origin_trial_os: ["android"],
origin_trial_allows_third_party: true,
Not needed.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
var response = IntentHelper.extractGetCredentialResponse(code, data);
Now you need to retrieve either a CreateCredentialResponse or a CreateCredentialException from the result data. And here's example of how to do it:
```
// Imports
import androidx.credentials.provider.PendingIntentHandler
import androidx.credentials.CreateCredentialResponse
androidx.credentials.exceptions.CreateCredentialException// ...
val providerData = data?.getParcelable<Intent>("androidx.identitycredentials.BUNDLE_KEY_PROVIDER_DATA")
val response = PendingIntentHandler.retrieveCreateCredentialResponse(providerData)
if (response == null) {
val exception = data.retrieveGetCredentialException()
// Handle exception
} else {
// Handle response
val responseJson = response.data.getString("androidx.credentials.BUNDLE_KEY_RESPONSE_JSON")
// This `responseJson` is the wallet generated json response
}
```
Done
if (e instanceof GetCredentialException
this should be `androidx.credentials.exceptions.CreateCredentialException`
Done
name: "DigitalCredentialsCreate",
Mohamed Amir Yosefnot needed.
Done
origin_trial_feature_name: "WebIdentityDigitalCredentialsIssuance",
origin_trial_os: ["android"],
origin_trial_allows_third_party: true,
Mohamed Amir YosefNot needed.
Done
depends_on: ["FedCm"],
Mohamed Amir Yosefnot needed
Done
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
data.getParcelable(
I don't think you can unconditionally use this API as it is only [available on Android 33+](https://developer.android.com/reference/android/os/Bundle#getParcelable(java.lang.String,%20java.lang.Class%3CT%3E)). It can cause issue when deployed to a user device that's running a lower android version.
I would suggest that the lint suppression on NewApi and properly resolve such an error. Usually what people do is:
```
if (Build.VERSION.SDK_INT >= 33) {
// Use the new api
data.getParcelable(IntentHelper.BUNDLE_KEY_PROVIDER_DATA, Intent.class);
} else {
// Use the old api
data.getParcelable<Intent>(IntentHelper.BUNDLE_KEY_PROVIDER_DATA);
}
```
PendingIntentHandler.retrieveCreateCredentialException(
This could also be null, please make sure that's handled correctly.
In that case, it means neither a response nor an exception was propagated back, which is really unexpected. If possible, that should be logged somehow. Anyway, we should gracefully fail it on the user side (maybe just pass back a default exception)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
PendingIntentHandler.retrieveCreateCredentialException(
This could also be null, please make sure that's handled correctly.
In that case, it means neither a response nor an exception was propagated back, which is really unexpected. If possible, that should be logged somehow. Anyway, we should gracefully fail it on the user side (maybe just pass back a default exception)
Oh, I meant a default DC exception, e.g. user cancellation error. What does the developer get if a raw `Exception` is passed back?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |