AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) Method

Definition

Asynchronously retrieves the requested system attributes.

public : static IAsyncOperation<IMapView<Platform::String, Platform::String>> GetSystemPropertiesAsync(IIterable<Platform::String> attributeNames)
static IAsyncOperation<IMapView<winrt::hstring, winrt::hstring>> GetSystemPropertiesAsync(IIterable<winrt::hstring> attributeNames) const;
public static IAsyncOperation<IReadOnlyDictionary<string, string>> GetSystemPropertiesAsync(IEnumerable<String> attributeNames)
Public Shared Function GetSystemPropertiesAsync(attributeNames As IEnumerable(Of String)) As IAsyncOperation<IReadOnlyDictionary<string, string>>(Of IMapView)
Windows.System.Profile.AnalyticsInfo.getSystemPropertiesAsync(attributeNames).done( /* Your success and error handlers */ );

Parameters

attributeNames
IEnumerable<String> IEnumerable<String> IEnumerable<String>

An IIterable list of strings containing the system attributes to retrieve.

Returns

IAsyncOperation<IReadOnlyDictionary<string, string>> IAsyncOperation<IReadOnlyDictionary<string, string>> IAsyncOperation<IReadOnlyDictionary<string, string>>

Returns an IAsyncOperation object indicating that the task has completed and containing an IMapView object with the requested attributes as Key/Value pairs.

Additional features and requirements

Device family
Windows 10, version 1803 (introduced v10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v6)

Examples

using Windows.System.Profile;

// ...
 
var attrNames = new List<string>({"DeviceFamily", "OSVersionFull", "FlightRing"});
var attrData = AnalyticsInfo.GetSystemPropertiesAsync(attrNames).AsTask().GetAwaiter().GetResult();

// The map can be serialized and sent to a backend service for analytics or targeting 
foreach (KeyValuePair<string, string> attr in attrData) 
{ 
    Console.WriteLine($"{attr.Key}={attr.Value}");
}

Remarks

Supported values for the attributeNames parameter are potentially endless. There are many providers that hook in and can expose arbitrary values. There a handful of known attributes that are likely to be supported. In most cases, these are case sensitive:

  • App
  • AppVer
  • DeviceFamily
  • FlightRing
  • OSVersionFull

The intention of this method is to use this information only for analytics and not rely on a particular value on the client. Support for these values will change over time.