public void signInWithLinkedIn(View view){
LISessionManager.getInstance(getApplicationContext()).init(this, buildScope(), new AuthListener() {
@Override
public void onAuthSuccess() {
Toast.makeText(getApplicationContext(), "success" + LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken().getValue(), Toast.LENGTH_LONG).show();
Log.d("SESSION", Boolean.toString(LISessionManager.getInstance(getApplicationContext()).getSession().isValid()));
//fetchBasicProfileData();
}
@Override
public void onAuthError(LIAuthError error) {
Toast.makeText(getApplicationContext(), "failed " + error.toString(),
Toast.LENGTH_LONG).show();
}
}, true);
// After complete authentication start new HomePage Activity
}
The block of code in onAuthSuccess
got executed but getSession returns null AND most importantly the access token is null, making me unable to call other linkedin APIs. This happens only recently. Am I doing it correctly?
Updated:- One more thing it generally happens with few specific LinkedIn Ids and working fine with rest of the id.