pageView

send a page viewed event to the server.

onPageView and onPageViewEnded should be invoked from each page (i.e., fragment or activity) in your application, as in:

OnLifecycleEvent { _, event ->
    when (event) {
        ON_RESUME -> viewModel.onPageView(pageTitle, pageUrl)
        ON_PAUSE -> viewModel.onPageViewEnded(pageTitle, pageUrl)
        else -> Ignored
    }
}

Parameters

title

application-defined "title" string uniquely identifying the page viewed. Examples might include "category?cellphones" or "details?item=4568".

uri

application-defined "uri" uniquely identifying the page viewed. The uri must be a valid uri, although a relative URI is allowed. Examples might include "com.nice.cxonechat.sample://category/cellphones" or "/details/4568".

date

date of the event.

listener

an optional listener to be notified after the event has been sent.

errorListener

an optional error listener to be notified about errors encountered when event is handled.

See also