TOP > The Visibility Measurement
This function can measure the visibility of any target View and call back after the visibility is established.
※ The use of this API is for apps that can use the Rakuten Ichiba search API.
Use ViewabilityProvider
to monitor the visibility of the View.
To start monitoring the View, use the register
method.
This method takes a URL and the target View as arguments.
ViewabilityProvider$register(view: View, url: String, callback: ViewabilityListener)
Method
register
requires the following arguments.
view
(required) : Target viewurl
(required) : An url to send the resultscallback
(optional) : Called after submitting the result. A callback if needed.
The following is an implementation example.
val sampleTargetView = findViewById<LinearLayout>(R.id.sampleTarget)
ViewabilityProvider.register(sampleTargetView, "URL", object: ViewabilityListener {
override fun onEstablished() {
// Transmission completed
}
})
※ It is desirable to execute
register
after the drawing of the target View is completed.※ After
onEstablished
is called, it implicitly unregisters, so you don't have to manually call'unregister'
.
If you want to stop while monitoring, use the unregister
method.
ViewabilityProvider$unregister(view: View)
Method
unregister
requires the following arguments.
view
(required) : Target view
val sampleTargetView = findViewById<LinearLayout>(R.id.sampleTarget)
ViewabilityProvider.unregister(sampleTargetView)
Viewable module supports Open Measurement SDK.
You can enable it by passing the instance of OmNativeParameter
as the forth argument of register
method.
val sampleTargetView = findViewById<LinearLayout>(R.id.sampleTarget)
ViewabilityProvider.register(sampleTargetView, "URL", object: ViewabilityListener {
override fun onEstablished() {
// Transmission completed
}
},
OmNativeParameter(
"iabtechlab.com-omid",
URL("https://s3-us-west-2.amazonaws.com/updated-omsdk-files/compliance-js/omid-validation-verification-script-v1-RAKUTEN-03142023.js"),
"iabtechlab-Rakuten",
URL("https://storage.googleapis.com/rssp-dev-cdn/sdk/js/omsdk-v1-1.4.3.js")
))
LANGUAGE :