Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ export default class Example extends Component {
validAdSizes={['banner', 'largeBanner', 'mediumRectangle']}
adUnitID="/6499/example/APIDemo/AdSizes"
ref={el => (this._adSizesExample = el)}
targeting={{
customTargeting: { group: "users" },
categoryExclusions: ['media'],
gender: 'male',
birthday: new Date(1989, 6, 9),
childDirectedTreatment: true,
contentURL: 'admob://',
publisherProvidedID: 'abc123',
}}
/>
<Button
title="Reload"
Expand Down
62 changes: 61 additions & 1 deletion RNPublisherBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
UIManager,
ViewPropTypes,
} from 'react-native';
import { string, func, arrayOf, bool, object, shape, instanceOf, oneOf, number } from 'prop-types';
import { createErrorFromErrorData } from './utils';

class PublisherBanner extends Component {
Expand All @@ -27,7 +28,7 @@ class PublisherBanner extends Component {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this._bannerView),
UIManager.getViewManagerConfig('RNDFPBannerView').Commands.loadBanner,
null
null,
);
}

Expand Down Expand Up @@ -114,6 +115,65 @@ PublisherBanner.propTypes = {
onAdClosed: func,
onAdLeftApplication: func,
onAppEvent: func,

/**
* ADS segmentation
*/
targeting: shape({
/**
* Arbitrary object of custom targeting information.
*/
customTargeting: object,

/**
* Array of exclusion labels.
*/
categoryExclusions: arrayOf(string),

/**
* Array of keyword strings.
*/
keywords: arrayOf(string),

/**
* When using backfill or an SDK mediation creative, gender can be supplied
* in the ad request for targeting purposes.
*/
gender: oneOf(['unknown', 'male', 'female']),

/**
* When using backfill or an SDK mediation creative, birthday can be supplied
* in the ad request for targeting purposes.
*/
birthday: instanceOf(Date),

/**
* Indicate that you want Google to treat your content as child-directed.
*/
childDirectedTreatment: bool,

/**
* Applications that monetize content matching a webpage's content may pass
* a content URL for keyword targeting.
*/
contentURL: string,

/**
* You can set a publisher provided identifier (PPID) for use in frequency
* capping, audience segmentation and targeting, sequential ad rotation, and
* other audience-based ad delivery controls across devices.
*/
publisherProvidedID: string,

/**
* The user’s current location may be used to deliver more relevant ads.
*/
location: shape({
latitude: number,
longitude: number,
accuracy: number,
}),
}),
};

const RNDFPBannerView = requireNativeComponent(
Expand Down
Loading