You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In debug mode, the banner appears fine on the screen. When i set the "testing" boolean to false, the banner don't appear anymore. Sometimes if i tap the banner area frantically, it may appear...
I tried the demo code and it works just fine.
I really can't figure why it doesn't work while not in testing mode.
My component code:
Home.component.ts:
import{Component,OnInit,NgZone,AfterViewInit}from"@angular/core";import*asdialogsfrom"tns-core-modules/ui/dialogs";import{Trip}from"../shared/trip";import{Folder,File,path}from"tns-core-modules/file-system";import*asToastfrom"nativescript-toast";import*asAdmobfrom"nativescript-admob";import{isIOS}from"tns-core-modules/platform";declarevar android: any;varSqlite=require("nativescript-sqlite");
@Component({selector: "Home",moduleId: module.id,templateUrl: "./home.component.html",styleUrls: ["home.component.scss"]})exportclassHomeComponentimplementsOnInit,AfterViewInit{privatetesting: boolean=false;privateandroidBannerId: string="ca-app-pub-4388645964603052/7349200111";privateiosBannerId: string="ca-app-pub-4388645964603052/5489054038";privateBannerIdTest: string="ca-app-pub-3940256099942544/6300978111";privatedatabase: any;publictrips: Array<Trip>;publicisOnTrip: boolean=false;privatestartDate: Date;privatestopDate: Date;constructor(private_ngZone: NgZone){}ngOnInit(): void{this.databaseFetch();}ngAfterViewInit(): void{// console.log("ngAfterViewInit");setTimeout(()=>{this.createBanner();},1500);}
...
publiccreateBanner(){Admob.createBanner({testing: this.testing,size: Admob.AD_SIZE.SMART_BANNER,androidBannerId: this.testing
? this.BannerIdTest// global test banner id
: this.androidBannerId,// our registered banner id// Android automatically adds the connected device as test device with testing:true, iOS does notiosBannerId: this.iosBannerId,// iosTestDeviceIds: ["yourTestDeviceUDIDs", "canBeAddedHere"],margins: {bottom: isIOS ? 50 : 0},keywords: ["travel","time"]}).then(function(){// console.log("admob createBanner done");},function(error){// console.log("admob createBanner error: " + error);});}}
Hi all,
In debug mode, the banner appears fine on the screen. When i set the "testing" boolean to false, the banner don't appear anymore. Sometimes if i tap the banner area frantically, it may appear...
I tried the demo code and it works just fine.
I really can't figure why it doesn't work while not in testing mode.
My component code:
Home.component.ts:
home.component.html:
home.component.scss:
Any idea?
Regards,
Tristan
The text was updated successfully, but these errors were encountered: