Skip to main content

Interfaces

Platform-Specific Interface (Low-Level Interfaces)

These are the low-level interfaces, which are independent of any business use cases.

  1. state - webview state transition metrics

    Use Cases - if webview is loaded or not; if the current page view is active or suspended; display/hide the loader

    MethodDescription
    activeChecks if the WebView session is active or suspended
    loadedChecks if the WebView page has loaded or not
    contentLoadedTriggered from the client, when the final page content rendering has been completed.
  1. navigator - navigation defined within webview

    Use Cases - back-and-forth page navigations; opening, and closing webview pages

    MethodDescription
    openOpens the route defined
    closeCloses the current WebView
    backNavigates back to the previous web route
    reloadReloads the current WebView page
  2. permission - gets native-level permissions for webview

    Use Cases - asking native app for permission like microphone, camera, location, screen sharing, etc.

    MethodDescription
    microphoneGets microphone permission from native
    cameraGets camera permission from native
    locationGets location permission from native (i.e. geocode)
    screenShareGets screen sharing permission from native
  3. storage - gets access to the native cache, web cookie, web session storage, and web local storage.

    MethodDescription
    getCookieGets the value from the web cookie
    setCookieSets the value to the web cookie (key, value pair is required)
    removeCookieDeletes the web cookie key with it’s value
    clearCookieClear all web cookies
    getSessionStorageItemGets the value from the web session storage
    setSessionStorageItemSets the value to the web session storage (key, value pair is required)
    removeSessionStorageItemDeletes the web session storage key with it’s value
    clearSessionStorageClears the entire session storage
    getLocalStorageItemGets the value from the web local storage
    setLocalStorageItemSets the value to the web local storage (key, value pair is required)
    removeLocalStorageItemDeletes the web local storage key with it’s value
    clearLocalStorageClears the entire local storage
  4. logger - logs info, warnings, errors, and exception-related console outputs.

    MethodDescription
    infoLogs info/warning related console outputs.
    errorLogs error/exception related console outputs.
  5. deviceInfo - Gets access to the native device-specific info e.g. co-ordinates, device-related data, etc.

    MethodDescription
    getCorrdinatesGet realtime geo co-ordinates of the user from native

Data Specific Interface (Overwriteable Interfaces)

These are the interfaces that are dependent on any business use case.

  1. interaction - defines native-level interactions invoked via webview and vice-versa

    Use Cases - displaying a native toast message, opening the native bottom sheet, setting the native header component, updating the native cart count

    MethodDescription
    showToastMessageOpens the native toast component (message is required)
    openBottomSheetOpens the native bottom sheet component (message is required)
    allowsBackForwardNavigationGesturesEnables backnforth navigation gestures for ios
  2. toolbar - setting the native header component, updating the native cart count

    MethodDescription
    showShows the navigation bar according to the params passed.
    hideHides the navigation bar.
    setSets the navigation bar header according to the params passed.
  3. analytics, onMessage, postMessage - generic data sharing between native and webview