c# - Does the Facebook .NET client SDK support universal apps / apps generated via AppStudio? -


I have created a universal app through Microsoft's AppStudio by following the 'Great Tutorial' () Attempted to add authentication.

When I run an app on my phone, I will never go to the Facebook login page, because the following line: wait App.FacebookSessionClient.LoginAsync ("user_about_me, read_stream");

The result is always the following exception:

System.NotImplementedException: Not implemented on Windows Security. Authentication Web. Web Authing Broker. Facebook on the authentic ASIC (WebAtification Option Option, Yuri Request Yuri, Uri Callback URI) Client.FacebookSation Client DOS4.MOVICE ()

The source exception call is in the FacebookSessionClient.cs ( Facebook-client package ): Var results = WebAuthenticationBroker.AuthenticateAsync (option, startUri, endUri);

It seems that this function is not implemented for the phone. I am still wondering how it is possible that the Trial, which refers to the exact code. > It has not been implemented for 8.1 yet, if you want to use Facebook authentication in 8.1, then you can use the following approach:

In your app classroom: < Pre> personal prong string RedirectUrl = "https: // www facebook.com/connect/login_success.html"; Private static readonly irDAOnLikulation & lt; String & gt; Permissions = new [] {"email", "offline_exact"}; Safe Override Zero (IActivatedEventArgs args) {base.OnActivated (args); Var ContinuationActive EventRugs = IContinuationActivatedEventArgs arguments; If (ContinuityActiveAvent errors == blank) return; Var webAuthenticationResult = ((WebAuthenticationBrokerContinuationEventArgs) Continuity expected events) .WebAuthenticationResult; If (webAuthenticationResult.ResponseStatus == WebAuthenticationStatus.Success) {var Facebook client = new FacebookClient (); Var result = facebookClient.ParseOAuthCallbackUrl (new URI (webAuthenticationResult.ResponseData)); If (! Result.IsSuccess) {// Process unsuccessful authentication} other {// successfully validating the var access Token = result.AccessToken process; }}} // Authentication method, when you click the Facebook authentication button Public Authentication and Continuity () {var loginUrl = GetLoginUrl (); WebAuthenticationBroker.AuthenticateAndContinue (login url, new ury (redirect url)); } Private URI GetLoginUrl () {var parameter = new dictionary & lt; String, Object & gt; (); Parameters ["client_id"] = "Your feesbook appeal ID"; Parameter ["redirect_uri"] = Redirect URL; Parameter ["response_type"] = "token"; Parameter ["display"] = "touch"; Parameter ["mobile"] = true; Parameter ["scope"] = string .join (",", permissions); Var facebookClient = New FacebookClient (); Return FacebookClient.GetLoginUrl (parameter); }

I keep everything in one place for example purposes, it is better to exclude Faabi authentication logic. You can find this approach here

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

Matlab: Transfer variable from GUI to Base Workspace and new Variables (Static Workspace, Script, Creating new Variables) -