I am creating an application called LinkedIn. I follow this documentation. But when I press the login button, the application is redirected to the LinkedIn application and requests a login. Upon successful login, it is redirected to my application. But nothing happens. Nothing happens on onActivityResult . Below is my code. Login implemented in fragment
LISessionManager.getInstance(getActivity()).init(getActivity(), buildScope(), new AuthListener() { @Override public void onAuthSuccess() { getLinkedInProfile(); Toast.makeText(getApplicationContext(), "success" , Toast.LENGTH_LONG).show(); } @Override public void onAuthError(LIAuthError error) { Toast.makeText(getApplicationContext(), "failed " + error.toString(), Toast.LENGTH_LONG).show(); } }, true);
//
private static Scope buildScope() { return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS); }
and onActivityResult as follows:
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); LISessionManager.getInstance(getActivity()).onActivityResult(getActivity(), requestCode, resultCode, data); }
The hash and package name has already been added to the LinkedIn Developer Console. Am I missing something? Please, help
source share