Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

Prerequisites

  1. https://refinery89.atlassian.net/wiki/x/A4DVSQ

  2. https://refinery89.atlassian.net/wiki/x/BgDOSQ

Create a Wrapper

For creating a wrapper, you can follow this small guide : https://refinery89.atlassian.net/wiki/x/A4DcSQ

Show the Ad

In the example we are using a Test Id.

...

, In this page we present different ways to create the wrapper.

This is the recommended way (Most Common) ->

This code goes inside the root of your layout file.

Code Block
# activity_main.xml
...
<LinearLayout
    android:id="@+id/wrapper"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_centerHorizontal="true"
    android:layout_alignParentBottom="true">
</LinearLayout>
...

Show the Ad

Get this view from an activity or fragment, a way to do it could be:

Code Block
languagekotlin
# MainActivity.kt
val wrapper = <Get Your wrapper>findViewById(R.id.wrapper)
val outstreamConfigId = ConfigBuilder.VIDEO_OUTSTREAM_TEST_R89UNIT_CONFIG_ID

RefineryAdFactory.createVideoOutstreamBanner(outstreamConfigId, wrapper)
Info

Your outstreamConfigIdbannerConfigId will be provided to you during onboarding process by email, you can also retrieve them from the web interface after login.

They can be many or none depending on your requests, if you need one or more please request them to your account manager or technical account manager.

Lifecycle Events

You can subscribe to these events with the same method but passing a new object as a parameter. Details about this object can be found in the Reference.

Code Block
breakoutModewide
languagekotlin
# MainActivity.kt
val wrapper = <Get Your wrapper>
findViewById(R.id.wrapper)
val outstreamConfigId = ConfigBuilder.BANNERVIDEO_OUTSTREAM_TEST_R89_CONFIG_ID
val outstreamLifecycleListener = <create the listener with a method or inplace>

RefineryAdFactory.createVideoOutstreamBanner(outstreamConfigId, wrapper, outstreamLifecycleListener)

...