I am working on a Windows 8.1 Metro application. The application provides a personal experience to a user who is logged on to Windows with his Live account.
As provided in Windows, any user can connect / disconnect their active account on a PC using the PC settings β Account. My request should be notified of this event, that is, whenever a user connects / disconnects their personal account on a PC. Now, according to the MSDN page ( http://msdn.microsoft.com/en-us/library/windows/apps/hh977056.aspx ), this event will call the OnlineIdConnectedStateChange function. I was able to complete the background task in an application that listens for the trigger and it works fine. Each time a change occurs in the connected Live account when the event listener starts. But I canβt determine the fact that the user is logged in with some Live account or logged out of an already connected account.
I tried using Windows.Security.Authentication.OnlineId.OnlineIdAuthenticator , as mentioned in ( Metro App - How to Detect If You Logged In Using a Live ID or Local Account ), but this causes an authentication flow if no user is logged in . This is not what I want. I just want to know that someone is logged in or not. I do not want to start the Auth stream.
Is there a way to determine the user's login / logout status when the "OnlineIdConnectedStateChange" event is fired in a background job?
Thanks for any help.
Nishchay sharma
source share