Open toreinkun opened 6 years ago
It's not meant to exit app.
It releases all resources (scene, nodes, opengl context).
You'll need to use something more forceful like posix exit(0)
.
However, note that most, if not all apps, shouldn't actually force quit like this. You don't really need to call or use Director::end yourself in iOS.
[HelloWorldScene.cpp] (https://github.com/cocos2d/cocos2d-x/blob/v3/tests/cpp-empty-test/Classes/HelloWorldScene.cpp)
void HelloWorld::menuCloseCallback(Ref* sender)
{
Director::getInstance()->end();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
exit(0);
#endif
}
As @summerinsects said, that is the solution. so close this issue.
Let me just reiterate that exit(0)
is not meant to be used in an iOS app. It will likely fail in App Review if my experience of getting rejected for it would occur for anyone else.
If user declines privacy policy then exit(0)
is ok for iOS?
@Dimon4eg not sure whether you meant ok or "not" ok? nor why privacy policy would matter.
I did appeal an app review and was able to get the app into the store while having an exit(0) to fully purge it from the system since it runs in the background.
@stevetranby I mean the next flow: user installs game, launches it, at start game displays "Privacy Policy" dialog to accept it by user (for GDPR). Dialog has two buttons: "Accept" and "Quit". If user presses "Quit" I do exit(0)
.
@drelaptop I think you can close this issue as solution is found here by @summerinsects :+1:
it is only let the app become black screen.