FBNativeAd和nativeAdViewWithNativeAd返回大小为CGZero的帧

时间:2015-12-09 16:14:41

标签: facebook facebook-ios-sdk

我正在尝试使用Facebook SDK在我的应用中显示原生广告。

然而,似乎返回了尺寸为CGZero的框架。

- (void)showNativeAd
{
    [FBAdSettings addTestDevice:@"123"];

    FBNativeAd *nativeAd = [[FBNativeAd alloc] initWithPlacementID:@"456"];
    nativeAd.delegate = self;

    [nativeAd loadAd];
}

- (void)nativeAdDidLoad:(FBNativeAd *)nativeAd
{
    UIView *adView;

    if(self.useSmallView){

        adView = [FBNativeAdView nativeAdViewWithNativeAd:nativeAd
                                                 withType:FBNativeAdViewTypeGenericHeight100];

    }else{

        adView = [FBNativeAdView nativeAdViewWithNativeAd:nativeAd
                                                 withType:FBNativeAdViewTypeGenericHeight300];
    }

    [nativeAd registerViewForInteraction:adView withViewController:self];

    [self.view addSubview:adView];
}

返回

<FBAdGenericHeight100View: 0x13df70e20; frame = (0 0; 0 0); layer = <CALayer: 0x13df6e6e0>>

0 个答案:

没有答案