I keep getting this error:
> TypeScript error: Property 'app' does not exist on type 'Navigator'
while using this code:
navigator.app.exitApp();
I have the following plugins:
> <plugin name="cordova-plugin-device" spec="~1.1.2"/>
> <plugin name="cordova-plugin-console" spec="~1.0.3"/>
> <plugin name="cordova-plugin-whitelist" spec="~1.2.2"/>
> <plugin name="cordova-plugin-splashscreen" spec="~3.2.2"/>
> <plugin name="cordova-plugin-statusbar" spec="~2.1.3"/>
> <plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
What might be wrong with my code?
Just add an app property to the Navigator interface
interface Navigator {
app: {
exitApp: () => any; // Or whatever is the type of the exitApp function
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With