> For the complete documentation index, see [llms.txt](https://aatkit.gitbook.io/rtbsdk-android-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aatkit.gitbook.io/rtbsdk-android-integration/formats/fullscreen-interstitial.md).

# Fullscreen (Interstitial)

This guide shows you how to integrate fullscreen ads of RTBSDK into your app.

### Create RTBFullscreenAd Instance

Create an instance of [`RTBFullscreenAd`](https://android-sdk-rtb.gravite.net/references/-r-t-b--s-d-k/com.rtb.sdk/-r-t-b-fullscreen-ad/index.html):

```kotlin
val fullscreenAd = RTBFullscreenAd(this)
```

### Listen to Callbacks

Through the use of [`RTBFullscreenDelegate`](https://android-sdk-rtb.gravite.net/references/-r-t-b--s-d-k/com.rtb.sdk/-r-t-b-fullscreen-delegate/index.html), you can listen to the different callbacks.

```kotlin
fullscreenAd.delegate = this
```

### Request Ad

To load a fullscreen ad, you will need to pass an instance of [RTBFullscreenRequestConfiguration](https://android-sdk-rtb.gravite.net/references/-r-t-b--s-d-k/com.rtb.sdk/-r-t-b-fullscreen-request-configuration/index.html) with `placementID` and the `bundleId`. Please contact our [support](mailto:support@gravite.net) for getting the needed IDs.

```kotlin
val rtbFullscreenRequestConfiguration = RTBFullscreenRequestConfiguration(<PLACEMENT_ID>, <BUNDLE_ID>)
rtbFullscreenRequestConfiguration.sellerId = "<SELLERID>" // Optional
fullscreenAd.load(rtbFullscreenRequestConfiguration)
```

You will be notified about the loading success/failure through the [`RTBFullscreenDelegate`](https://android-sdk-rtb.gravite.net/references/-r-t-b--s-d-k/com.rtb.sdk/-r-t-b-fullscreen-delegate/index.html)&#x20;

#### Optional - set user targeting <a href="#complete-code-example" id="complete-code-example"></a>

You can pass user targeting data to each request, allowing ads to be more relevant to your audience. Each field in [RTBUserTargeting](https://android-sdk-rtb.gravite.net/references/-r-t-b--s-d-k/com.rtb.sdk/-r-t-b-user-targeting/index.html) is optional.

```kotlin
rtbFullscreenRequestConfiguration.userTargeting = RTBUserTargeting(userID = "<USER_ID>", gender = RTBGender.MALE, keywords = listOf("keyword1", "keyword2"), yearOfBirth = 1990)
// yearOfBirth must be a 4-digit number, otherwise it will be ignored
```

### Show Ad

After the ad gets loaded, it can be presented by calling:

```kotlin
fullscreenAd?.show(this)
```

{% hint style="info" %}
The currency of `bidFloor` and `priceCPM` parameters is USD.
{% endhint %}

### Complete Code Example <a href="#complete-code-example" id="complete-code-example"></a>

```kotlin
class MainActivity : AppCompatActivity(), RTBFullscreenDelegate {

    private var fullscreenAd: RTBFullscreenAd? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        fullscreenAd = RTBFullscreenAd(this)

        // Set the interstitial delegate to listen to events
        fullscreenAd?.delegate = this

        // Request a fullscreen ad using the placement ID and bundle ID
        val rtbFullscreenRequestConfiguration = RTBFullscreenRequestConfiguration(<PLACEMENT_ID>, <BUNDLE_ID>)
        rtbFullscreenRequestConfiguration.sellerId = "<SELLERID>" // Optional
        fullscreenAd.load(rtbFullscreenRequestConfiguration)
    }

    // RTBFullscreenDelegate implementation:
    override fun fullscreenAdDidReceiveAd(fullscreenAd: RTBFullscreenAd, bidInfo: RTBBidInfo, networkName: String)
        // An ad has been loaded
        // Show the ad:
        fullscreenAd.show(this)
    }

    override fun fullscreenAdDidFailToReceiveAd(fullscreenAd: RTBFullscreenAd, error: String, networkName: String) {
        // Failed to load an ad
    }

    override fun fullscreenAdDidRecordClick(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The ad received a click
    }

    override fun fullscreenAdDidPauseForAd(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The app paused for displaying a fullscreen ad
    }

    override fun fullscreenAdDidResumeAfterAd(fullscreenAd: RTBFullscreenAd, networkName: String) {
        // The app resumed after dismissing a fullscreen ad
    }

}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aatkit.gitbook.io/rtbsdk-android-integration/formats/fullscreen-interstitial.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
