react-native-admanager-mobile-ads
Google Mobile Ads Custom Native Formats wrapper
Installation
npm install react-native-admanager-mobile-ads
Usage
This package is for extreme flexibility. Its a wrapper around Google Ad Manager - Mobile Ads SDK for ios and android. It tries to pass the core functionality to JS
import {AdManager, useCustomNativeAd, useVisibleCustomNativeAd} from 'react-native-admanager-mobile-ads';
const adLoader = new AdQueueLoader<CustomAdFormat, CustomTargeting>(adSpecification, {
length: 1,
});
const {
id,
ad,
state: adState,
display,
renew,
impression,
click,
outdated,
targeting,
tracker,
} = useCustomNativeAd(adLoader);
// ...
Testing
New Arch
iOS
Navigate to example/package.json and set RCT_NEW_ARCH_ENABLED=1 in pods script
then run
yarn clean
yarn
# and then
yarn example ios
Android
Navigate to example/android/gradle.properties and set newArchEnabled=true then run
yarn clean
yarn
# and then
yarn example android
generate Artifacts
cd ./example/android
./gradlew generateCodegenArtifactsFromSchema
cd ../../
yarn example android
# or
cd ./example/android && ./gradlew generateCodegenArtifactsFromSchema && cd ../../ && yarn example android
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library