floatinghotpot / cordova-plugin-facebookads

Cordova/PhoneGap plugin for Facebook Audience Network Ads
65 stars 71 forks source link

show banner at bottom center #20

Open matrixreal opened 9 years ago

matrixreal commented 9 years ago

hi all is this call true ... i want show banner ad on the bottom center

1) create the banner by this call "if(FacebookAds) FacebookAds.createBanner( adid.banner );"

2) show it on the bottom center "showBanner(AD_POSITION.BOTTOM_CENTER);"

thanks for reply

floatinghotpot commented 9 years ago

Hi Neo,

if(FacebookAds) FacebookAds.createBanner( { adId: adid.banner });
if(FacebookAds) FacebookAds.showBanner( FacebookAds.AD_POSITION.BOTTOM_CENTER );
matrixreal commented 9 years ago

here is my code

var ad_units = {
    ios : { 
        banner:"your_ad_place_id",
        interstitial:"your_ad_place_id"
    },
    android : {
        banner:"717477545052112_734379190028614",
        interstitial:"717477545052112_734379273361939"
    }
};

// select the right Ad Id according to platform
var adid = (/(android)/i.test(navigator.userAgent)) ? ad_units.android : ad_units.ios;

and

if(FacebookAds) FacebookAds.createBanner( { adId: adid.banner });
if(FacebookAds) FacebookAds.showBanner( FacebookAds.AD_POSITION.BOTTOM_CENTER );

and ads are not shown interstitial works but not the banner id

floatinghotpot commented 9 years ago

Any logs? You can run it on device, and see logs in eclipse LogCat

matrixreal commented 9 years ago

@floatinghotpot

1) on debug mode it work perfect for interstitial and banner ads but when i build the apk and try it ... the banner not shown and interstitial are shown only one time

2) other question , the call to remove the banner ads completely is "if(FacebookAds) FacebookAds.removeBanner();" right ?

3) and how to enable / disable overlap ?

thanks for reply

floatinghotpot commented 9 years ago

I am running android studio to test the plugin on a real device, the interstitial ad and native ad can be display correct, but banner always not show. following is the logcat message:

10-15 23:50:17.889 27807-27807/com.rjfun.demo D/GenericAdPlugin﹕ FacebookAds, onAdLoaded, {'adNetwork':'FacebookAds','adType':'banner','adEvent':'onAdLoaded'}

10-15 23:50:17.989 27807-27807/com.rjfun.demo I/chromium﹕ [INFO:CONSOLE(1)] "The page at 'https://www.facebook.com/' was loaded over HTTPS, but displayed insecure content from 'http://dragon.ak.fbcdn.net/hphotos-ak-prn1/t39.3079-6/851551_836527893040166_1350205352_n.png': this content should also be loaded over HTTPS. ", source: https://www.facebook.com/ (1)

10-15 23:50:18.899 27807-27807/com.rjfun.demo D/FBAudienceNetworkLog﹕ Impression logged (displayed for test ads only)

10-15 23:50:19.779 27807-27807/com.rjfun.demo I/chromium﹕ [INFO:CONSOLE(0)] "XMLHttpRequest cannot load https://m.facebook.com/?refsrc=https%3A%2F%2Fwww.facebook.com%2F&_rdr#?analog=%7B%7D. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.facebook.com' is therefore not allowed access.", source: https://www.facebook.com/ (0)

arnesikstrom commented 8 years ago

Any updates on this? I have the same problem. I am also testing now with the "app" from the test folder and only top banner with overlap=false is working. I can't see anything strange in logcat, getting: D/GenericAdPlugin: FacebookAds, onAdLoaded, {'adNetwork':'FacebookAds','adType':'banner','adEvent':'onAdLoaded'} Built with CLI 5.1.1 and tested on Android 4,4 and 6.0.

txchen commented 8 years ago

@frostyelkarne I have the same problem, only top and overlap=false banner can be shown. @floatinghotpot I think this is a bug in the plugin, because old version can work (before you changed the plugin name). Would you please help to take a look?

ardpx commented 8 years ago

Have the same issue as @frostyelkarne and @txchen.

Tried the following code, if(FacebookAds) FacebookAds.createBanner( { adId: "xxx", overlap: true }); if(window.FacebookAds) FacebookAds.showBanner( FacebookAds.AD_POSITION.TOP_CENTER );

The logcat shows, 11-24 15:21:26.708 6187-6221/? D/GenericAdPlugin﹕ createBanner: xxx, true 11-24 15:21:26.708 6187-6187/? D/GenericAdPlugin﹕ cordova-android 4.0+, webview in framelayout 11-24 15:21:26.718 6187-6221/? D/GenericAdPlugin﹕ showBanner 11-24 15:21:26.738 6187-6187/? D/GenericAdPlugin﹕ webview class: class org.apache.cordova.engine.SystemWebView 11-24 15:21:26.738 6187-6187/? W/GenericAdPlugin﹕ show banner, overlap:true, position: 2

My app runs normally, but I can see no Ad popping up.

matrixreal commented 8 years ago

any news ? ineterstitials and banner are not working on android !!!