Finished iOS implementation
MODIFY
geolocator/ios/Classes/Constants/ErrorCodes.h
geolocator/ios/Classes/Constants/ErrorCodes.h
@@ -11,3 +11,7 @@ FOUNDATION_EXPORT NSString * const GeolocatorErrorLocationSubscriptionActive;
FOUNDATION_EXPORT NSString * const GeolocatorErrorPermissionDefinitionsNotFound;
FOUNDATION_EXPORT NSString * const GeolocatorErrorPermissionDenied;
FOUNDATION_EXPORT NSString * const GeolocatorErrorPermissionRequestInProgress;
+FOUNDATION_EXPORT NSString * const GeolocatorErrorTemporaryAccuracyDictionaryNotFound;
+FOUNDATION_EXPORT NSString * const GeolocatorErrorPreciseAccuracyEnabled;
+FOUNDATION_EXPORT NSString * const GeolocatorErrorApproximateLocationNotSupported;
+

MODIFY
geolocator/ios/Classes/Constants/ErrorCodes.m
geolocator/ios/Classes/Constants/ErrorCodes.m
@@ -13,3 +13,6 @@ NSString * const GeolocatorErrorLocationSubscriptionActive = @"LOCATION_SUBSCRIP
NSString * const GeolocatorErrorPermissionDefinitionsNotFound = @"PERMISSION_DEFINITIONS_NOT_FOUND";
NSString * const GeolocatorErrorPermissionDenied = @"PERMISSION_DENIED";
NSString * const GeolocatorErrorPermissionRequestInProgress = @"PERMISSION_REQUEST_IN_PROGRESS";
+NSString * const GeolocatorErrorTemporaryAccuracyDictionaryNotFound = @"ACCURACY_DICTIONARY_NOT_FOUND";
+NSString * const GeolocatorErrorPreciseAccuracyEnabled = @"PRECISE_ACCURACY_ENABLED";
+NSString * const GeolocatorErrorApproximateLocationNotSupported = @"APPROXIMATE_LOCATION_NOT_SUPPORTED";

MODIFY
geolocator/ios/Classes/GeolocatorPlugin.m
geolocator/ios/Classes/GeolocatorPlugin.m
} else if([@"getLocationAccuracy" isEqualToString:call.method]) {
LocationAccuracyHandler *locationAccuracyHandler = [[LocationAccuracyHandler alloc] init];
[locationAccuracyHandler getLocationAccuracyWithResult:result];
+ } else if([@"requestTemporaryFullAccuracy" isEqualToString:call.method]) {
+ LocationAccuracyHandler *locationAccuracyHandler = [[LocationAccuracyHandler alloc] init];
+ [locationAccuracyHandler requestTemporaryFullAccuracyWithResult:result];
} else if ([@"openAppSettings" isEqualToString:call.method]) {
[self openSettings:result];
} else if ([@"openLocationSettings" isEqualToString:call.method]) {

MODIFY
geolocator/ios/Classes/Handlers/LocationAccuracyHandler.h
geolocator/ios/Classes/Handlers/LocationAccuracyHandler.h
@@ -18,6 +18,7 @@ typedef enum {
@interface LocationAccuracyHandler : NSObject
- (void) getLocationAccuracyWithResult:(FlutterResult)result;
+- (void) requestTemporaryFullAccuracyWithResult:(FlutterResult)result;
@end

MODIFY
geolocator/ios/Classes/Handlers/LocationAccuracyHandler.m
geolocator/ios/Classes/Handlers/LocationAccuracyHandler.m
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "LocationAccuracyHandler.h"
+#import "ErrorCodes.h"
@implementation LocationAccuracyHandler
}
}
+- (void) requestTemporaryFullAccuracyWithResult:(FlutterResult)result {
+ NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init];
+ if ([dictionary objectForKey:@"TemporaryPreciseAccuracy"]) {
+ return result([FlutterError errorWithCode:GeolocatorErrorTemporaryAccuracyDictionaryNotFound
+ message:@"The temporary accuracy dictionary key is not set in the infop.list"
+ details:nil]);
+ }
+ CLLocationManager *locationManager = [[CLLocationManager alloc] init];
+ if (@available(iOS 14.0, *)) {
+ switch ([locationManager accuracyAuthorization]) {
+ case CLAccuracyAuthorizationReducedAccuracy: {
+ [locationManager requestTemporaryFullAccuracyAuthorizationWithPurposeKey:@"TemporaryPreciseAccuracy"
+ completion:^(NSError *error) {
+ if (error != nil) {
+ return;
+ } else {
+ // This error should never be thrown, since all the error cases are covered
+ return result([FlutterError errorWithCode:[[NSNumber numberWithInteger:error.code] stringValue]
+ message:error.description
+ details:nil]);
+ }
+ }];
+ return;
+ }
+ case CLAccuracyAuthorizationFullAccuracy:
+ return result([FlutterError errorWithCode:GeolocatorErrorPreciseAccuracyEnabled
+ message:@"Precise Location Accuracy is already enabled"
+ details:nil]);
+ }
+ } else {
+ return result([FlutterError errorWithCode:GeolocatorErrorApproximateLocationNotSupported
+ message:@"iOS 13 and below does not support requesting temporary full accuracy"
+ details:nil]);
+ }
+}
+
@end

Finished iOS implementation