AnalyticsInfo.GetSystemPropertiesAsync(IIterable<String>) メソッド

定義

要求されたシステム属性を非同期的に取得します。

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))

パラメーター

attributeNames

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

取得するシステム属性を含む文字列の IIterable リスト。

戻り値

IAsyncOperation<IMapView<String,String>>

IAsyncOperation<IReadOnlyDictionary<String,String>>

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

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

タスクが完了し、要求された属性を Key/Value ペアとして含む IMapView オブジェクトが含まれていることを示す IAsyncOperation オブジェクトを返します。

属性

Windows の要件

デバイス ファミリ
Windows 10, version 1803 (10.0.17134.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v6.0 で導入)

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}");
}

注釈

attributeNames パラメーターでサポートされている値は、無限である可能性があります。 をフックして任意の値を公開できるプロバイダーは多数あります。 サポートされる可能性が高い既知の属性がいくつかあります。 ほとんどの場合、大文字と小文字が区別されます。

  • アプリ
  • AppVer
  • DeviceFamily
  • FlightRing
  • OSVersionFull

この方法の目的は、この情報を分析にのみ使用し、クライアントの特定の値に依存しないようにすることです。 これらの値のサポートは、時間の経過と同時に変化します。

適用対象