Suraj-Tiwari / react-native-ads-facebook

React Native Ads Library for Facebook Audience Network
GNU General Public License v3.0
15 stars 3 forks source link

NativeAd #4

Closed vietnux closed 2 years ago

vietnux commented 5 years ago

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 }} />

{this.props.nativeAd.description}
        </View>);
}

}

export default withNativeAd(AdComponent ); `

Suraj-Tiwari commented 5 years ago

make sure you have Facebook app installed and logged in with same account you've used to make advertisement id.

vietnux commented 5 years ago

yes. i has Facebook app installed. It is to show Intetital ads, banner ads but not show native ads

vietnux commented 5 years ago

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>
    );
}

} `

Suraj-Tiwari commented 5 years ago

have you tried running example app with your ad id? or please upload a sample app so i can review your implementation properly

vietnux commented 5 years ago

you can check mail from vietnux@yahoo.com

vietnux commented 5 years ago

@Suraj-Tiwari i dont send mail to surajtiwari020@gmail.com

Sorry, we were unable to deliver your message to the following address.

image

Suraj-Tiwari commented 5 years ago

simply make a private repo and grant me access.

vietnux commented 5 years ago

@Suraj-Tiwari check repo

Suraj-Tiwari commented 5 years ago

okay I'll check it out and tell you tomorrow.