Use Amazon Location Service SDK
If you need functionality in the AWS services used by the Amplify Geo category that isn't available, we provide an escape hatch so you can get a reference to that service.
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 android.util.Log;2import com.amazonaws.services.geo.AmazonLocationClient;3import com.amazonaws.services.geo.model.ListMapsRequest;4import com.amazonaws.services.geo.model.ListMapsResult;5import com.amplifyframework.core.Amplify;6import com.amplifyframework.geo.location.AWSLocationGeoPlugin;
1// Obtain reference to the plugin2AWSLocationGeoPlugin geoPlugin = (AWSLocationGeoPlugin)3 Amplify.Geo.getPlugin("awsLocationGeoPlugin");4AmazonLocationClient locationClient = geoPlugin.getEscapeHatch();5
6// Send a new request to the Location Maps endpoint directly using the client7ListMapsRequest request = new ListMapsRequest();8ListMapsResult response = locationClient.listMaps(request);9Log.i("MyAmplifyApp", response.getEntries().toString());
1import android.util.Log2import com.amazonaws.services.geo.AmazonLocationClient3import com.amazonaws.services.geo.model.ListMapsRequest4import com.amplifyframework.core.Amplify
1// Obtain reference to the Amazon Location Service client2val geoPlugin = Amplify.Geo.getPlugin("awsLocationGeoPlugin")3val locationClient = geoPlugin.escapeHatch as AmazonLocationClient4
5// Send a new request to the Location Maps endpoint directly using the client6val request = ListMapsRequest()7val response = locationClient.listMaps(request)8Log.i("MyAmplifyApp", response.entries.toString())
Documentation Resources
Maps
Places
Device Tracking