Hi Prem-
It looks like our doc hasn't been updated correctly. I will put in a request to get this fixed up.
Since you are obtaining a license and not going through portal, you will need to do the following:
- Go into the AppInfo.h and set your client id
- Go into the AppInfo.h and set your license (and uncomment it)
This will eventually call the following lines in the main.cpp
// Initialize license
#ifdef kClientID
QCoreApplication::instance()->setProperty("ArcGIS.Runtime.clientId", kClientId);
#ifdef kLicense
QCoreApplication::instance()->setProperty("ArcGIS.Runtime.license", kLicense);
#endif
#endif
If you aren't using our template, then use the above lines and replace kClientId and kLicense with the info you have received.
You actually can't set the license in QML, as this could be a potential security issue, as the QML is interpreted and not necessarily compiled. You can check if everything is set correctly in QML though, by doing something like the following:
Component.onCompleted: {
if (ArcGISRuntime.license.licenseLevel === Enums.LicenseLevelBasic) {
console.log("basic");
} else if (ArcGISRuntime.license.licenseLevel === Enums.LicenseLevelStandard) {
console.log("standard");
} else if (ArcGISRuntime.license.licenseLevel === Enums.LicenseLevelDeveloper) {
console.log("developer");
}
}
Thanks,
Luke