App, BackgroundTask Ionic 4

#1

Greetings,

I am trying to make the App and BackgroundTask plugins work in an Ionic application but I can not get it.
The webPlugins work but I do not understand how to make the App.exitApp() work, throws an “App does not have web implementation” error.

Can someone illustrate me?
I attach my code of a page in Ionic

import { Component, OnInit } from '@angular/core';
import { Plugins } from '@capacitor/core';
const { App, BackgroundTask } = Plugins;
@Component({
	selector: 'app-page',
	templateUrl: './page.html',
})
export class Page implements OnInit {

	constructor() { }

	ngOnInit() {}

	test() {
		Plugins.App.exitApp()
		// App.exitApp()
	}
}
0 Likes