# Banner and Native

Load and immediately show an Banner ads or an Native ads by ID.

### API

| Props           | Function                                                 |
| --------------- | -------------------------------------------------------- |
| `adId`          | id of Banner or Native ad                                |
| `size`          | size of ad View. (`small`, `medium`, `large`)            |
| `type`          | kind of ad View. (`banner`, `native`)                    |
| `onLoaded`      | call when ad loaded                                      |
| `onLoadedError` | call when load ad failed. return object type `ErrorCode` |
| `onShowed`      | call when ad showed                                      |
| `onHide`        | call when ad closed return object type `RewardModel`     |
| `onShowedError` | call when show ad failed. return object type `ErrorCode` |

### Example

```js
<PubstarAdView
    adId={adId}
    style={styles.ad}
    size="medium"
    type="banner"
    onLoaded={() => {
        // callback when ad loaded
    }}
    onLoadedError={(errorCode) => {
        // callback when ad load error
    }}
    onShowed={() => {
        // callback when ad showed
    }}
    onHide={() => {
        // callback when ad hide with reward option
    }}
    onShowedError={(errorCode) => {
        // callback when show error
    }}
/>
```


---

# Agent Instructions: 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://pub-star.gitbook.io/docs/1.5.0/react-native-sdk/banner-native.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.
