I am working on react native project where I need to track user location in background and killed state. So, I am wondering Is there anyway to tracking location when app is in the background or in killed state?
I am working on react native project where I need to track user location in background and killed state. So, I am wondering Is there anyway to tracking location when app is in the background or in killed state?
I have written an article about this.
HMS Location Kit: Running services continuously when app is in the background or killed state in React Native.
https://forums.developer.huawei.com/forumPortal/en/topic/0203451392193540113
In this tutorial, sample project also is given for better illustration.
Please note:
To receive updates we need to register headless tasks you will add registerFusedLocationHeadlessTask(), registerActivityConversionHeadlessTask(), registerActivityIdentificationHeadlessTask(), and registerGeofenceHeadlessTask() functions in index.js file.