I'm using the code from the CppSamples/Layers/TileCacheLayer example from the arcgis-maps-sdk-samples-qt repo with my own Tile Package. When I populate the accessToken variable with an API token, I still get the "Licensed for Developer Use Only" message. Do I need to choose specific categories or approved items when generating the API key in order for an offline Tile Package to be displayed without the Developer Use warning?
The code looks like this (the API key string is just random here...) in main.cpp
const QString accessToken = QString(
"RANDOM9034175353gibberish"
"here_"
"andHERE_"
"835635765.AG1_IHe897yn");
Esri::ArcGISRuntime::ArcGISRuntimeEnvironment::setApiKey(accessToken);
Thanks!
Solved! Go to Solution.
Hi @ChristopherSwingley. Thanks for reaching out to the team.
For an offline map like you're working with, you shouldn't need any access token at all (that's for online services). You will need to license the app to remove the watermark. That's discussed here:
https://developers.arcgis.com/qt/license-and-deployment/
And this page explains more about license strings:
https://developers.arcgis.com/qt/license-and-deployment/use-a-license-in-your-app/
Let us know if that works for you.
Hi @ChristopherSwingley. Thanks for reaching out to the team.
For an offline map like you're working with, you shouldn't need any access token at all (that's for online services). You will need to license the app to remove the watermark. That's discussed here:
https://developers.arcgis.com/qt/license-and-deployment/
And this page explains more about license strings:
https://developers.arcgis.com/qt/license-and-deployment/use-a-license-in-your-app/
Let us know if that works for you.
Thanks. I'd used those license strings for 100.x, but the 200.x docs were leading me to the access tokens and I didn't realize license strings still worked with 200.x. The app is 100% offline, so I don't need any of the online services.
Hi @ChristopherSwingley. That's concerning. Could you help me understand where our documentation was misdirecting you please? We try to be very clear about the difference between access tokens and license strings, so if we've missed the mark we need to address that.
Please DM me (or if you happen to be going to the DevTech Summit in Palm Springs, we can connect then).
Thanks!
@Nicholas-Furness Thanks. I couldn't find a way to DM you so I'll quickly reply here. My confusion came from starting with the arcgis-maps-sdk-samples-qt/CppSamples/Layers/TileCacheLayer example. I remember from 100.x that the license goes into main.cpp and if you read the description in there it leads to using access tokens (see lines 37-49). I knew I didn't want User authentication, so I navigated to the link in the second option, API key authentication (https://links.esri.com/create-an-api-key).
That code also uses setApiKey() instead of setLicense(), even though it's a sample that you'd think would be directed at people writing an offline app. I think I tried pasting in my 100.x runtime key into the original code, but even if that key were valid for 200.x, I would have been using the wrong function (setApiKey).