Hi, I'm trying to call the method User.SignInAsync(m_uiDispatcher) but I don't see the sign in popup when I call it. The same happens when I use User.SignInSilentlyAsync(m_uiDispatcher). What's the difference anyway? I am able to sign in using the Xbox App on Windows then only will my game sign in using the same account. Any idea how can I get the sign in pop-up to appear?
I'm not sure what you mean by thread but basically I'm using the plugins found here: https://github.com/Microsoft/xbox-live-samples It has an example where it's calling m_user.SignInAsync(UIDispatcher).
Can you show your code that calls it? It needs to be invoked from Windows UI thread, which is a different thread than where your script callbacks (Start(), Update(), etc) are called.
I managed to find a workaround. Somehow the sign in doesn't pop up when I call the method at Start() so I had to explicitly call it again and then it comes up.
Sure. When running Unity game on UWP, there are two main threads that you might care about: • System UI thread. This thread is where interaction with native UI elements has to happen. • Unity main thread. This is the thread all of your scripts and game logic run on. If you call into system UI on the Unity main thread, you will likely crash. You can jump from one thread to another using these APIs: https://docs.unity3d.com/ScriptReference/WSA.Application.InvokeOnAppThread.html https://docs.unity3d.com/ScriptReference/WSA.Application.InvokeOnUIThread.html