An open API service indexing awesome lists of open source software.

https://github.com/nstudio/nativescript-smart-adserver

SmartAdserver SDK implementation for NativeScript. Monetize your app with the power of smart ads from SmartAdserver! :money_with_wings: :moneybag:
https://github.com/nstudio/nativescript-smart-adserver

Last synced: 4 months ago
JSON representation

SmartAdserver SDK implementation for NativeScript. Monetize your app with the power of smart ads from SmartAdserver! :money_with_wings: :moneybag:

Awesome Lists containing this project

README

          

# nativescript-smart-adserver

Note: Only the Banner module is currently available in this plugin.

Works on Android and iOS

## Screenshots

### Android

### iOS

## Installation

```javascript
tns plugin add @nstudio/nativescript-smart-adserver
```

## Usage

To use this plugin, you will need Site ID, Base URL of your site, Page ID and Format ID from SmartAdServer.

### TypeScript

In app.ts you have to initialize the plugin

```js
import { SmartAdBanner } from "@nstudio/nativescript-smart-adserver";

SmartAdBanner.init(104808, "https://mobile.smartadserver.com");
```

Then in the xml file, include this namespace on the parent component of where you
want to place the AdView.

```xml
xmlns:sas="@nstudio/nativescript-smart-adserver"
```

Now you can create smart ad banner like this,

```xml

```

### JavaScript

Same as Typescript, but the import statement will be

```js
const SmartAdBanner = require("@nstudio/nativescript-smart-adserver").SmartAdBanner;
```

### Angular

In main.ts you have to initialize the plugin

```js
import { SmartAdBanner } from "@nstudio/nativescript-smart-adserver";

SmartAdBanner.init(104808, "https://mobile.smartadserver.com");
```

In the module where you want to add Ads (eg, app.module.ts), import it like this\

```js
import { NativescriptSmartAdBannerModule } from "@nstudio/nativescript-smart-adserver/angular";
```

Now add `NativescriptSmartAdBannerModule` to the imports array of that module

You can now use the banner using this markup

```xml

```

## API

Banner Module API (XML/HTML element Properties)

* pageId - the page id assigned by smart ad server
* formatId - format id given by smart ad server
* autoRefresh - specific if the ad should change over time

## License

Apache License Version 2.0, January 2004