-
Notifications
You must be signed in to change notification settings - Fork 677
[AppCheck] Expose Play Integrity exceptions to support Play Integrity Remediation #7932
Description
What feature would you like to see?
I am using Firebase AppCheck with the PlayIntegrityAppCheckProvider. Recently, the Play Integrity API introduced remediation flows (e.g., prompt users to update Google Play Services, to install the app from Google Play if it was sideloaded, or prompting them to update their OS).
To trigger these remediation dialogs, developers must catch the specific Play Integrity exception (like IntegrityServiceException) to read the error code and pass it to the remediation API. Currently, Firebase AppCheck catches these underlying Play Integrity exceptions and surfaces a generic FirebaseException). The original Play Integrity exception is completely swallowed, making it impossible to read the error code and initiate the remediation flow.
Request: Please expose the underlying Play Integrity error information. This could be done by including the original IntegrityServiceException as the cause of the FirebaseException, or by creating a specific subclass (e.g., FirebaseAppCheckPlayIntegrityException) that explicitly contains the Play Integrity error code.
How would you use it?
When an AppCheck token fails to generate due to a Play Integrity failure (e.g., APP_NOT_INSTALLED_FROM_PLAY_STORE), I want to prompt the user with the official Play Integrity remediation dialog so they can resolve the issue themselves. Without access to the underlying exception from the AppCheck provider, my only workaround is to bypass Firebase AppCheck entirely and write a custom provider that calls the Play Integrity API directly. This defeats the convenience of using the official PlayIntegrityAppCheckProvider.