Android facebook login not working with installed Facebook app -
i have set simple facebook login. android 2.3.6 works should, user gets prompt login dialog, enters data , app goes on. thought android versions fault turs out login isn't working when there facebook application installed on phone!
tested on: galaxy ace 2.3.6 htc desire 4.1.2 galaxy note 4.1.2 android emulator 4.1.2
even facebook samples not working!
every time app executing - else {                     log.d("session not opened", "session not opened");                 }
it seems session isn't opened why that? followed guide - https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
code:
session.openactivesession(this, true, new session.statuscallback() {          @override         public void call(final 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.d("access_token", session.getaccesstoken());                         }                     }                 });             } else {                 log.d("session not opened", "session not opened");             }         }     });      
check out bottom of step 4: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
if have not entered app key hash properly, facebook login via webview popup (if app not installed) still work, login via native facebook app won't.
you should see exception in logcat:
com.facebook.http.protocol.apiexception: remote_app_id not match stored id   the facebook sdk prints exceptions check there anyway if there other problems.
Comments
Post a Comment