0

For single sign-on where should I include this below code to work..

In FACBOOK.Clas or somewhere else.. or in my main Activity .. I downloaded the code from https://github.com/facebook/facebook-android-sdk

facebookClient = new Facebook(FB_APP_ID);

    facebookClient.authorize(this, 
        new String[] {"publish_stream", "read_stream", "offline_access"}, this);
Matthias
  • 15,919
  • 5
  • 39
  • 84
Venkatesh
  • 1
  • 1
  • 5

2 Answers2

1

You can put the code in a separate class meant for authentication and call the authentication method from your MainActivity. You just need to store the access token, expire token etc. in the SharedPreferences. Take a look at the Facebook sample app in the Facebook SDK for Android for guidance.

dsr
  • 1,306
  • 1
  • 13
  • 21
0

Probably wherever the entry point for your app is; I'm guessing MainActivity.

harrisonlee
  • 5,068
  • 4
  • 21
  • 20