Share via


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);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<IMapView<winrt::hstring, winrt::hstring const&>> GetSystemPropertiesAsync(IIterable<winrt::hstring> const& attributeNames);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<IReadOnlyDictionary<string,string>> GetSystemPropertiesAsync(IEnumerable<string> attributeNames);
function getSystemPropertiesAsync(attributeNames)
Public Shared Function GetSystemPropertiesAsync (attributeNames As IEnumerable(Of String)) As IAsyncOperation(Of IReadOnlyDictionary(Of String, String))

Parameters

attributeNames

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

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

Returns

IAsyncOperation<IMapView<String,String>>

IAsyncOperation<IReadOnlyDictionary<String,String>>

IAsyncOperation<IMapView<Platform::String,Platform::String>>

IAsyncOperation<IMapView<winrt::hstring,winrt::hstring>>

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

Attributes

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

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.

Applies to