All Products
Document Center

Load failure problem occurs when opening URL in HTML5 container

Last Updated: Jul 16, 2021

Problem description

Redirection happens when opening a URL in an app, and then a load failure message appears.


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:

  1. Filter logs on the Android Studio console by keyword onReceived, and check if ERR_UNKNOWN_URL_SCHEME exists.
    Filter log
  2. If ERR_UNKNOWN_URL_SCHEME does not exist, skip to Submit a ticket. If ERR_UNKNOWN_URL_SCHEME exists, follow the steps below to implement public interface H5SchemeInterceptProvider, and handle Scheme requests from web side in handlerOnScheme.
    1. In the implementation class of H5SchemeInterceptProvider, create a handlerOnScheme class to handle Scheme requests from web side.
      1. public class H5SchemeInterceptProviderImpl implements H5SchemeInterceptProvider {
      2. @Override
      3. //Handle the redirect of Scheme in the following method
      4. public boolean handlerOnScheme(String s, H5Page h5Page) {
      5. //true means to block the request from Scheme, and false indicates not to block
      6. return true;
      7. }
      8. }
    2. Set Provider after mPaaS initialization completes.
      1. //Set callback of mPaaS initialization
      2. QuinoxlessFramework.setup(this, new IInitCallback() {
      3. @Override
      4. public void onPostInit() {
      5. //The callback below indicates that mPaaS initialization has completed, and relevant calling of mPaaS can be done in the callback.
      6. H5Utils.setProvider(H5SchemeInterceptProvider.class.getName(), new H5SchemeInterceptProviderImpl());
      7. }
      8. });

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.