-
Notifications
You must be signed in to change notification settings - Fork 101
Whenever i use the option SessionLoginBehavior:WebView, it gives me 4201 error #279
Comments
After some debugging, i find out that this is because of below exception.
And this exception is thrown every time trying to initialize FacebookDialog like below code in FacebookSession.cpp.
Well, i guess this happens probably while initializing FacebookDialog.xaml, but i don't know exact reason because i can't specify which line that exception thrown from.
Google says that exception happens when i try to access thread from another thread and it can be resolved with this which is here link.
But isn't it true that dialog is already executed like below in FacebookSession.cpp
Is there anyone who suffer from similar problem with me? |
It would be awesome if you could share a minimal reproducable sample which could help me or someone else debug the issue. But reading your latest comments, if you use the FacebookSession API to login, the FacebookSession has a dispatcher functionality as described, but if you instead use the FacebookDialog directly as in your code sample, you probably have to wrap the UI calls manually with the dispatcher. Does that make sense? |
Thanks for the comment. There is the core process which is the way that i try to login at below. Well, i check which thread does those process run and figured out those process are running on SHCore.dll thread which is UI Thread in windows. Right now, i suspect several things and try to look into.
|
You'll have to excuse me here, since I haven't leveraged C++/CX from any Unity applications/games earlier and hence are wondering if there might be something causing issues in that? |
Yeah, there might be or might be not. Thank you for your comment and i'll update this issue when i can resolve this problem. |
Sorry for not being able to help directly here, but have you tried leveraging the nuget packages for winsdkfb instead of the branch directly? My thinking is, then you could at least remove one layer of abstraction and possibly the burden of C++/CX. I am really curious about this issue though and if I have time I will try to setup a Unity project leveraging winskdb myself, it will be a valuable lesson for me as well. |
By the way, below is stack trace when i try to use the method LoginAsnyc and those korean sentences mean just exception "The application called an interface that was marshalled for a different thread"
|
Oh yeah, the first try that i install winsdkfb is through nuget package manager in visual studio. With further debugging and checking from stack trace, i think i found out the actual part which makes problem.
And if you see this line in FacebookDialog.xaml.cpp, it tries to call InitializeComponent() which exist in FacebookDialog.g.hpp file.
And if you see this method in FacebookDialog.g.hpp, in the end of method, it tries to LoadComponent from FacebookDialog.xaml.
Google says that LoadComponent is to make the most upper class of corresponding xaml file to be initialized and that class is UserControl.
And immediately after that, exception is thrown. In relation to this, another thing i suspect is that there exist more than one SHCore.dll thread in run time. Please share your opinion if you have any idea about those fact. |
Hello, |
I try to facebook login through winsdkfb.
First try with FacebookSession::LoginAsync with option SessionLoginBehavior:WebView always gives me 4201 error which states "User canceled the Dialog Flow, OAuthException"
But another try with option SessionLoginBehavior:WebAuth works.
Is there anything that i have to do to enable login with option WebView?
Another thing that i have to do with this sdk is posting some feed with Facebook Dialog.
But it also gives me 4201 error when i try FacebookSession::ShowFeedDialogAsync and i realize that whenever i got a 4201 error, they uses same logic FacebookDialog::ShowDialog.
So, i want to make my app possible to pass the auth process even when using a FacebookDialog::ShowDialog.
The text was updated successfully, but these errors were encountered: