Package 

Class OmnibrowseManager

    • Method Detail

      • getVisitorCode

         void getVisitorCode(RequestCallback<VisitorCode> requestCallback)

        Gets the VisitorCode for current Visitor.

        A Visitor code can be displayed to the Visitor. The Visitor can theninform OmniBrowse Operators of their code. OmniBrowse Operators use theVisitor's code to start an OmniBrowse Engagement with the Visitor.

        Each Visitor code is generated on demand and is unique for everyVisitor for a particular site ID. Upon the first time this method iscalled for a Visitor the code is generated and returned.For each successive call thereafter the same code is returned aslong as the code has not expired. The expiration time for Visitorcodes is 3 hours. During that time the code can be used to initiate an Engagement.Once Operator uses the Visitor code to initiate an Engagement, the code becomes expiredimmediately. When the Visitor Code expires this function will return a new Visitor code.

        The expiration time is important to take note of if you plan onretrieving the code only once during the Visitor's session. A new codeshould be requested once the initial one has expired. When Visitor provides anexpired code to Operator the Operator will not be able to connect with theVisitor.

        An example use case is Operator and Visitor being in a phone call.The Operator instructs the Visitor to press shake the phonewhich then causes the Visitor code to be displayed to the Visitor.The Visitor then tells the Operator what their code is.When the Operator enters the code on their side they will be ableto conduct an OmniBrowse Engagement with the Visitor.

        Usage example:

         Glia.omnibrowse.getVisitorCode(new{@code RequestCallback()} { {@literal @}Override public void onResult(VisitorCode visitorCode, GliaException exception) { this.runOnUiThread(() -> { if (visitorCode != null) { showVisitorCode(visitorCode.getCode()); } else if (exception.cause == GliaException.Cause.NETWORK_TIMEOUT) { showNetworkError(); } } } }); 
        
        Parameters:
        requestCallback - called with VisitorCode set when request succeedsor with GliaException.
      • on

         <T> void on(Omnibrowse.OmnibrowseEvent<T> event, Consumer<T> listener)

        Registers event listeners for OmniBrowse.

        If a listener is added while the OmniBrowse is processing an event,it is not triggered with the current event.

        If multiple identical listeners are registered on the same event typethe duplicate instances are discarded. They do not cause the listenerto be called twice and do not need to be removed with the removeEventListenermethod.

        Parameters:
        event - One of Events
        listener - Event listener to register
      • off

         <T> void off(Omnibrowse.OmnibrowseEvent<T> event, Consumer<T> listener)

        Removes event listeners from the OmniBrowse.

        If an event listener is removed while the OmniBrowse is processing an event,it is not triggered with the current event.

        Calling {@code off} with arguments which do not identify any currently registeredlistener has no effect.

        Parameters:
        event - One of Events
        listener - Event listener to remove
      • off

         <T> void off(Omnibrowse.OmnibrowseEvent<T> event)

        Removes all event listeners from OmniBrowse.

        Behaves the same way as off but removes all listeners of specified type

        Parameters:
        event - One of Events