I have an Android app using WebView that loads user-provided URLs. Some URLs might have self-signed SSL certificates, triggering the onReceivedSslError
method in the WebViewClient
.
Currently, I display a dialog asking the user to proceed or cancel. This is necessary to avoid Google Play Console removing the app for ignoring SSL errors.
Question:
Can I save the user’s choice (proceed/cancel) for specific URLs? I’m considering using SharedPreferences to store a key-value pair like { url: string, isProceeded: boolean }
. This way, if the user encounters the same pre-accepted URL again, the WebView can proceed automatically without prompting again.