getTrackingStatus static method
This method retrieves the tracking status.
It is a static method that returns a Future containing the TrackingStatus enum.
If the platform is iOS, it invokes a native method to get the tracking status
If the platform is not iOS, it returns TrackingStatus.denied
this logic came fro align Flutter SDK to iOS native.
iOS native enum values are: notDetermined, restricted, denied, authorized since Flutter SDK is aligned to iOS native, we are using the same enum values that are passed to ML.
Returns TrackingStatus
representing the current tracking status.
Implementation
static Future<TBLTrackingStatus> getTrackingStatus() async {
if (Platform.isIOS) {
int trackingStatus =
await _nativeChannel.invokeMethod(GET_TRACKING_AUTHORIZATION_STATUS);
return TBLTrackingStatus.values[trackingStatus];
} else {
return TBLTrackingStatus.denied;
}
}