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
5 changes: 0 additions & 5 deletions src/AdManagerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ export interface IAdManagerTargeting {
* information to third-party ad networks if required.
*/
location?: IAdManagerTargetingLocation;

/**
* Correlator string to pass to ad loader.
*/
correlator?: string;
}

export interface IAdManagerTemplateImage {
Expand Down
5 changes: 5 additions & 0 deletions src/CTKAdManagerAdaptiveBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ interface IAdManagerAdaptiveBannerPropsBase extends ViewProps {
testDevices?: string[];

targeting?: IAdManagerTargeting;

/**
* Correlator string to pass to ad loader.
*/
correlator?: string;
}

interface IAdManagerAdaptiveBannerProps
Expand Down
17 changes: 11 additions & 6 deletions src/CTKAdManagerBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ViewProps,
findNodeHandle,
NativeSyntheticEvent,
DeviceEventEmitter,
DeviceEventEmitter,
EventSubscription
} from 'react-native';
import { createErrorFromErrorData } from './utils';
Expand Down Expand Up @@ -52,10 +52,15 @@ interface IAdManagerBannerPropsBase extends ViewProps {
testDevices?: string[];

targeting?: IAdManagerTargeting;

/**
* Correlator string to pass to ad loader.
*/
correlator?: string;
}

interface IAdManagerBannerProps extends IAdManagerBannerPropsBase {
// onError is a callback function sent from parent RN component of your RN app, aka: the error handler.
// onError is a callback function sent from parent RN component of your RN app, aka: the error handler.
// so if your RN App wants to handle the error, please pass in the "onError" function.
onError?: (eventData: Error) => void;
/**
Expand Down Expand Up @@ -139,19 +144,19 @@ export class Banner extends React.Component<
componentDidMount() {
this.customListener= DeviceEventEmitter.addListener('onError',eventData=>{
this.setState({ error: eventData });
if (this.hasOnErrorFromParent && this.props.onError) {
if (this.hasOnErrorFromParent && this.props.onError) {
this.props.onError(eventData);
}
});
});
this.loadBanner();
}

componentWillUnmount() {
if (this.customListener) {
this.customListener.remove();
}
}

loadBanner() {
UIManager.dispatchViewManagerCommand(
findNodeHandle(this),
Expand Down
2 changes: 1 addition & 1 deletion src/native-ads/withNativeAd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import { LINKING_ERROR } from '../Constants';
*/
interface INativeAdPropsBase extends ViewProps {
adSize?: string;
correlator?: string;
customTemplateIds?: string[];
validAdSizes?: string[];
validAdTypes?: ('banner' | 'native' | 'template')[];
customClickTemplateIds?: string[];
targeting?: IAdManagerTargeting;
correlator?: string;
}

interface INativeAdNativeProps extends INativeAdPropsBase {
Expand Down