I'm using the nativescript firebase package which includes Admob. When testing in Android, I have my androidInterstitalId
set to a test ID that is listed here by Google: https://developers.google.com/admob/android/test-ads . I also have testing
flag set to true
. This all works as expected. When I prep it production, I put in the value of my real interstital ad, set the testing
flag to false
and I made sure my AndroidManifest.xml
has the following code:
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-(MY ID)"/>
My app went live on production and the ad does not play. The interstitial video was created days ago so it's not new. Below is my code but I assume it's not the code since it's working locally -- just not on production.
mounted() {
setTimeout(() => {
this.showBanner();
}, 2000);
},
methods: {
showBanner: function() {
firebase.admob.preloadInterstitial({
iosInterstitialId: "ca-app-pub-----",
androidInterstitialId: "ca-app-pub-(MY ID)",
testing: false,
iosTestDeviceIds: [],
onClosed: () => console.log("Interstitial closed"),
onClicked: () => console.log("Interstitial clicked"),
onOpened: () => console.log("Interstitial opened"),
onLeftApplication: () => console.log("Interstitial left application")
}).then(() => {
firebase.admob.showInterstitial().then(
function () {
console.log("AdMob interstitial showing.");
},
function (errorMessage) {
dialogs.alert({
title: "AdMob error",
message: errorMessage,
okButtonText: "Hmmkay"
});
}
);
})
},
}