Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Need help with Facebook Audience Network banner position

Discussion in 'Editor & General Support' started by pixel375, Dec 10, 2018.

  1. pixel375

    pixel375

    Joined:
    Dec 2, 2018
    Posts:
    9
    Hey everyone,
    I recently set up FAN for my Android game, I used Facebooks example code, but I can't figure out the positioning for the banner ad..

    With the following code, the banner is placed at 100 pixels down from the top of the screen, but I need the banner in the bottom..
    Code (CSharp):
    1. this.adView = new AdView("*******_******", AdSize.BANNER_HEIGHT_50);
    2.  
    3.         this.adView.Register(this.gameObject);
    4.         this.currentAdViewPosition = AdPosition.BOTTOM;
    5.  
    6.         this.adView.AdViewDidLoad = (delegate() {
    7.             this.currentScreenOrientation = Screen.orientation;
    8.             Debug.Log("Banner loaded.");
    9.             this.adView.Show(100);
    10.         });
    So I tried changing this.adView.Show(100); to this.adView.Show(AdPosition.BOTTOM);
    But then I get no banner at all.
    Asking in the Facebook Developers facebook group is pointless, nobody ever replies.

    Any help would be great
     
    Last edited: Dec 10, 2018
    Yuneza likes this.
  2. pixel375

    pixel375

    Joined:
    Dec 2, 2018
    Posts:
    9
    Nevermind. Got it at last.

    Code (CSharp):
    1. this.adView.Register(this.gameObject);
    2.  
    3.         this.adView.AdViewDidLoad = (delegate() {
    4.             Debug.Log("Banner loaded.");
    5.             double height = AudienceNetwork.Utility.AdUtility.convert(Screen.height);
    6.             this.adView.Show(height - 50);
    7.         });
     
    Yuneza likes this.
  3. Yuneza

    Yuneza

    Joined:
    Feb 1, 2015
    Posts:
    3
    Can you share the complete script please? I am having the same issue....