2009-10-22 67 views
2

是否有可能確定應用程序關閉時是通過常規方式完成(主頁按鈕)還是因爲廣告被點擊(本例中的admob廣告)...... Admob doesn沒有什麼能夠幫助實現這個目標嗎?任何想法從哪裏開始將不勝感激...applicationWillTerminate正常退出與廣告退出iPhone問題

+2

已經報道了這個問題的多個重複。 *不*重新發布;如果您需要澄清,請編輯* this *問題。 – 2009-10-23 15:49:51

回答

2

如果沒有其他/更好的方法可用,將UIView放在廣告區域,檢測觸摸,做一個筆記,然後將其傳遞給下一個響應者是廣告的觀點)。

換句話說,你需要一個方法,你可以打電話告訴你單擊的AdMob和UIView的,這是對在admod視圖定位的一個子類,它具有以下的touchesBegan:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 
    // you may want to do some extra work here to detect whether the touch is a 
    // touchUp in the view, vs. a touchUpOutside which is not the same. It all 
    // depends on how admob treats touches. If it immediately quits your app on 
    // touchdown, then you call your method immediately. If admob waits to see 
    // if there is a touchUp in its view, then you need to detect the same and 
    // call your method after that. Play around to see what you need to mimic. 

    [self adViewHasBeenTouched]; 

    // The following is needed to let admob get the touch, after you are done 
    // with your method. 

    [self.nextResponder touchesBegan:touches withEvent:event]; 
} 
+0

你有沒有我如何使用admobs sdk完成這個任務的例子? – charlie 2009-10-23 20:31:21

+0

我沒有用過admob。這種方法不需要admob。你製作了一個駐留在admob區域的視圖。這個觀點將不得不處理我所展示的觸覺,然後將觸摸傳遞給下一個響應者,以便admob獲得它的觸覺。 – mahboudz 2009-10-24 04:36:40