-
Notifications
You must be signed in to change notification settings - Fork 26
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
Angular 2 Router Overlaps Ads #15
Comments
Hi, I think the solution would be to define the banner in xml/html as opposed to JS/TS (like I've done for the nativescript-mapbox plugin), but I haven't found the time to add that feature to this plugin. |
Agreed.. That would lead to better UX as well as better ad performance..it will also make it possible to show ads in specific locations as I mentioned in this issue here Hope you get the time soon. :) |
Is there any temporary way to over come this issue? Perhaps fiddling with some z-index property (No idea id there is any such thing just shooting in the dark here). So far from what I have read on the web and from my personal experience Admob does penalize in terms of revenue if ads are not implemented properly. So having a banner ad that disappears after one click is not something that would sit well with AdMob. |
Another thing that I want to mention is that the issue mentioned only shows up when using 😄 |
+1 |
Guys, just to comment I workaround the problem by using a listener on the router to hide/recreate the banner:
|
@ignaciolarranaga that works well! Thanks! |
I also have this issue with the ad not showing up after page navigation, but I don't think my issue is related to overlapping views. I have done quite a bit of debugging but still haven't found a solution yet. What I tried so far: (2) modified the plugin to return a promise of adView from the nativescript-admob createBanner function, so I can do additional debugging. (2a) created a StackLayout and tried to replace contents in the StackLayout, but no luck here since the adView returned is a non nativescript UI widget.
(2b) Right now, I am messing around with the rootViewController to try and addSubview. (e.g.)
Once again, it only works during app install. I am messing around with rootViewControllers.childViewControllers right now, but addSubview doesn't seem to work with the UIView inside. Much appreciated if anyone can point me in the right direction. @EddyVerbruggen would you be able to help? |
Hello @EddyVerbruggen , any luck resolving this problem? This is proving difficult to resolve for nativescript newbies like me. |
Hey everyone. There's one thing you can do to make it work. For now it works only on Android, I'm trying to make it work on iOS as well. First of all, you need to modify Then you need to modify your
this
next, you need to create xml page pointed by
Now you can easily switch between pages, and banner will remain where it should :) I hope it will help! |
Hey there eddy,
I am using TNS with ng2. I have the plugin working and showing ads on load. I have set up a repo here of my code.
Observation
Here is what I have encountered. In my app I have a
<page-router-outlet>
that uses the router configuration to show relevant pages.The banner ad shows up when the app loads as I am calling the
admob.createBanner
in the constructor of the home page.But as soon as I navigate to another page the ad is overlapped by the new page which was navigated to. Not only that going back to the page where ad was visible, the ad no longer shows up.
I see flashes of the banner ad when navigating between routes.
Seems like when the router is used It loads everything on top of the ad.
I have checked the above on Android 5.1 device and Android 4.4 emulator.
Let me know what is to be done here.
-Thanks
The text was updated successfully, but these errors were encountered: