没有呈现FBNativeAdView - Swift

时间:2015-11-11 10:42:14

标签: ios swift facebook-audience-network

我试图提供Facebook原生广告模板,没有运气。

class ViewController: UIViewController, FBNativeAdDelegate
{
    override func viewDidLoad()
   {
        super.viewDidLoad()

        facebookAdViewContainer.backgroundColor = UIColor.greenColor()
        let nativeAd = FBNativeAd(placementID: <id>)
        nativeAd.delegate = self
        nativeAd.loadAd()
        ...
   }

   func nativeAdDidLoad(nativeAd: FBNativeAd) 
   {
       let attributes = FBNativeAdViewAttributes()
       attributes.backgroundColor = UIColor.blueColor()
       let adview = FBNativeAdView(nativeAd: nativeAd, withType:FBNativeAdViewType.GenericHeight300)//, withAttributes: attributes)
       adview.hidden = false
       self.topBannerViewContainer.addSubview(adview)
   }
...
}

正如您在图片中看到的那样,广告未展示。至少我希望看到广告的蓝色背景,但我能看到的只是容器的绿色背景

enter image description here

0 个答案:

没有答案
相关问题