Closed RoyiNamir closed 6 years ago
I've applied the fix you proposed to check for existence of those properties. See #36.
@EddyVerbruggen Hi.
If you want , It should be added also in the Hidebanner function.
admob.hideBanner = function (arg) {
return new Promise(function (resolve, reject) {
try {
if (admob.adView != null) {
var parent = admob && admob.adView && admob.adView.getParent(); //<------
/* And also - removed one "=" becuase it's undefined ,
so we DO want to compare null to undefined .
It was before `!==` and nul !==undefined so it tried to [do this](https://i.imgur.com/7Qxnarj.jpg)
*/
if (parent != null) { // <-------
parent.removeView(admob.adView);
}
admob.adView = null;
}
resolve();
} catch (ex) {
console.log("Error in admob.hideBanner: " + ex);
reject(ex);
}
});
};
In my app ( also in the code itself) - we use timeout - to show the ad.
However - i've noticed a rare scenario where If I navigate (angular) to a screen which in its ngOninit has this :
Overview
button ( android's most right screen button) within that 3 seconds - then I get this :It's probably becuase it can't find anything to put the banner on.
Is there a check that can be made in our code - not to cause exception ?