How do I hide FB Audience Network banner?

I am trying to implement Audience Network ads using FB SDK, but I am running into a problem - how do I hide the AdView?

The only function that seems to be able to do that is Dispose(), but I’m not sure if it’s a good idea to dispose the view every time I want to hide it and then create a new one and request a new ad when I want to show it…

Having a group of ads, that would be shown one by one and disposed when supposed to be hidden also seems weird to me.

I tried googling for this, but there is nothing. Is anyone familiar with any “best practice” to reach similar behaviour to Admob Show()/Hide() functions?

this is already an old post, therefore i think you have already sloved this.
but if someone else has the same problem, here a simple solution for that.

  1. Create a prefab with the advertising script.

  2. load the resource on awake.

  3. Instantiate the prefab on show methode.

  4. to hide destroy the game object.

    private GameObject _advertising;
    private GameObject _activeAdvertising;
        
    void Awake()
    {
        advertising = Resources.Load("Prefab/Game/Advertising") as GameObject;
    }
        
    private void ShowAdvertisingBanner()
    {
          _activeAdvertising = Instantiate(_advertising);
          _activeAdvertising.transform.parent = gameObject.transform;
    }
    
    private void DestroyAdvertisingBanner()
    {
        if(_activeAdvertising != null)
            Destroy(_activeAdvertising);
    }