It is possible to use WinRT API directly in Unity scripts. However there are limitations and requirements for this:
Below is an example for getting advertising using WinRT API directly:
using UnityEngine;
public class WinRTAPI : MonoBehaviour
{
void Update()
{
auto adId = GetAdvertisingId();
// ...
}
string GetAdvertisingId()
{
#if ENABLE_WINMD_SUPPORT
return Windows.System.UserProfile.AdvertisingManager.AdvertisingId;
#else
return "";
#endif
}
}