Closed vietnux closed 2 years ago
make sure you have Facebook app installed and logged in with same account you've used to make advertisement id.
yes. i has Facebook app installed. It is to show Intetital ads, banner ads but not show native ads
code AdComponent (not show alert or show console.log when call withNativeAd(AdComponent ); ):
`import React,{Component} from 'react'; import {Dimensions,Text, View} from 'react-native'; // import { Container } from 'native-base'; import Params from '../constants/Params.js'; import {InterstitialAdManager, NativeAdsManager, BannerView, AdSettings} from 'react-native-ads-facebook';
import AdComponent from './AdComponent'; const { width } = Dimensions.get('window'); // const adsManager = new NativeAdsManager( Params.adid.nativeAd, 1 );
export default class Ads extends Component
showInterstial = ( callback ) => {
InterstitialAdManager.showAd( Params.adid.interstitial )
.then(didClick => { callback(); })
.catch(error => { })
}
showBanner() {
return (
<View>
<BannerView
placementId={Params.adid.banner}
type="standard"
onPress={() => console.log('click')}
onError={err => console.log('error', err)}
/>
</View>
);
}
showNative = ( numberOfAdsToRequest ) => {
AdSettings.setLogLevel('debug');
var numberOfAdsToRequest = numberOfAdsToRequest ? numberOfAdsToRequest : 10;
// adsManager = new NativeAdsManager( Params.adid.nativeAd );
// this.props.adChoicePosition = "bottomRight";
// this.props.adsManager = adsManager;
return (
<View style={{
justifyContent: 'center',
backgroundColor: '#555',
padding: 20,
}}
>
<AdComponent adsManager={adsManager} adChoicePosition="bottomRight" />
{/*{this._nativeAdView()}*/}
</View>
);
}
} `
have you tried running example app with your ad id? or please upload a sample app so i can review your implementation properly
you can check mail from vietnux@yahoo.com
@Suraj-Tiwari i dont send mail to surajtiwari020@gmail.com
Sorry, we were unable to deliver your message to the following address.
simply make a private repo and grant me access.
@Suraj-Tiwari check repo
okay I'll check it out and tell you tomorrow.
NativeAd not show??? export default withNativeAd(AdComponent); => not run
`import React, { Component } from 'react'; import { Text, View, Dimensions } from 'react-native'; import { withNativeAd, AdIconView, AdChoicesView, TriggerableView, MediaView, } from 'react-native-ads-facebook'; const { width } = Dimensions.get('window');
class AdComponent extends React.Component { // class AdComponent extends Component {
constructor(props) {
super(props);
alert('It is native');
}
render() {
alert("OK ====?");
console.warn(this.props);
return (
<View style={{ backgroundColor: '#555',}}>
<AdChoicesView style={{ position: 'absolute', left: 0, top: 0 }} />
<AdIconView style={{ width: 50, height: 50 }} />
<MediaView style={{ width: 160, height: 90 }} />
}
export default withNativeAd(AdComponent ); `