How to run a process even if the iOS application is closed IONIC

IONIC vs 3.4.0

I want to keep running a get request even if the application is closed
Please provide me the solution .

1 Like

For android you can use this plugin to keep the application running in the background :

That way even if the user closes the application it is still running.

Thanks for reply, But my application is iOS. Can you pls suggest for iOS as well?

Try using this plugin on ios. In my app I used location service and had ‘while in use’ permissions but when I closed the app (gone to home page not closed entirely) I still saw the location icon at the top so i guess the app was running.

Try reading this:

Can you pls provide me ionic sample code from which I can get idea how to implement etc.

In my app.component.ts instead of calling this.platform.exitApp();
I call navigator.Backbutton.goHome( () =>{}, () => { });
And then use platform.resume.subscribe(); to write what ever I want my app to do after it is returned from the background (resumed).

@neomib If you understand, my requirement is that I want to keep sending geolocation after every 5 min, for this I call a method in interval function with interval of 5 min. But when user close the application (not in background) it stops. So please suggest me how I can achieve this . Got any example?