This is a new service included in version 4.10.0. Tracking service allows once activated to track the position of people in a building.
Warning: this service must be activated with the user’s consent. otherwise this service will not be started
Setup
Activate service on NAO Cloud (Admins only)
NAO SDK
- First add a tracking identifier
- NAOServicesConfig.setIdentifier
Android signature/** * @exclude * set the identifier to take as instanceId in naoServiceManager * @param context the Context used in the application * @param id the new identifier used in the NAOSDK * @param consent the boolean used to confirm the terms of usage of this api * @return true if identifier has been changed, false otherwise * @throws NAOException if NaoContext is not created yet */ public static boolean setIdentifier(final Context context, final String id, final Boolean consent) throws NAOException
iOS signature
/** *@brief Function for setting the user tracking identifier with his consent *@param[in] identifier String word used as the used identifier *@param[in] consent YES if the user is consent otherwise NO *@return YES if the identifier has been successful set otherwise NO */ + (BOOL)setIdentifier:(NSString*)identifier witUserConsent: (BOOL)consent;
Passing consent = TRUE provides the NAO SDK with the assurance that the application has requested authorization from the user. User content should always be explicitly obtained before starting the tracking service.
- NAOServicesConfig.setIdentifier
- Start tracking service
- Creates service Handle with your API Key
void createHandle() { serviceHandle = new NAOTrackingHandle(this, MyNaoService.class, apiKeyUsed, this, this); try { NAOServicesConfig.setIdentifier(this,"people identifier",true); } catch (NAOException e) { e.printStackTrace(); } }
- Synchronize data
void synchronizeData() { if(null == serviceHandle){ createHandle(); } serviceHandle.synchronizeData(naoSyncListener); }
- Start service Handle
void startService() { if(checkPermissions()){ // init service if (serviceHandle == null) { createHandle(); } serviceHandle.start(); } }
- Creates service Handle with your API Key