How to Update location when app is closed

We are building app and we want to get user location every 10 section in all situation either app is close or app is in foreground or background, Our main motive to update user location to every 10 sec at server. but i want to plugin which work when app is close or open or background.
In android native app jobschedular work , but in ionic i didnot get solution yet.
Please reply as soon as possible