Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ads not showing #78

Closed
gaboisleno opened this issue Jan 7, 2020 · 2 comments
Closed

Ads not showing #78

gaboisleno opened this issue Jan 7, 2020 · 2 comments

Comments

@gaboisleno
Copy link

gaboisleno commented Jan 7, 2020

Hello, I'm trying to use this module but I have the next issue either livesync or builded apk.
I created a banner using Nativescript 6.3.0, but is not showing spite of have no errors.

This my code (admob banner test: ca-app-pub-3940256099942544/6300978111)

var Admob = require("nativescript-admob");
    createBanner() {
        Admob.createBanner({
            testing: true,
            size: Admob.AD_SIZE.SMART_BANNER,
            androidBannerId: "ca-app-pub-3940256099942544/6300978111",
            margins: {
                bottom: 0
            },
        }).then(() => {
            console.log("admob createBanner done");
        }, error   => {
            console.log("admob createBanner error: " + error);
        });
    }

I added next lines in the mainfest.xml too (example value)

<!-- AdMobs -->
        <meta-data 
            android:name="com.google.android.gms.ads.APPLICATION_ID" 
            android:value="ca-app-pub-123123123123~AAAAAA" />

Finally, the console output shows me no problems

JS: Treating this deviceId as testdevice: 2E68431BAF1F006604E80289E704D105
chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
JS: admob createBanner done

But no bannes shows.
Could you please help me? Thanks a lot

@gaboisleno gaboisleno changed the title Ads not showing (Banner) Ads not showing Jan 9, 2020
@rmn81
Copy link
Contributor

rmn81 commented Jan 12, 2020

I also faced the same issue. This workaround worked for me. It might help you as well.

@gaboisleno
Copy link
Author

I also faced the same issue. This workaround worked for me. It might help you as well.

I fixed with a timer

timer.setTimeout(() => {
exports.createBanner();
}, 2000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants