How to show or hide ads in UWP (AdControl) from within Unity

I can successfully show banner ads within Visual Studio and I have a few games that I make, well, pennies off of. Unfortunately, these ads are visible constantly (which I know is extremely annoying). What I would like to do is choose within Unity when the ad should appear. So, for example, if the user starts a new level or wants to continue on to the next level.

I have searched for examples of how to do this but can’t seem to find anything that might walk me through it. I thought that a few years ago there was an example with a walkthrough of what code to add into Visual Studio as well as what is needed in Unity, but I can’t seem to find it again.

I am using the basic AdControl (not AdMediator) and plan to attempt to use some of the newer video ads if I can get this working.

Any help pointing me in the right direction would be amazingly helpful.

Thanks!
Nick

The easiest way would be having a delegate in one of your scripts and assigning a callback to it from main app. Just take care of the threading, as Unity is not running on UI thread.
You can see such code setup in our XAML Unity Connection example, found here:
https://bitbucket.org/Unity-Technologies/windowsstoreappssamples

Thank you Aurimas Cernius, I will see if I can make this work and I will let you know how it goes!

Have a look here as well.