项目接入第三方SDK(XY助手)后,按home键切换进程回来后,游戏场景pause了。
打断点发现是applicationWillEnterForeground监听回调中的判定glview == currentView不正确导致。
第三方SDK有自由的内置界面。所以想问一下如何处理。
- (void)applicationWillEnterForeground:(UIApplication )application {
/
Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
/
auto glview = (__bridge CCEAGLView)(Director::getInstance()->getOpenGLView()->getEAGLView());
auto currentView = [[[[UIApplication sharedApplication] keyWindow] subviews] lastObject];
if (glview == currentView) {
cocos2d::Application::getInstance()->applicationWillEnterForeground();
}
}