Select to view content in your preferred language

Added API key but still getting "Licensed for Developer Use Only" message

167
4
Jump to solution
2 weeks ago
Labels (2)
ChristopherSwingley
Emerging Contributor

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!

0 Kudos
1 Solution

Accepted Solutions
JamesBallard1
Esri Regular Contributor

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.

View solution in original post

0 Kudos
4 Replies
JamesBallard1
Esri Regular Contributor

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.

0 Kudos
ChristopherSwingley
Emerging Contributor

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.

Nicholas-Furness
Esri Regular Contributor

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!

0 Kudos
cswingle
New Contributor

@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).

0 Kudos