- Home /
Keep app running in background for GPS tracking on iOS and Android?
I'm working on a project that involves tracking the user's position while a certain function is active. Is it possible to register for background GPS access from a Unity app? I know this is possible on both operating systems, I'm specifically looking for information on how to do it with a Unity app. I'm currently using Unity 5 Personal, but have a Unity 4 Pro license with iOS and Android Pro as well if that helps at all.
Hi mire! You were able to fix this? I have the same question!
Ha, well yes and no. I figured out that I'd need to write a native plugin for each platform I want background GPS on. I got it working on iOS, but was never able to get it working on Android. I did find similar things written for other frameworks like Cordova, but couldn't find one for Unity. That may have changed since I stopped looking, of course. For my app's case, it ended up being better to rewrite native versions, as I was also seeing big battery life issues on Android, and didn't need any of Unity's 3D power.
Answer by kevinrocks_786 · Nov 22, 2015 at 05:52 PM
This should be able to help you out :) http://docs.unity3d.com/ScriptReference/Application-runInBackground.html
No, it won't. The "Run in Background" setting only relates to standalone and web player builds. The OP is asking about an Android app.
Answer by olegekbondar · May 02, 2017 at 01:30 PM
Please check here: http://www.devhelp.me/unity-background-location-service-step-by-step/
the link, unfortunately is down... any other suggestions? thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220613193904im_/https://answers.unity.com/themes/thub/images/avi.jpg)