Page updated Jan 16, 2024

Use Amazon Location Service SDK

Amplify iOS v1 is now in Maintenance Mode until May 31st, 2024. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v1.

Please use the latest version (v2) of Amplify Library for Swift to get started.

If you are currently using v1, follow these instructions to upgrade to v2.

Amplify libraries should be used for all new cloud connected applications. If you are currently using the AWS Mobile SDK for iOS, you can access the documentation here.

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 AWSLocationXCF
1import AWSLocation

Then retrieve the escape hatch and call methods on AWSLocation directly:

1do {
2 // Retrieve AWSLocationGeoPlugin
3 let plugin = try Amplify.Geo.getPlugin(for: "awsLocationGeoPlugin")
4 guard let locationPlugin = plugin as? AWSLocationGeoPlugin else {
5 return
6 }
7
8 // Retrieve reference to AWSLocation
9 let awsLocation = locationPlugin.getEscapeHatch()
10
11 // Make Request
12 let request = AWSLocationListMapsRequest()!
13 request.maxResults = 5
14 awsLocation.listMaps(request) { response, error in
15 // handle response ...
16 }
17} catch {
18 print("Error occurred while fetching the escape hatch \(error)")
19}

Documentation Resources

Maps

Places

Device Tracking