yodo1-mas-react-native-plugin
v1.0.0
Published
React Native plugin for Yodo1 MAS SDK
Maintainers
Readme
react-native-yodo1-mas
React Native plugin for Yodo1 MAS SDK integration
Installation
npm install react-native-yodo1-mas
# or
yarn add react-native-yodo1-masiOS Setup
- Add the following to your Podfile:
pod 'react-native-yodo1-mas', :path => '../node_modules/react-native-yodo1-mas'- Run pod install:
cd ios && pod installAndroid Setup
No additional setup required for Android.
Usage
import {
registerYodoAds,
showBannerAds,
showInterstitialAds,
showRewardedAds,
BannerView,
} from 'react-native-yodo1-mas';
// Initialize the SDK
useEffect(() => {
const eventListener = registerYodoAds();
return () => eventListener.remove();
}, []);
// Show Banner Ads
const BannerExample = () => {
const bannerRef = useRef(null);
useEffect(() => {
if (bannerRef.current) {
showBannerAds(bannerRef.current);
}
}, []);
return <BannerView ref={bannerRef} style={{ width: '100%', height: 50 }} />;
};
// Show Interstitial Ads
const showAd = async () => {
await showInterstitialAds();
};
// Show Rewarded Ads
const showReward = async () => {
await showRewardedAds();
};API Reference
Methods
registerYodoAds(): Initialize the MAS SDKshowBannerAds(ref): Show banner adsshowInterstitialAds(): Show interstitial adsshowRewardedAds(): Show rewarded adsshowInterstitialAdsWithPlacementId(placementId): Show interstitial ads with placement IDshowRewardedAdsWithPlacementId(placementId): Show rewarded ads with placement IDshowAppOpenAds(): Show app open adsshowAppOpenAdsWithPlacementId(placementId): Show app open ads with placement IDshowRewardInterstitialAds(): Show reward interstitial adsshowRewardInterstitialAdsWithPlacementId(placementId): Show reward interstitial ads with placement IDshowNativeAds(ref): Show native adssetCCPA(boolean): Set CCPA compliancesetCOPPA(boolean): Set COPPA compliancesetGDPR(boolean): Set GDPR compliancecloseBannerAd(ref): Close banner adcloseNativeAd(ref): Close native ad
Components
BannerView: Component for displaying banner adsNativeView: Component for displaying native adsCustomView: Component for displaying custom ads
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
