A banner is a rectangular ad format with a predefined size. Banner usual is inserted at bottom of screen, inside content or content feed. Admixer SDK supports both HTML and VAST video content in a banner.
Load ad
The Admixer React Native module provides a view class that can be included in your layout. Import the AdmixerBanner class from react-native-admixer package:
import { AdmixerBanner } from 'react-native-admixer';
Include the AdmixerBanner view to your layout:
<View style={styles.container}>
<AdmixerBanner
config={{
zoneId: "YOUR_ZONE_ID",
bannerWidth: 300,
bannerHeight: 250,
sizes:[[300, 250],[320, 50]],
}}
onAdLoaded={this.onAdLoaded}
onAdLoadFailed={this.onAdLoadFailed}/>
</View>
The AdmixerBanner will automatically load an ad according to the provided config.
Listen for events
The AdmixerBanner class supports the following callbacks:
| Name | Description |
| onAdLoaded | called when an ad is successfully loaded and will be shown |
| onAdLoadFailed | called when an ad is failed to load due to network error, incorrect zoneId or another reason |
| onAdClicked | called when user clicks on banner. This callback receives a click url in the event.nativeEvent.clickUrl parameter if the clickThrough field was set to return_url |
Banner options
The AdmixerBanner class supports the following parameters inside config parameter:
| Field | Required | Type | Description |
| zoneId | required | String | A unique identifier of advertising. You can obtain a banner Zone Id in your Admixer account according to the instruction. |
| bannerWidth | required | Number | Width of a banner container |
| bannerHeight | required | Number | Height of a banner container |
| sizes | required | Array of Arrays of Numbers | Sizes of the requested ad |
| clickThrough | optional | String | Set the target link opening method. Available values are: open_sdk_browser, open_device_browser, return_url |
| autoRefreshEnabled | optional | Boolean | Enable or disable an auto refresh |
| autoRefreshInterval | optional | Number | Set auto refresh interval in milliseconds |
| resizeAdToFitContainer | optional | Boolean | Resize the ad content to fit container size. The container in this case is a banner |
Last modified:
7 February 2023


