> For the complete documentation index, see [llms.txt](https://pub-star.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pub-star.gitbook.io/docs/1.5.1/unity-sdk/native.md).

# Native

Load and immediately show an Native ads by ID.

### API

| Props         | Function                                                                                                             |
| ------------- | -------------------------------------------------------------------------------------------------------------------- |
| `OnLoaded`    | call when ad loaded                                                                                                  |
| `OnLoadError` | call when load ad failed. return Error code                                                                          |
| `OnShowed`    | call when ad showed                                                                                                  |
| `OnHidden`    | call when ad hidden/closed (supports rewarded ads). Returns detailed `PubstarReward` JSON string (`type`, `amount`). |
| `OnShowError` | call when show ad failed. return Error code                                                                          |

### Example

```c#
NativeView native = new NativeView(
    nativeAdID,
    AdSize.Medium,
    AdPosition.Bottom);
native.OnLoaded += () =>
{
    // callback when ad loaded
};
native.OnShowed += () =>
{
    // callback when ad showed
};
native.Show();
```
