Example of use in function onClose()
import { isIOS } from '@nativescript/core/platform';
//declaration of native functions
declare const android:any;
declare const exit: (code: number)=>void;
//Use for example in component
onClose() {
if (isIOS) {
exit(0);
} else {
android.os.Process.killProcess(android.os.Process.myPid());
}
}