Package 

Class AegisWebViewBridge


  • 
    public final class AegisWebViewBridge
    
                        

    Bridge for android.webkit.WebView-hosted web content. Mirrors the web SDK's public aegis.* namespace inside the webview so a customer who embeds their web storefront in a native Android app does NOT have to dual-instrument (web SDK + native SDK). All events from the webview flow through the host app's native SDK transport.

    Usage:

    val webView = WebView(context)
    AegisWebViewBridge.attach(webView)
    webView.loadUrl("https://shop.your-brand.com")

    Once attached, the loaded HTML can call:

    window.aegis.track('product_viewed', { sku: 'L_001' });
    window.aegis.identify('user_42', { plan: 'gold' });
    window.aegis.screen('checkout');
    window.aegis.page('/cart');
    window.aegis.group('group_abc', { tier: 'gold' });
    window.aegis.alias('legacy_id_99');
    window.aegis.reset();

    Cross-SDK parity with iOS AegisWebViewBridge. Bridge method set is pinned by the shared libs/mobile-sdk/ios-sdk/Tests/drift/webview-bridge-contract.json.

    • Method Summary

      Modifier and Type Method Description
      final Unit postMessage(String jsonBody) JavaScript-side calls land here.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • postMessage

         final Unit postMessage(String jsonBody)

        JavaScript-side calls land here. Body shape: { method: "track" | "identify" | ..., args: ... }