UWP Get unique id from user logged microsoft store account












0















I need unique id to save user purchases to my database. i dont need device id because if user change microsoft store account then device id will be same to previus.



I want to a leaderboard to most users purchases but i dont know him id if user change own device .










share|improve this question























  • Have you tried to use receipts? Requesting a receipt

    – MKH
    Nov 19 '18 at 6:43













  • i dont see any unique id for user @MKH

    – OMANSAK
    Nov 19 '18 at 18:53











  • You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

    – MKH
    Nov 19 '18 at 19:20











  • @mkh App have no login or user id.

    – OMANSAK
    Nov 20 '18 at 17:54
















0















I need unique id to save user purchases to my database. i dont need device id because if user change microsoft store account then device id will be same to previus.



I want to a leaderboard to most users purchases but i dont know him id if user change own device .










share|improve this question























  • Have you tried to use receipts? Requesting a receipt

    – MKH
    Nov 19 '18 at 6:43













  • i dont see any unique id for user @MKH

    – OMANSAK
    Nov 19 '18 at 18:53











  • You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

    – MKH
    Nov 19 '18 at 19:20











  • @mkh App have no login or user id.

    – OMANSAK
    Nov 20 '18 at 17:54














0












0








0








I need unique id to save user purchases to my database. i dont need device id because if user change microsoft store account then device id will be same to previus.



I want to a leaderboard to most users purchases but i dont know him id if user change own device .










share|improve this question














I need unique id to save user purchases to my database. i dont need device id because if user change microsoft store account then device id will be same to previus.



I want to a leaderboard to most users purchases but i dont know him id if user change own device .







c# uwp win-universal-app windows-10-universal






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 18 '18 at 20:44









OMANSAKOMANSAK

128112




128112













  • Have you tried to use receipts? Requesting a receipt

    – MKH
    Nov 19 '18 at 6:43













  • i dont see any unique id for user @MKH

    – OMANSAK
    Nov 19 '18 at 18:53











  • You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

    – MKH
    Nov 19 '18 at 19:20











  • @mkh App have no login or user id.

    – OMANSAK
    Nov 20 '18 at 17:54



















  • Have you tried to use receipts? Requesting a receipt

    – MKH
    Nov 19 '18 at 6:43













  • i dont see any unique id for user @MKH

    – OMANSAK
    Nov 19 '18 at 18:53











  • You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

    – MKH
    Nov 19 '18 at 19:20











  • @mkh App have no login or user id.

    – OMANSAK
    Nov 20 '18 at 17:54

















Have you tried to use receipts? Requesting a receipt

– MKH
Nov 19 '18 at 6:43







Have you tried to use receipts? Requesting a receipt

– MKH
Nov 19 '18 at 6:43















i dont see any unique id for user @MKH

– OMANSAK
Nov 19 '18 at 18:53





i dont see any unique id for user @MKH

– OMANSAK
Nov 19 '18 at 18:53













You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

– MKH
Nov 19 '18 at 19:20





You can get and save unique transactions id from receipts then save it to your database for each username or userid who logged in to your app. Then you can calculate user purchases count locally or online.

– MKH
Nov 19 '18 at 19:20













@mkh App have no login or user id.

– OMANSAK
Nov 20 '18 at 17:54





@mkh App have no login or user id.

– OMANSAK
Nov 20 '18 at 17:54












1 Answer
1






active

oldest

votes


















0














The best you could do would be to have their app call StoreContext.GetUserCollectionsAsync from the UWP app on the user machine, then forward these results to your services. This isn’t really all the purchase, but is all the things the user currently owns.



Or, using your UWP app again, just keep track of it immediately after the purchase succeeded. But I don’t think there is any way to look up their purchase history directly.



A more complicated solution would be to use the B2B APIs. This would allow them to query the collections service directly from their service. This is probably the closest to what you are wanting. The token that get back would be unique to the user (not device).






share|improve this answer
























  • yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

    – OMANSAK
    Nov 20 '18 at 17:53











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365268%2fuwp-get-unique-id-from-user-logged-microsoft-store-account%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The best you could do would be to have their app call StoreContext.GetUserCollectionsAsync from the UWP app on the user machine, then forward these results to your services. This isn’t really all the purchase, but is all the things the user currently owns.



Or, using your UWP app again, just keep track of it immediately after the purchase succeeded. But I don’t think there is any way to look up their purchase history directly.



A more complicated solution would be to use the B2B APIs. This would allow them to query the collections service directly from their service. This is probably the closest to what you are wanting. The token that get back would be unique to the user (not device).






share|improve this answer
























  • yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

    – OMANSAK
    Nov 20 '18 at 17:53
















0














The best you could do would be to have their app call StoreContext.GetUserCollectionsAsync from the UWP app on the user machine, then forward these results to your services. This isn’t really all the purchase, but is all the things the user currently owns.



Or, using your UWP app again, just keep track of it immediately after the purchase succeeded. But I don’t think there is any way to look up their purchase history directly.



A more complicated solution would be to use the B2B APIs. This would allow them to query the collections service directly from their service. This is probably the closest to what you are wanting. The token that get back would be unique to the user (not device).






share|improve this answer
























  • yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

    – OMANSAK
    Nov 20 '18 at 17:53














0












0








0







The best you could do would be to have their app call StoreContext.GetUserCollectionsAsync from the UWP app on the user machine, then forward these results to your services. This isn’t really all the purchase, but is all the things the user currently owns.



Or, using your UWP app again, just keep track of it immediately after the purchase succeeded. But I don’t think there is any way to look up their purchase history directly.



A more complicated solution would be to use the B2B APIs. This would allow them to query the collections service directly from their service. This is probably the closest to what you are wanting. The token that get back would be unique to the user (not device).






share|improve this answer













The best you could do would be to have their app call StoreContext.GetUserCollectionsAsync from the UWP app on the user machine, then forward these results to your services. This isn’t really all the purchase, but is all the things the user currently owns.



Or, using your UWP app again, just keep track of it immediately after the purchase succeeded. But I don’t think there is any way to look up their purchase history directly.



A more complicated solution would be to use the B2B APIs. This would allow them to query the collections service directly from their service. This is probably the closest to what you are wanting. The token that get back would be unique to the user (not device).







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 2:36









Nico Zhu - MSFTNico Zhu - MSFT

9,5511421




9,5511421













  • yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

    – OMANSAK
    Nov 20 '18 at 17:53



















  • yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

    – OMANSAK
    Nov 20 '18 at 17:53

















yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

– OMANSAK
Nov 20 '18 at 17:53





yes, Azure Active Directory is complex. :(. I need just a unique id for user. i dont understand this is no way

– OMANSAK
Nov 20 '18 at 17:53


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53365268%2fuwp-get-unique-id-from-user-logged-microsoft-store-account%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

National Museum of Racing and Hall of Fame

Guess what letter conforming each word