cocos1.7 IOS cc.game.EVENT_SHOW未执行BUG

D/AudioEngine-inl.mm (172): UIApplicationWillResignActiveNotification
JS: [WARN]: --------->game hide
2017-12-29 17:27:18.954551+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
2017-12-29 17:27:22.683852+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
D/AudioEngine-inl.mm (182): UIApplicationDidBecomeActiveNotification
D/AudioEngine-inl.mm (172): UIApplicationWillResignActiveNotification
JS: [WARN]: --------->game hide
2017-12-29 17:31:37.203327+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
2017-12-29 17:31:38.627943+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
D/AudioEngine-inl.mm (182): UIApplicationDidBecomeActiveNotification
D/AudioEngine-inl.mm (172): UIApplicationWillResignActiveNotification
JS: [WARN]: --------->game hide
2017-12-29 17:31:53.373778+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
2017-12-29 17:31:54.755996+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
D/AudioEngine-inl.mm (182): UIApplicationDidBecomeActiveNotification

上面是切换时,xcode 打印输出
hide调用, show未调用, 游戏内无法操作

1.7 从后台显示到前台,glview与currentView不相等,applicationWillEnterForeground未执行.
cc.game.EVENT_SHOW 事件没有调用

我写了个demo输出,xcode 打印输出:
JS: [WARN]: --------->game hide
2017-12-29 17:31:53.373778+0800 planewar-mobile[55417:1347123] error: CocosAnalytics ==> Please init SDK first!
JS: [WARN]: --------->game show

为什么相同的代码打印的不一样?求解答

求关注,有需要可以提供demo

cc.game.EVENT_HIDE和cc.game.EVENT_SHOW,这两个事件不是100%能保证触发的。
具体可以看这个帖子:cc.game.EVENT_HIDE和cc.game.EVENT_SHOW问题修正思路

@jare说,安卓和iOS是可以确保被调用的。先确定下是不是1.7引擎有问题

没有人来看下吗@jare @dumganhar

这个还是没有人回覆吗?

我有相关问题…
http://forum.cocos.com/t/1-8-1-cc-game-event-hide-event-show/55909

手动置顶。。:heart_eyes:

1.10.3沒這個問題,昇級吧…

什么的版本啊?1.10.3?

https://forum.cocos.com/t/cocoscreator-1-10-3-20190121/72671

那个。。我是1.9.0的。。。

  • (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();
    // }
    if (CAAgent.isInited) {
    [CAAgent onResume];
    }
    }