I want to know the exact replacement for the below code without deprecated code. Moreover, i want to try it in new Facebook SDK 3.0.
Facebook aFacebook = new Facebook("app_id");
if( !aFacebook.isSessionValid() ) {
aFacebook.authorize(this, new String[] { "email" },
new LoginDialogListener());
}
I tried many thing. But, couldn't get it done.
TIA
Since this question has no answer, I am writing one.
In 3.0 Facebook SDK for Android, Session class is used to Login. Initially, as mentioned in the question, the authorize method was used.
The code to serve as exact replacement for the code mentioned in question:
Session session = Session.getActiveSession();
if (session == null) {
session = new Session(getApplicationContext());
}
Session.setActiveSession(session);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With