How do I add esri elevation service as a basemap in my native ios app. It is always asking for token when I add it with a url
The esri elevation services are free (they don't utilize credits) but they can only be accessed through an ArcGIS Online Organization subscription. More details in this blog post - Introducing Esri’s World Elevation Services | ArcGIS Blog
If your apps user has an org subscription account, you can use the AGSOAuthLoginViewController class in the SDK to allow the end user to log in to their account. This class returns to you an AGSCredential object when the user successfully logs in. See OAuth Login Sample
Once you have the credential, you can use it to open web maps that contain elevation layers, or you can load the elevation layers directly and add them to the map view as AGSImageServiceLayer objects
Is this ArcGIS Runtime SDK for iOS we're talking about?
If yes then it should allow you to view the map when licensed or when it's in developer mode.
If it's not Runtime SDK app, then you need a valid token.
It can be generated on the server with AGOL account.
But token is short lived and it will timeout eventually a which point a new token needs to be generated.
Retrieving data ...