2017-03-21 26 views
6

enter image description hereFacebookのOAuthのXamarinがリダイレクト

フォーム私はフェイスブック、グーグルやTwitterにサインインするxamarinフォームにのOAuth2を使用しています。

アンドロイドで動作します。しかし、iOSでは、画面の右上隅に回転動作インジケータが表示されてフリーズします。同じ問題がある人はいますか?

更新:コードの下に、Facebookの開発者向けサイトで

partial void UIButton15_TouchUpInside(UIButton sender) 
{ 
    // https://developers.facebook.com/apps/ 
    var auth = new OAuth2Authenticator(
    clientId: "ID", 
    scope: "", 
    authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"), 
    redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html")); 

    var ui = auth.GetUI(); 

    auth.Completed += FacebookAuth_Completed; 

    PresentViewController(ui, true, null); 
} 

async void FacebookAuth_Completed(object sender, AuthenticatorCompletedEventArgs e) 
{ 
    if (e.IsAuthenticated) 
    { 
     var request = new OAuth2Request(
      "GET", 
      new Uri("https://graph.facebook.com/me?fields=name,picture,cover,birthday"), 
      null, 
      e.Account); 

     var fbResponse = await request.GetResponseAsync(); 
     var fbUser = JsonValue.Parse(fbResponse.GetResponseText()); 
     var name = fbUser["name"]; 
     var id = fbUser["id"]; 
     var picture = fbUser["picture"]["data"]["url"]; 
     var cover = fbUser["cover"]["source"]; 
    } 
    DismissViewController(true, null); 
} 

を見つけてください:Facebookのログインプラグインを使ってアプリを作成しまし

。 リダイレクトURLをhttp://www.facebook.com/connect/login_success.htmlとして追加しました

+0

どのバージョンのXamarin.Authを使用していますか?また、ログコンソールにエラー/メッセージが表示されていますか? – apineda

+0

ご意見ありがとうございます。コンソールにエラーメッセージはありません。私は1.3.0を使用しています。最新の1.3.2.7も試しました。 –

+0

facebook – apineda

答えて

0

最新のOAuthライブラリでのみ問題が発生しているようです。ビルドエラーのために以前のバージョンのOAuthでビルドできませんでした。作成されたWebviewベースのログインの後にGraph API Requestが続きます。

関連する問題