ApplicationWillTerminate normal exit vs ad exit iPhone question

Is it possible to tell when the app exits, whether it is done in the normal way (home button) or because an ad was clicked (admob ad for this example) ... Is there nothing in Admob to help accomplish this goal? Any ideas on where to start would be greatly appreciated ...

+2


source to share


1 answer


If there is no other / better means available, place a UIView over the ad area, detect touches on it, take a note, then pass it to the next responder (this is an ad).

In other words, you need a method that you can call to tell you that an admob has been added, and a UIView subclass that sits right above the admod view that has the following Began touches:



- (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];
}

      

+2


source







All Articles