2009-10-22 5 views
2

정상적인 방법 (홈 버튼)으로 완료되었거나 광고가 클릭 되었기 때문에 앱이 종료 될 때를 결정할 수 있습니까? (이 예에서는 admob ad ...) Admob doesn 이 목표를 성취하는 데 도움이 될만한 것이 있습니까? 어떤 아이디어를 어디서부터 시작해야하는지 크게 평가 될 것입니다 ...applicationWillTerminate 정상 종료 대 광고 종료 iPhone 질문

+2

: 즉

, 당신은 당신이 AdMob에서 클릭 한 당신에게 전화하고 다음 touchesBegan을 가지고 바로 admod를보기 위에 위치되어있는 UIView의 서브 클래스, 할 수있는 방법이 필요합니다 이 질문에 대한 여러 개의 중복이보고되었습니다. * 다시 게시하지 마십시오. 명확하게해야 할 경우 *이 * 질문을 수정하십시오. –

답변

2

사용할 수있는 다른 방법이 없다면 UI 영역을 광고 영역 위에 놓고 터치를 감지 한 다음 메모를 작성한 다음 응답자에게 전달합니다. 광고보기입니다.)

- (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

+0

나는 admob을 사용하지 않았다. 이 방법은 admob을 필요로하지 않습니다. admob의 영역 위에있는 뷰를 만듭니다. 그 견해는 내가 보여줄 때 터치를 다뤄야하고, 그 다음 반응자에게 터치를 전달해야한다. 그래서 admob은 터치를 얻는다. – mahboudz