0.1.2 • Published 1 year ago

react-native-google-ads-webview v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-native-google-ads-webview

React Native component for WebView API for Google AdSense Ads.

npm.io

Installation

npm install react-native-google-ads-webview

iOS

Update your Info.plist

Update your app's Info.plist to complete Google Mobile Ads SDK installation

<!-- Bypass GADApplicationIdentifier check for WebView API for Ads -->
<key>GADIntegrationManager</key>
<string>webview</string>

Android

Nothing to do here

Usage

import { GoogleAdsWebviewView } from 'react-native-google-ads-webview';

// ...

<GoogleAdsWebviewView
  style={{ width: 300, height: 250 }}
  adHost="{{ad-host}}"
  adClient="{{ad-client}}"
  pageUrl="http://www.example.com"
/>;

API Reference

adHost

adHost: string;

Your ad-host parameter.

adClient

adClient: string;

Your ad unit ad-client parameter.

pageUrl

pageUrl: string;

Page url for reporting purposes. You can send the domain instead of setting the complete data-page url if you don’t know it.

adSlot

adSlot?: string

Your ad unit ad-slot parameter.

onUnfilledAd

onUnfilledAd?: () => void;

Triggered when AdSense were unable to filled the ad slot with an ad creative.

Example App

Go into the example app subdirectory:

cd react-native-google-ads-webview/example

Android

yarn android

iOS

Extra installation step needed in case of clean checkout only:

cd ios && pod install && cd ..

Then:

yarn ios

License

MIT

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago