gpt4 book ai didi

iphone - applicationWillTermminate 正常退出与广告退出 iPhone 问题

转载 作者:行者123 更新时间:2023-12-03 21:13:04 24 4
gpt4 key购买 nike

是否可以确定应用程序何时关闭,是通过正常方式(主页按钮)还是因为点击广告(本例中的 admob 广告)来完成...Admob 没有任何可以帮助完成的操作这个目标呢?任何从哪里开始的想法将不胜感激......

最佳答案

如果没有其他/更好的方法可用,请将 UIView 放在广告区域上,检测对其的触摸,做笔记,然后将其传递给下一个响应者(即广告的 View )。

换句话说,您需要一个可以调用的方法来告诉您 admob 已被单击,以及 UIView 的子类(位于 admod View 的正上方),它具有以下 TouchBegan:

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

关于iphone - applicationWillTermminate 正常退出与广告退出 iPhone 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1604990/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com