getSystemAccuracyAuthorization method

Future<AMapAccuracyAuthorization> getSystemAccuracyAuthorization()

适配iOS 14定位新特性,只在iOS平台有效

Implementation

Future<AMapAccuracyAuthorization> getSystemAccuracyAuthorization() async {
  int result = -1;
  if (Platform.isIOS) result = await _methodChannel.invokeMethod("getSystemAccuracyAuthorization", {'pluginKey': _pluginKey});
  if (result == 0) {
    return AMapAccuracyAuthorization.AMapAccuracyAuthorizationFullAccuracy;
  } else if (result == 1) {
    return AMapAccuracyAuthorization.AMapAccuracyAuthorizationReducedAccuracy;
  }
  return AMapAccuracyAuthorization.AMapAccuracyAuthorizationInvalid;
}