Use Amazon Location Service SDK
If you need functionality in the AWSLocation framework used by the Amplify Geo category that isn't available, we provide an escape hatch so you can reference it directly.
Note: If you provisioned your Geo resources via Amplify CLI, then the IAM policy will be specifically scoped to only allow actions required by the library. Please adjust your authorization permissions accordingly for your escape hatch use-cases.
1import AWSLocation
Then retrieve the escape hatch and call methods on AWSLocation
directly:
1do {2 // Retrieve AWSLocationGeoPlugin3 let plugin = try Amplify.Geo.getPlugin(for: "awsLocationGeoPlugin")4 guard let locationPlugin = plugin as? AWSLocationGeoPlugin else {5 return6 }7
8 // Retrieve reference to AWSLocation9 let awsLocation = locationPlugin.getEscapeHatch()10
11 // Make Request12 var request = ListMapsInput()13 request.maxResults = 514 let response = try await awsLocation.listMaps(input: request)15 // handle response ...16} catch {17 print("Error occurred while fetching the escape hatch \(error)")18}
Documentation Resources
Maps
Places
Device Tracking