Background Tracking
To achieve background tracking you will need to follow a few steps
- First call
requestWhenInUseAuthorization()
from theNaurtLocationManager
class. Even if your already have this permission, call it fromNaurtLocationManager
, so that Naurt can manage permissions effectively. - Later in the app lifecycle, call
requestAlwaysAuthorization()
of theNaurtLocationManager
. It's important to call this afterrequestWhenInUseAuthorization()
, since Apple does not allow requesting all background permissions at once.
Once more, if you only want to track when the app is active then you only need
to do step 1 and call requestWhenInUseAuthorization()
.
If the user denies location permissions to the app or parental controls have denied
location permissions to the app, then Naurt will enter the blocked
state.
In the blocked
state, all of Naurt's features will be disabled. You can
check if this is the case with the getIsBlocked()
method.
If the user does deny permissions, you are allowed to inform them that there are additional features availabloe and direct them to the settings where they can give more permissions.