How check if a device have connection when it's starting (and close app if not)

Have you tried cordova-plugin-network-information.
I have another page, but it is in Angular 1. See if you can extract something.

For closing app, look at this question.
I think this.platform.exitApp() should work. But some say its not working for them.