2012-01-02 12 views
1

(サーバー側のフローを使用)私は、iframe内でアプリケーションを作成するタブの1つを介してFacebookページに添付されたFacebookアプリケーションを持っています。私はアクセストークンを取得するために動作する以下のコードを使用しますが、ユーザーがFacebookのロゴをクリックしてアプリケーションを認証した場合に限ります。私の質問は私が何をすべきなのか、私はFacebookのロゴのものを表示するのではなく、より良いユーザーエクスペリエンスを得ることができるということです。ありがとう。 pageLoad ONfacebook iframe - ポップアップ認証の代わりにFacebookのロゴを取得

()...... 保護されたボイドをPage_Load(オブジェクト送信者、のEventArgs電子) {文字列コード=場合、Request.QueryString [ "コード"]。 (HttpContext.Current.Session ["fbAccessToken"]!= null) if }

if (!String.IsNullOrEmpty(authToken)) 
    { 
     thisUserFBID.Value = HttpContext.Current.Session["fbUserId"].ToString(); 
    } 
    else if (code == "" || code == null) 
    { 
     Response.Redirect(appHelp.GetCodeUrl()); 
     //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "shareMe();", true); 
    } 
    else 
    { 
     authToken = appHelp.GetAccessToken(code); 
     Session["access_token"] = authToken; 
     HttpContext.Current.Session["fbAccessToken"] = authToken; 

     try 
     { 
      var fb = new FacebookClient(); 
      fb.AccessToken = authToken; 
      dynamic me = fb.Get("me"); 
      thisUserFBID.Value = (string)me.id; 
      HttpContext.Current.Session["fbUserId"] = thisUserFBID.Value; 
      if (me.locale != null) 
       lang = (string)me.locale; 
      else 
       lang = "en_US"; 
      HttpContext.Current.Session["lang"] = lang; 
     } 
     catch (Exception) 
     { 
      //Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "shareMe();", true); 
      //Response.Redirect(appHelp.GetCodeUrl()); 
     } 

    } 
} 

答えて

0

Huh?あなたはログインしているものをユーザーに知らせたくありませんか?よくわかりません。ページタブアプリケーションでは、アプリケーションを許可するかどうか、または既にログインしている場合は、そのアプリケーションに良いものを表示することができます。私はそれよりも優れたユーザーエクスペリエンスを作り出すものが何かを知りません。

関連する問題