onBeforeTerminate
Provides an opportunity to hook into the native shutdown process. This method is invoked if the user tries to terminate the app by sending the corresponding key code (e.g. on Mac: CMD+Q) or something similar. If you want to proceed with the default behavior of the native system, return false. If you want to abort the terminate or if you want to implement your own shutdown sequence return true and do the cleanup on your own.
Return
false to proceed with the default behavior, true to abort terminate.