Is there any way to call applicationWillTerminate in jsb?


or alternative way to stop the app, when some critical error occurred, such as “update failed”


cc.Director.end() does not run correctly?


not exactly, the comment indicates
/*** Ends the execution, releases the running scene.
It doesn’t remove the OpenGL view from its parent. You have to do it manually.

when I tried calling this end() from js, the logic loop was stopped and left me a black screen…
WenHai Lin wrote:

cc.Director.end() does not run correctly?


Did you want to exit your program when errors were triggered?
If so, you probably needs to bind a function which invoke exit(0); to JS.


Maybe we just wanna exit our program when press “exit” button or “return” keypad.