I need my app to repeatedly execute sendLocation function in the background.
App.tsx
import React from 'react';import { IonApp } from '@ionic/react';import { sendLocation } from './Util/location'const App: React.FC = () => ( <IonApp> {setInterval(() => sendLocation(), 2000)}</IonApp>);export default App;
I tried this but I couldn't apply it to react:https://www.techiediaries.com/ionic-background-mode/