Problem description
Redirection happens when opening a URL in an app, and then a load failure message appears.
Troubleshooting
The possible cause of the problem is that the redirect app of third-party Scheme does not exist on the mobile phone, so that the error message ERR_UNKNOWN_URL_SCHEME
appears when opening the URL in the app. The troubleshooting procedure is as follows:
Filter logs on the Android Studio console by keyword
onReceived
, and check ifERR_UNKNOWN_URL_SCHEME
exists.If
ERR_UNKNOWN_URL_SCHEME
does not exist, skip to Submit a ticket. IfERR_UNKNOWN_URL_SCHEME
exists, follow the steps below to implementpublic interface H5SchemeInterceptProvider
, and handleScheme
requests from web side inhandlerOnScheme
.In the implementation class of
H5SchemeInterceptProvider
, create ahandlerOnScheme
class to handleScheme
requests from web side.public class H5SchemeInterceptProviderImpl implements H5SchemeInterceptProvider { @Override //Handle the redirect of Scheme in the following method public boolean handlerOnScheme(String s, H5Page h5Page) { //true means to block the request from Scheme, and false indicates not to block return true; } }
Set Provider after mPaaS initialization completes.
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 details, see Initialize mPaaS.
Ticket for assistance
If the problem still exists, prepare a Demo project reproducing the issue and contact mPaaS after-sales support through Alibaba Cloud Ticket System.