> For the complete documentation index, see [llms.txt](https://aatkit.gitbook.io/aatkit-react-native-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/aatkit-react-native-integration/formats/rewarded-video.md).

# Rewarded Video

### Usage

All functions to create, reload and show rewarded video ads are included to `RNAatkit` module. So first you should import `RNAatkit`.

```javascript
import {
    RNAatkit,
} from '@addapptr/react-native-aatkit'
```

When AATKit is already initialized, you can create rewarded video placement. Just call `createRewardedVideoPlacement` function passing the placement name as parameter. Please note that the placement name has to be constant after once defined and cannot change with every app restart.

```javascript
RNAatkit.createRewardedVideoPlacement("Rewarded");
```

Then you can reload placement using `reloadPlacement` function. Also it's possible to let fullscreen ad to be auto-reloaded by calling `startPlacementAutoReload`.&#x20;

```javascript
RNAatkit.reloadPlacement(
    "Rewarded", (placementReloaded) => {
        console.log("placementReloaded " + placementReloaded);
    });
```

When rewarded video ad is loaded, you can show it calling `showPlacement` function.

```javascript
RNAatkit.showPlacement("Rewarded", (rewardShown) => {
    console.log("rewardShown " + rewardShown);
});
```

Use `AATKitUserEarnedIncentive` event to figure out if placement earned incentive.

```javascript
const subscription = aatkitEmitter.addListener(
  'AATKitUserEarnedIncentive',
  (data) => console.log("AATKitUserEarnedIncentive placementName: " + data.placementName + " reward: " + data.reward)
);
```

### Callbacks <a href="#markdown-header-rnaatkit-callbacks" id="markdown-header-rnaatkit-callbacks"></a>

`RNAatkit` provides more callbacks which might be useful, for example to get notified when rewarded video ad is loaded . To receive them, use `NativeEventEmitter`.

```javascript
import {
    RNAatkit,
} from '@addapptr/react-native-aatkit'
import { NativeEventEmitter } from 'react-native';

const aatkitEmitter = new NativeEventEmitter(RNAatkit);

const subscriptionHaveAd = aatkitEmitter.addListener(
    'AATKitHaveAd',
    (data) => console.log("AATKitHaveAd placementName " + data.placementName)
);

const subscriptionNoAds = aatkitEmitter.addListener(
    'AATKitNoAds',
    (data) => console.log("AATKitNoAds placementName: " + data.placementName)
);

const subscriptionPauseForAd = aatkitEmitter.addListener(
    'AATKitPauseForAd',
    (data) => console.log("AATKitPauseForAd placementName: " + data.placementName)
);

const subscriptionResumeAfterAd = aatkitEmitter.addListener(
    'AATKitResumeAfterAd',
    (data) => console.log("AATKitResumeAfterAd placementName: " + data.placementName)
);
```

### API <a href="#markdown-header-api" id="markdown-header-api"></a>

For more details about functions and callbacks of `RNAatkit` component, please see this [page](/aatkit-react-native-integration/other/reference/rnaatkit.md) in the Reference.


---

# 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/aatkit-react-native-integration/formats/rewarded-video.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.
