UNPKG

2.58 kBTypeScriptView Raw
1import * as React from 'react';
2import { View } from 'react-native';
3declare type PropsType = React.ComponentProps<typeof View> & {
4 /**
5 * AdMob iOS library banner size constants
6 * (https://developers.google.com/admob/ios/banner)
7 * banner (320x50, Standard Banner for Phones and Tablets)
8 * largeBanner (320x100, Large Banner for Phones and Tablets)
9 * mediumRectangle (300x250, IAB Medium Rectangle for Phones and Tablets)
10 * fullBanner (468x60, IAB Full-Size Banner for Tablets)
11 * leaderboard (728x90, IAB Leaderboard for Tablets)
12 * smartBannerPortrait (Screen width x 32|50|90, Smart Banner for Phones and Tablets)
13 * smartBannerLandscape (Screen width x 32|50|90, Smart Banner for Phones and Tablets)
14 *
15 * banner is default
16 */
17 bannerSize: 'banner' | 'largeBanner' | 'mediumRectangle' | 'fullBanner' | 'leaderboard' | 'smartBannerPortrait' | 'smartBannerLandscape';
18 /**
19 * AdMob ad unit ID
20 */
21 adUnitID?: string;
22 /**
23 * Additional request params added to underlying request for the ad.
24 */
25 additionalRequestParams?: {
26 [key: string]: string;
27 };
28 /**
29 * Whether the SDK should serve personalized ads (use only with user's consent). If this value is
30 * `false` or `undefined`, this sets the `npa` key of `additionalRequestParams` to `'1'` following
31 * https://developers.google.com/admob/ios/eu-consent#forward_consent_to_the_google_mobile_ads_sdk
32 * and
33 * https://developers.google.com/admob/android/eu-consent#forward_consent_to_the_google_mobile_ads_sdk.
34 */
35 servePersonalizedAds?: boolean;
36 /**
37 * AdMob iOS library events
38 */
39 onAdViewDidReceiveAd?: () => void;
40 onDidFailToReceiveAdWithError?: (string: any) => void;
41 onAdViewWillPresentScreen?: () => void;
42 onAdViewWillDismissScreen?: () => void;
43 onAdViewDidDismissScreen?: () => void;
44 onAdViewWillLeaveApplication?: () => void;
45};
46declare type StateType = {
47 style: {
48 width?: number;
49 height?: number;
50 };
51};
52export default class AdMobBanner extends React.Component<PropsType, StateType> {
53 static defaultProps: {
54 bannerSize: string;
55 };
56 state: {
57 style: {};
58 };
59 _handleSizeChange: ({ nativeEvent }: {
60 nativeEvent: {
61 width: number;
62 height: number;
63 };
64 }) => void;
65 _handleDidFailToReceiveAdWithError: ({ nativeEvent }: {
66 nativeEvent: {
67 error: string;
68 };
69 }) => void | undefined;
70 render(): JSX.Element;
71}
72export {};