我正在尝试学习如何检索Microsoft Store ID密钥。为此,我遵循了Microsoft在Windows通用示例中提供的示例。 我尝试使用Business to Business方案(方案7)。 我已经发布了一个样例应用程序并在Azure Active Directory中注册了该应用程序。 问题是我不知道在getCustomerCollectionsIdAsync / getCustomerPurchaseIdAsync函数中应该发送什么值作为publisherUserId参数。 我尝试发送当前用户的电子邮件(客户电子邮件),但只检索到空结果(Microsoft Store ID密钥)。
function getCustomerCollectionsId() {
var token = getTokenFromAzureOAuthAsync().done(function (aadToken) {
if (aadToken) {
storeContext.getCustomerCollectionsIdAsync(aadToken, "***@hotmail.com")//"kim@example.com"
.done(function (result) {
output.innerText = result;
if (!result) {
WinJS.log && WinJS.log("getCustomerCollectionsIdAsync failed.", "sample", "error");
}
});
}
});
}
function getCustomerPurchaseId() {
var token = getTokenFromAzureOAuthAsync().done(function (aadToken) {
if (aadToken) {
storeContext.getCustomerPurchaseIdAsync(aadToken, "***@hotmail.com")//"kim@example.com"
.done(function (result) {
output.innerText = result;
if (!result) {
WinJS.log && WinJS.log("getCustomerPurchaseIdAsync failed.", "sample", "error");
}
});
}
});
}
publisherUserId
参数是可选的,如果您维护匿名用户ID以供其服务使用,则可以将customer email
作为参数传递。您能告诉我您传递的电子邮件是客户还是发布者吗? - Nico Zhu