Authenticating applications
Developers using Live Sense SDK for Linux with their app are required to register for a set of HERE credentials and to specify these credentials in the SDK.
To obtain HERE credentials, visit the developer portal at https://developer.here.com/plans and register for a license.
Once your project is created or if you already have a plan, get in touch with your Account Executive who will help you with the credentials.
Note
-
Credentials are unique to your account and your application's package namespace. Avoid reusing credentials across multiple applications.
-
You cannot commercially release applications (for example, submit your application to a store) with a license key obtained as part of an Evaluation plan.
Once you receive the credentials, do the following:
- Add the credentials to your application
- Re-deploy your app
To contact us for more details, see Help.
Add credentials to the application
You can use the LivesenseEngine
and AuthResponse
classes to authenticate the SDK.
AuthResponse authResponse = LivesenseEngine::setAppCred("YOUR_APP_ID", "YOUR_APP_CODE", "YOUR_LICENSE_KEY");
Obtain end-user consent
Data is collected only from users who have agreed to their data being shared with HERE.
To obtain end-user consent for data usage and collection, use the ls::ConsentManager
class after successful authentication.
The application is responsible for clearly presenting the end-user with the consent message and associated prompt to accept or decline data collection and sharing of that data with HERE.
The consent message presented to the end user will refer to a consent withdrawal mechanism, which must be implemented by the application to meet the requirements for a valid consent.
When the user gives a response, the application will inform Live Sense via ls::ConsentManager::setConsentResponse(bool)
. This method may be called again if the user decides to change their consent preference.
Below is an example of obtaining end-user consent in a console application.
auto manager = ls::ConsentManager::getInstance();
if (manager->needToRequestConsent()) {
std::cout << '\n'
<< manager->getConsentMessage()
<< std::endl;
while (true) {
std::cout << "Do you accept? [Yes/No]: ";
std::string line;
if (!std::getline(std::cin, line)) {
throw std::runtime_error("Unexpected input error");
} else if (line.size() > 0 && line.find_first_of("YyNn") == 0) {
bool response = (line[0] == 'Y' || line[0] == 'y');
if (manager->setConsentResponse(response) == false) {
std::cout << "Failed to set user consent" << std::endl;
return 0;
}
}
}
}
After establishing this, you can start with the basic usage of the Live Sense in your app.