I am trying to figure out a simple code for logging in facebook from a Windows Phone 8.1 app (C#).
As the Facebook Client
from NuGet doesn't target Windows Phone 8.1, it seems I'd have to write some extra code. As I read in this facebook post, I'd need to launch an Uri to invoke the Login Dialog. That much, I managed to do :
await Launcher.LaunchUriAsync(FacebookUri.DisplayLoginDialog);
where DisplayLoginDialog is a static string object with the required necessary data on the request (appId, productId, permissions, etc). I was redirected to the facebook app, to accept that my app requires such permissions.
And I accepted.
So what now? How do I get a response or something with the access_token
? I have researched a lot for this but I wasn't able to find relevant posts.
The same facebook link from above, says at the section of Handling the Login Dialog that :
If someone successfully logs in, the URI association of your app will be automatically triggered, meaning they will be sent to your app, along with an access token:
msft-{ProductID}://authorize/?
access_token={user-access-token}&
expires_in={expiration-time-of-token}
But I am confused on how to actually use this in C#.
How do I get a response with the access token
after the login suceeded or and error code
and error message
if it failed, like it is written in the facebook post?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…