urbanairship-core/src/main/java/com/urbanairship/widget/UAWebViewClient.java
private boolean interceptUrl(WebView webView, String url) {
        if (webView == null || url == null) {
            return false;
        }

        Uri uri = Uri.parse(url);
        if (uri.getHost() == null || !uri.getScheme().equals(UA_ACTION_SCHEME) || !isWhiteListed(webView.getUrl())) {
            return false;
        }

        Logger.verbose("Intercepting: " + url);
        switch (uri.getHost()) {
            case RUN_BASIC_ACTIONS_COMMAND:
                Logger.info("Running run basic actions command for URL: " + url);
                runActions(webView, decodeActionArguments(uri, true));
                return true;

            case RUN_ACTIONS_COMMAND:
                Logger.info("Running run actions command for URL: " + url);
                runActions(webView, decodeActionArguments(uri, false));
                return true;

            case RUN_ACTIONS_COMMAND_CALLBACK:
                Logger.info("Running run actions command with callback for URL: " + url);

                List<String> paths = uri.getPathSegments();
                if (paths.size() == 3) {
                    Logger.info("Action: " + paths.get(0) + ", Args: " + paths.get(1) + ", Callback: " + paths.get(2));
                    runAction(webView, paths.get(0), paths.get(1), paths.get(2));
                } else {
                    Logger.error("Unable to run action, invalid number of arguments.");
                }
                return true;

            case CLOSE_COMMAND:
                Logger.info("Running close command for URL: " + url);
                onClose(webView);
                return true;

            default:
                Logger.warn("Unrecognized command: " + uri.getHost()
                        + " for URL: " + url);

                return false;
        }
    }
/**
     * Intercepts a url for our JS bridge.
     *
     * @param webView The web view.
     * @param url The url being loaded.
     * @return <code>true</code> if the url was loaded, otherwise <code>false</code>.
     */
Intercepts a url for our JS bridge.
@param webView The web view.
@param url The url being loaded.
@return true if the url was loaded, otherwise false.
Intercepts a url for our JS bridge . @param webView The web view . @param url The url being loaded . @return true if the url was loaded otherwise false .
private boolean interceptUrl(WebView webView, String url) {
        if (webView == null || url == null) {
            return false;
        }
        Uri uri = Uri.parse(url);
        if (uri.getHost() == null || !uri.getScheme().equals(UA_ACTION_SCHEME) || !isWhiteListed(webView.getUrl())) {
            return false;
        }
        Logger.verbose("Intercepting: " + url);
        switch (uri.getHost()) {
            case RUN_BASIC_ACTIONS_COMMAND:
                Logger.info("Running run basic actions command for URL: " + url);
                runActions(webView, decodeActionArguments(uri, true));
                return true;
            case RUN_ACTIONS_COMMAND:
                Logger.info("Running run actions command for URL: " + url);
                runActions(webView, decodeActionArguments(uri, false));
                return true;
            case RUN_ACTIONS_COMMAND_CALLBACK:
                Logger.info("Running run actions command with callback for URL: " + url);
                List<String> paths = uri.getPathSegments();
                if (paths.size() == 3) {
                    Logger.info("Action: " + paths.get(0) + ", Args: " + paths.get(1) + ", Callback: " + paths.get(2));
                    runAction(webView, paths.get(0), paths.get(1), paths.get(2));
                } else {
                    Logger.error("Unable to run action, invalid number of arguments.");
                }
                return true;
            case CLOSE_COMMAND:
                Logger.info("Running close command for URL: " + url);
                onClose(webView);
                return true;
            default:
                Logger.warn("Unrecognized command: " + uri.getHost()
                        + " for URL: " + url);
                return false;
        }
    }
private boolean interceptUrl ( WebView webView , String url ) { if ( webView == null || url == null ) { return false ; } Uri uri = Uri . parse ( url ) ; if ( uri . getHost ( ) == null || ! uri . getScheme ( ) . equals ( UA_ACTION_SCHEME ) || ! isWhiteListed ( webView . getUrl ( ) ) ) { return false ; } Logger . verbose ( "Intercepting: " + url ) ; switch ( uri . getHost ( ) ) { case RUN_BASIC_ACTIONS_COMMAND : Logger . info ( "Running run basic actions command for URL: " + url ) ; runActions ( webView , decodeActionArguments ( uri , true ) ) ; return true ; case RUN_ACTIONS_COMMAND : Logger . info ( "Running run actions command for URL: " + url ) ; runActions ( webView , decodeActionArguments ( uri , false ) ) ; return true ; case RUN_ACTIONS_COMMAND_CALLBACK : Logger . info ( "Running run actions command with callback for URL: " + url ) ; List < String > paths = uri . getPathSegments ( ) ; if ( paths . size ( ) == 3 ) { Logger . info ( "Action: " + paths . get ( 0 ) + ", Args: " + paths . get ( 1 ) + ", Callback: " + paths . get ( 2 ) ) ; runAction ( webView , paths . get ( 0 ) , paths . get ( 1 ) , paths . get ( 2 ) ) ; } else { Logger . error ( "Unable to run action, invalid number of arguments." ) ; } return true ; case CLOSE_COMMAND : Logger . info ( "Running close command for URL: " + url ) ; onClose ( webView ) ; return true ; default : Logger . warn ( "Unrecognized command: " + uri . getHost ( ) + " for URL: " + url ) ; return false ; } }
Intercepts a url for our JS bridge.
Intercepts a url for our JS bridge .