- All Known Implementing Classes:
ArcGISSceneLayer
,ArcGISTiledLayer
,ArcGISVectorTiledLayer
,Basemap
,ClosestFacilityTask
,ExportTileCacheTask
,ExportVectorTilesTask
,GeodatabaseSyncTask
,LocatorTask
,RouteTask
,ServiceAreaTask
,ServiceFeatureTable
This interface will be used for getting and setting the API key generated from ArcGIS Developers website on objects where required.
- Since:
- 100.10.0
-
Method Summary
-
Method Details
-
getApiKey
String getApiKey()Gets the API key to access API key enabled services and resources in ArcGIS Online.An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items. You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege. To learn how to create and manage API keys, go to the Create an API Key tutorial. You must ensure that your API key has the correct privileges to access secure resources.
In addition to setting an API key at a global level for your application using
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callsetApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, in other words), enabling more granular usage telemetry and management for ArcGIS Online resources used by your app.Classes that expose an API key property by implementing APIKeyResource include:
- Returns:
- the API key to access API key enabled services and resources in ArcGIS Online
- Since:
- 100.10.0
- See Also:
-
setApiKey
Sets the API key to access API key enabled services and resources in ArcGIS Online.An API key is a unique key used to authorize access to specific services and resources in ArcGIS Online. It is also used to monitor access to those services. An API key is created and managed in the ArcGIS developer dashboard and is tied to a specific ArcGIS account.
In addition to setting an API key at a global level for your application using
ArcGISRuntimeEnvironment.setApiKey(String)
, you can callsetApiKey(String)
on any class that implementsApiKeyResource
. When you callsetApiKey(String)
on anAPIKeyResource
, it will override the default key at the global level (the key returned byArcGISRuntimeEnvironment.getApiKey()
, in other words), enabling more granular usage telemetry and management for ArcGIS Online resources used by your app.Classes that expose an API key property by implementing APIKeyResource include:
- Parameters:
apiKey
- the API key to access API key enabled services and resources in ArcGIS Online- Since:
- 100.10.0
- See Also:
-