Package 

Object Aegis


  • 
    public class Aegis
    
                        

    Main Active Reach SDK interface for Android

    • Method Detail

      • setConsent

         final Unit setConsent(Map<ConsentManager.Category, Boolean> partial)

        Set GDPR/CCPA consent for one or more categories. Necessary cannot be revoked (per drift contract).

        Example: Aegis.setConsent(mapOf( ConsentManager.Category.ANALYTICS to true, ConsentManager.Category.MARKETING to false, ))

      • initialize

         final Unit initialize(Application application, String writeKey, AegisConfig config)

        Initialize the Active Reach SDK

        Parameters:
        application - Android Application instance
        writeKey - Your Aegis write key
        config - SDK configuration
      • track

         final Unit track(String eventName, Map<String, Object> properties)

        Track a custom event

        Parameters:
        eventName - Name of the event
        properties - Optional event properties
      • lastEventId

         final String lastEventId(String eventName)

        Phase 4 Meta Pixel companion. Returns the messageId of the most recent track(eventName) call (only events tracked while marketing consent was granted). Use this to pass the SAME event_id to a tenant's client-side Meta Pixel:

            val eventId = Aegis.lastEventId("order_completed")
            metaPixel.track("Purchase", payload, mapOf("eventID" to eventId))
      • identify

         final Unit identify(String userId, Map<String, Object> traits)

        Identify a user

        Parameters:
        userId - Unique user identifier
        traits - Optional user traits
      • screen

         final Unit screen(String screenName, Map<String, Object> properties)

        Track a screen view

        Parameters:
        screenName - Name of the screen
        properties - Optional screen properties
      • group

         final Unit group(String groupId, Map<String, Object> traits)

        Group a user

        Parameters:
        groupId - Unique group identifier
        traits - Optional group traits
      • alias

         final Unit alias(String newUserId)

        Alias a user ID

        Parameters:
        newUserId - New user ID to alias
      • reset

         final Unit reset()

        Reset user identity (typically on logout)

      • flush

         final Unit flush()

        Flush all queued events immediately

      • bootstrap

         final BootstrapResult bootstrap()

        Perform the /v1/sdk/bootstrap handshake against the configured control-plane. On success, returns the BootstrapResult AND applies the contained EventGovernanceHint to the NameGovernor automatically — callers don't need a separate ingestGovernanceHint call.

        Throws BootstrapError on a 4xx/5xx response or unparseable body. Blocks the calling thread — invoke from a coroutine or background executor.

        Parity with libs/web-sdk's bootstrap() export. Wired by Phase 1 (PARITY.md).

      • ingestGovernanceHint

         final Unit ingestGovernanceHint(EventGovernanceHint hint)

        Ingest the event-governance hint returned from /v1/sdk/bootstrap.

        Integrators run bootstrap() themselves (parity with web SDK) and pass the resulting hint here so the SDK can self-throttle novel event names before they hit the gateway. Passing null disables governance (Enterprise plan / outage fail-open). Safe to call before initialize() — the hint is stored and applied as soon as init completes.

      • setCartData

         final Unit setCartData(CartData cart)

        Set cart data for cart recovery

        Parameters:
        cart - Cart data containing items, total, and currency
      • clearCartData

         final Unit clearCartData()

        Clear cart data (typically after purchase or cart abandonment)

      • submitSpinWheel

         final Unit submitSpinWheel(String phone, String email, String name, Function1<Result<JSONObject>, Unit> callback)

        Submit spin wheel with phone/email capture

        Parameters:
        phone - User's phone number (E.
        email - User's email address (optional)
        name - User's name (optional)
        callback - Callback with prize data or error
      • triggerExitIntent

         final Boolean triggerExitIntent()

        Trigger exit intent manually (typically called when app enters background with active cart)

      • getEcommerce

         final EcommerceTracker getEcommerce()

        E-commerce helper. Canonical 15-method tracker, parity with libs/web-sdk EcommerceTracker. Methods listed + drift-locked in libs/mobile-sdk/tests/drift/ecommerce-event-names.json.

      • getUser

         final AegisUser getUser()

        Aegis.user namespace (Phase 4, web 1.13 parity). Typed PII + per-channel opt-in setters with pre-login buffering. Pinned by libs/mobile-sdk/tests/drift/user-namespace-contract.json.

      • getPlugins

         final PluginRegistry getPlugins()

        Phase 4.5 plugin runtime. Register Aegis-shipped plugins or your own integrations:

        Aegis.plugins.register(object : PluginRegistry.Plugin { override val name = "my-plugin" override val version = "1.0.0" override fun onTrack(event: AegisEvent) = PluginRegistry.TrackDecision.Pass })

        Contract pinned by libs/mobile-sdk/tests/drift/plugin-system-contract.json.