# AppNexusBanner

## Description

AppNexusBanner is providing simple banners functionality. Its downloading from internet conent and resizes automatically to proper size by itself.

## Usage

All you need is to `import` `{ AppNexusBanner }` from the `audienzz-react-native-appnexus-library` module and then use the `<AppNexusBanner/>` tag.

```javascript
'use strict';
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
import { AppNexusBanner } from 'audienzz-react-native-appnexus-library'

type Props = {};
export default class App extends Component<Props> {
    render(){
        return(
            <View style={styles.container}>
                <AppNexusBanner
                placementId={'15624474'}
                sizes={[[300, 250], [320, 460]]}
                />
            </View>
        )
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
})
```

The minimum parameters required to pass in AppNexusBanner are `placementId` and `sizes`. You can also use other input parameters. Example:

```
<AppNexusBanner
    placementId={"15624474"}
    sizes={[[300, 250], [320, 460]]}
    autoRefreshInterval={60}
    keywords={{
        environment: "test"
    }}
    onAdLoadSuccess={() => console.log("true")}
    onAdLoadFail={() => console.log("Failed!")}
/>
```


#### `placementId`

The placement ID identifies your banner in system. You must have a valid, active placement ID to monetize your application.  

#### `sizes`

Set the sizes of the ad to request.  

#### `autoRefreshInterval`

The interval, in milliseconds, at which the BannerAdView will request new ads, if auto-refresh is enabled.  

#### `keywords`

Add a custom keyword to the request URL for the ad. This is used to set custom targeting parameters within the AppNexus platform. You will be given the keys and values to use by your AppNexus account representative or your ad network.  

#### `onAdLoadSuccess`

Called when a native ad has successfully loaded.  

#### `onAdLoadFail`

Called when a native ad call has failed.  
