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:
- Host: GitHub
- URL: https://github.com/nstudio/nativescript-smart-adserver
- Owner: nstudio
- License: apache-2.0
- Created: 2018-02-28T17:24:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T09:56:26.000Z (almost 8 years ago)
- Last Synced: 2025-01-31T13:04:09.088Z (over 1 year ago)
- Language: Objective-C
- Homepage:
- Size: 18.3 MB
- Stars: 0
- Watchers: 6
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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