ArcGISRuntimeEnvironment

Namespace: Esri::GameEngine
Class: Esri/GameEngine/ArcGISRuntimeEnvironment
Since: 1.0.0

Summary

Provides environment settings, such as an API key for access to ArcGIS location services.

Properties

PropertyTypeNullableReadonlySummary
No
No

The API key allows your app to access ArcGIS location services and private portal items.

APIKey

static FString GetAPIKey()

static void SetAPIKey(const FString& APIKey)

The API key allows your app to access ArcGIS location services and private portal items.

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.

Note: An API key created with a referrer is not supported. If you need service requests to include the referrer, use the SDK's functionality to intercept the request and add an HTTP referer header.

In addition to setting an ArcGISRuntimeEnvironment::APIKey at a global level for your application, you can set it on any class that implements APIKeyResource. This overrides the ArcGISRuntimeEnvironment::APIKey and enables more granular usage telemetry and management of the ArcGIS location resources used by your app.

Classes that expose an API key property by implementing APIKeyResource include:

  • Basemap
  • ArcGISSceneLayer
  • ArcGISTiledLayer
  • ArcGISVectorTiledLayer
  • ServiceFeatureTable
  • ExportVectorTilesTask
  • LocatorTask
  • GeodatabaseSyncTask
  • ClosestFacilityTask
  • RouteTask
  • ServiceAreaTask
  • ExportTileCacheTask

For more information, see API key authentication and Types of authentication.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.