如何与其他Facebook账户登录? [英] How to log in with other facebook account?

查看:205
本文介绍了如何与其他Facebook账户登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是按照本教程做一个小的应用程序登录,并问好+用户名。

I'm follow this tutorial to make a small app to login and say hello + user name.

的问题是:我只能登录使用我的帐户,但不能与其他帐户登录。 这个问题是发生在一些示例code需要登录像HelloFacebookSample或美味。 该logcat的没有显示出任何错误。

The issue is: I can only login using my account, but can't log in with other account. This issue is happen with some sample code require login like HelloFacebookSample or Scrumptious. The Logcat is not show any error.

所以,请帮助我,使之与其他帐号登录。在此先感谢!

So please help me to make it login with other account. Thanks in advance!

修改(解决): 我刚刚找到了原因:我的应用程序在沙盒模式,只需禁用沙盒模式解决的问题。感谢任何人的帮助。

EDIT (SOLVED): I just found the cause: My app is in Sandbox mode, just disable Sandbox mode solved problem. Thanks anyone for helps.

我的code:

public class MainActivity extends Activity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // start Facebook Login
    Session.openActiveSession(this, true, new Session.StatusCallback() {

      // callback when session changes state
      @Override
      public void call(Session session, SessionState state, Exception exception) {
        if (session.isOpened()) {

          // make request to the /me API
          Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

            // callback after Graph API response with user object
            @Override
            public void onCompleted(GraphUser user, Response response) {
              if (user != null) {
                TextView welcome = (TextView) findViewById(R.id.welcome);
                welcome.setText("Hello " + user.getName() + "!");
              }
            }
          });
        }
      }
    });
  }

  @Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
  }

}

截图时登录我的帐户:显示您好+我的名字(阮合作频道映)

Screenshot when login with my account: Show hello + my name (Nguyễn Việt Anh)

截图登录时,与其他账户:白屏

Screenshot when login with other account: White screen

推荐答案

您可以用不同的Facebook用户ID登录,之后:

You can login with different Facebook user id, after that:

  • 转到 developers.facebook.com
  • 从顶部选择应用
  • 选择想要的应用程序从左侧​​
  • 选择编辑应用程序
  • 禁用沙盒模式
  • Go to developers.facebook.com
  • choose Apps from Top
  • select wanted App from left side
  • select Edit App
  • disable sandbox mode

这篇关于如何与其他Facebook账户登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆