Problem description
The app opens an online link and redirects. A "load failed" message is then displayed.
Troubleshooting
The client may report the ERR_UNKNOWN_URL_SCHEME error message when you open a URL because the device does not have an app that can handle the third-party scheme. The troubleshooting procedure is as follows:
In the Android Studio console, filter the log messages for the keyword
onReceived. Check the log to see if it contains theERR_UNKNOWN_URL_SCHEMEmessage.If the log does not contain
ERR_UNKNOWN_URL_SCHEME, join DingTalk group 145930007362 for assistance. If the log containsERR_UNKNOWN_URL_SCHEME, resolve the issue by following the procedure below to implement thepublic interface H5SchemeInterceptProviderand handleSchemerequests from the web page in thehandlerOnSchememethod.In the
H5SchemeInterceptProviderimplementation class, create thehandlerOnSchememethod to handle schemes from the web page.public class H5SchemeInterceptProviderImpl implements H5SchemeInterceptProvider { @Override // Handle the scheme redirection in the following method. public boolean handlerOnScheme(String s, H5Page h5Page) { // Return true to intercept the scheme. Return false to not intercept. return true; } }Set the provider after mPaaS is initialized.
MP.init(this, MPInitParam.obtain().setCallback(new MPInitParam.MPCallback() { @Override public void onInit() { // This callback indicates that mPaaS has been initialized, and mPaaS related calls can be made in this callback. H5Utils.setProvider(H5SchemeInterceptProvider.class.getName(), new H5SchemeInterceptProviderImpl()); } }) );For more information, see Initialize mPaaS.
If the issue persists, prepare a demo project that reproduces the issue and join DingTalk group 145930007362 for assistance.