/// <summary> /// Gets a unique identifier for the current user /// </summary> /// <param name="application">The application for which the client ID should be retrieved</param> /// <returns>Returns the unique identifier representing the currently active user</returns> /// <remarks> /// Each client ID is unique to a computer, user account, <see cref="ITrackingApplication"/>, <see cref="TrackingEngine"/> and /// tracker ID given by <see cref="GetTrackerID()"/> (provided that the <see cref="CreateNewClientID"/> function returns /// unique values). /// /// If a client ID is not found for the current combination of the above then one will be generated by making a call to /// <see cref="CreateNewClientID"/>. /// </remarks> protected async Task <string> GetClientIDAsync(ITrackingApplication application) { var clientIDKey = string.Format("{0}:{1}:{2}", this.GetType().FullName, application.Name, GetTrackerID()); return(await KeyStore.GetOrFetchObject <string>(clientIDKey, () => CreateNewClientIDAsync(application)).FirstAsync()); }