UANativeBridgeExtensionDelegate

Objective-C

@protocol UANativeBridgeExtensionDelegate <NSObject>

Swift

protocol UANativeBridgeExtensionDelegate : NSObjectProtocol

Delegate to extend the native bridge.

  • Called when an action is triggered from the JavaScript Environment. This method should return the metadata used in the ActionArguments. @parm command The JavaScript command.

    Declaration

    Objective-C

    - (nonnull NSDictionary *)
        actionsMetadataForCommand:(nonnull UAJavaScriptCommand *)command
                          webView:(nonnull WKWebView *)webView;

    Swift

    optional func actionsMetadata(for command: UAJavaScriptCommand, webView: WKWebView) -> [AnyHashable : Any]

    Parameters

    webView

    The webview.

    Return Value

    The action metadata.

  • Called before the JavaScript environment is being injected into the web view.

    Declaration

    Objective-C

    - (void)extendJavaScriptEnvironment:(nonnull UAJavaScriptEnvironment *)js
                                webView:(nonnull WKWebView *)webView;

    Swift

    optional func extend(_ js: UAJavaScriptEnvironment, webView: WKWebView)

    Parameters

    js

    The JavaScript environment.

    webView

    The web view.