简体   繁体   English

Windows Phone-获取用户ID

[英]Windows Phone - Get User ID

I need to store and share a user's list of favorites across a Windows Phone 8.1 Silverlight app, and a Windows 8.1 RT app. 我需要在Windows Phone 8.1 Silverlight应用程序和Windows 8.1 RT应用程序之间存储和共享用户的收藏夹列表。 I have been using Roaming Settings up to this point, but it doesn't work for all connected devices. 到目前为止,我一直在使用漫游设置 ,但是它不适用于所有连接的设备。 I have tested my app across a few devices and it syncs for most but not all devices. 我已经在少数设备上测试了我的应用程序,并且它可以同步大多数(但不是全部)设备。 I have also received some user complaints about this too. 我也收到了一些与此相关的用户投诉。

So instead I want to store a user's list of favorites in Azure Blob Storage, with the key being an anonymized user ID. 因此,我想将用户的收藏夹列表存储在Azure Blob存储中,键是匿名用户ID。 But I can't seem to find any way of determining a user's ID. 但是我似乎找不到确定用户ID的任何方法。 I have found information about DeviceUniqueId and there is ID_cap_identify_user capability in the manifest file for the Silverlight App (but not for the RT App) but I can't find any documentation on how to utilize this. 我已经找到有关DeviceUniqueId信息,并且Silverlight应用程序的清单文件中有ID_cap_identify_user功能(但RT应用程序没有),但是我找不到任何有关如何使用此功能的文档。 Any help here would be apprciated. 在这里的任何帮助将不胜感激。

PS - Does anyone have any theories as to why Roaming Settings isn't working correctly on some devices? PS-有人对为什么漫游设置在某些设备上无法正常工作有任何理论吗?

There is an UserInformationClass , BUT take note if you want to use it in reference to windows 10! 有一个UserInformationClass ,但是如果您想在Windows 10中使用它,请注意!

If you have a Windows 8 app that uses the UserInformation class, you should migrate your app to the Universal Windows Platform (UWP) and access the User class instead. 如果您有使用UserInformation类的Windows 8应用,则应将应用迁移到通用Windows平台(UWP)并访问User类。 Universal Windows Platform (UWP) apps that access user information are now expected to declare a new capability, uap:userAccountInformation, and call new APIs, Windows.System.User.FindAllAsync and User.GetPropertiesAsync, to get the data. 现在,访问用户信息的通用Windows平台(UWP)应用程序应该声明一种新功能uap:userAccountInformation,并调用新的API Windows.System.User.FindAllAsync和User.GetPropertiesAsync来获取数据。

There is also an MSDN example on how to use it: https://code.msdn.microsoft.com/windowsapps/Account-picture-name-sample-912baff1 还有一个有关如何使用它的MSDN示例: https : //code.msdn.microsoft.com/windowsapps/Account-picture-name-sample-912baff1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM