Tuesday, 6 August 2013

Facebook login dialog pop up nothing happening on android

Facebook login dialog pop up nothing happening on android

I am trying to implement in my android application a facebok-share button.
I have followed the official facebook-android documentation, but after the
Dialog appears ("... would like to access your public profile and friend
list. Cancel/No"), nothing happening. I am getting back to the activity
where my button is located.
This is how I open the dialog:
@Override
public void onClick(View v)
{
case R.id.btnFacebook:
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception
exception) {
if (session.isOpened()){
Request.executeMeRequestAsync(session, new
Request.GraphUserCallback(){
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null){
Log.e("D", "Success " + user.getName());
}
else Log.e("D", "NOPE !");
}
});
}
}
});
break;
}
This method should be called after the Login was success:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent
data) {
super.onActivityResult(requestCode, resultCode, data);
Session.getActiveSession().onActivityResult(this, requestCode,
resultCode, data);
}
AndroidManifest.XML
<uses-permission android:name="android.permission.INTERNET"/>
<meta-data android:value="@string/app_id"
android:name="com.facebook.sdk.ApplicationId"/>
<activity android:name="com.facebook.LoginActivity"></activity>
Also I have added the facebook SDK -build project-, I have created an App
on developers.facebook.com -added the sha1 key-.
I don't know what's going on. There are no error messages, no exception.

No comments:

Post a Comment