2012-11-07 60 views
0

我正在使用AdMob的中介功能將iAds和AdMob廣告投放到我的iPhone應用程序。但是,我注意到某些AdMob廣告真的很惱人...iOS上的AdMob:禁用應用內AdMob網頁廣告?

某些AdMob廣告直接在我的應用程序內部,我的導航欄和選項卡欄之間打開網頁,並且顯示不正確。它們不像iAds那樣完全模式化,而是侵入我的應用程序空間(並且做錯了)。

有沒有方法可以挑選出這些AdMob廣告並禁用那些試圖在應用網頁中打開的廣告?我很喜歡打開AppStore或Safari的AdMob廣告。

下面,你可以看到前後發生了什麼。

Before

After

再次,這是煩人,因爲網絡成癮者的工作只是罰款,並像預期的那樣,接管整個屏幕模態。另一方面,AdMob對我的視圖層次結構中的位置做出了不正確的假設。我大概可以重新設計我的層次結構以「讓它工作」,但是imo,當前的層次結構已經很理想,而其他任何東西都會感覺受到攻擊。

如果我無法讓AdMob自行運作,我的備份計劃就是停用AdMob廣告。

回答

1

您是否正確設置BannerView的rootViewController?

下面是從viewDidLoad方法摘錄在我看來,一個控制器...

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // Create a view of the standard size at the bottom of the screen. 
    // Available AdSize constants are explained in GADAdSize.h. 
    _bannerView = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner]; 
    _bannerView.delegate = self; 

    // Specify the ad's "unit identifier." This is your AdMob Publisher ID. 
    _bannerView.adUnitID = ADMOB_PUBLISHER_ID; 

    // Let the runtime know which UIViewController to restore after taking 
    // the user wherever the ad goes and add it to the view hierarchy. 
    _bannerView.rootViewController = self; 

    // SNIP 
} 
+0

我目前設置bannerView.rootViewController自我。不過,我嘗試將它設置爲[UIApplication sharedApplication] .delegate.window.rootViewController,並且取得了不錯的成功...它修復了iOS 6之前的問題,但顛倒了iOS 6設備上的問題。現在,iAd將顯示在導航欄後面。 – MikeS

+0

此外,我遇到了另一個問題,其中iAds正在更改父視圖的框架大小,而不是在退出時重置它。 – MikeS