Home Review easy to use AdMob Native Ads for react native Android & iOS

easy to use AdMob Native Ads for react native Android & iOS

199
0
easy to use AdMob Native Ads for react native Android & iOS

While you would possibly have seen native ads on a react-native application, I even have tried to require everything to a different level so its really really very easy for you guys to urge native ads up and running during a few steps with with styling support iOS

Native Admob Ads

Cross Platform (iOS and Android)
Identical performing on Android and iOS
Style your ads as you wish!

No got to manage .xml or .xib layout files to match ad style to app theme!
Adding styles is as simple as adding styles to the other react-native View
AutoRefresh ad
Multiple Ad Sizes
Support Video Ads & Image Ads!

Try the instance app

To run the instance app clone the project git clone Link then run yarn or npm install within the example folder and eventually to run the instance app:

react-native run-android npm install react-native-actions-sheet save
or if you employ yarn:

yarn add react-native-actions-sheet iOS
Step 1: Follow the guide to feature Google Mobile Ads SDK to your Xcode project. Also do not forget to update your info.plist file also to feature AppID.

Step 2: Add .xib files to your main project:

How to Fix Scraped content issue AdSense Violation?

Open. xcworkspace file inside the ios folder in your project in Xcode.
Select the basis folder of your project and right click for the dropdown menu.

Click on Add files to YOUR_PROJECT_NAME
In select file window, attend YOUR_PROJECT/node_modules/react-native-admob-native-ads/ios

Select GADTMediumTemplateView.xib and GADTSmallTemplateView.xib files and add them to your project. confirm copy items if needed is checked and add groups is selected!

Android

Add your AdMob App ID to AndroidManifest.xml, as described within the Google Mobile Ads SDK documentation.

For complete usage, see the instance project. import React from react; import { View } from react-native; import NativeAdView from react-native-admob-native-ads; const App = () => { return ( ); }; export default App; Props adUnitID
Set Ad Unit ID for Native Advanced Ads that you simply created on your AdMob account.

Type Required Platform string Yes All adSize
Select which size of ad you would like to display.

Type Required Default Platform string no small All
Android adSizes: small,medium, large iOS adSizes: small and medium only.

testDevices
Set testDevices during testing ads or during development.

Type Required Platform Array no All buttonStyle
style the callToAction button in Native ad consistent with your app look and feel.

Type Required Platform object no All
The following styles properties are available at the instant .

Name Type Required backroundColor 6 digit hex color string only Yes textColor 6 digit hex color string only Yes borderColor 6 digit hex color string only Yes borderWidth number Yes borderRadius number Yes

Note: Currently you’ll got to set all available properties and provides them a legitimate value. value cannot be null

backgroundStyle
Style the background of Native Ad View.

Type Required Platform object no All
The following styles properties are available at the instant .

Name Type Required backroundColor 6 digit hex color string only Yes borderColor 6 digit hex color string only Yes borderWidth number Yes borderRadius number Yes

Note: Currently you’ll got to set all available properties and provides them a legitimate value. value cannot be null

headlineTextColor
Set color for the heading text of Ad.

Type Required Platform 6 digit hex color string only no All descriptionTextColor
Set color for the outline text of Ad.

Type Required Platform 6 digit hex color string only no All advertiserTextColor
Set color for the outline text of Ad.

Type Required Platform 6 digit hex color string only no All ratingBarColor
Set color for the outline text of Ad.

Type Required Platform 6 digit hex color string only no Android Only Events
All events are available through props.The following event are available on both Android and iOS:

onAdFailedToLoad
Called when ad has did not load and returns reason thanks to which ad wasn’t loaded.

onAdLoaded
Called when ad has successfully loaded with none errors.

onAdOpened
Called when ad is opened.

onAdClosed
Called when ad is closed.

onAdLeftApplication
Called when ad is loaded but user has left the appliance

onAdImpression
User impression has been recorded

onAdClicked
User has clicked on the ad.

Contributing
There are multiple ways during which you’ll contribute to the present library. be happy to open a problem if you’ve got a thought in mind or if you’ve got found a bug.

If the templates don’t fit your requirments and you opt to form your own templates, be happy to submit them here and that i will add them within the library.

Find this library useful?
Support it by joining stargazers for this repository and follow me for my next creations!