@ProxyService(proxy = IWebViewLinkProxy.class)public class CustomWebViewLinkProxy implements IWebViewLinkProxy {/*** Handle custom url loading in web-view component.* Custom url is url with any custom scheme (scheme not network protocol such as http/https)* @param miniContext context of mini-program* @param url the url which is loading* @return return true if the url loading is handled, otherwise false the web-view will handle url loading*/@Overridepublic boolean webViewCustomUrlLoading(IMiniAppContext miniContext, String url) {Uri uri = Uri.parse(url);if ("tcmpp".equals(uri.getScheme())) {Intent intent = new Intent(Intent.ACTION_VIEW, uri);miniContext.getAttachedActivity().startActivity(intent);return true;}return false;}}
文档反馈