Why I can't login with Linkedin android sdk? -
i tried login linkedin sdk, didn't work. have button, , write onclick method this:
if (view.getid() == btnlinkedinlogin.getid()){ lisessionmanager.getinstance(getactivity()).init(getactivity(), scope.build(scope.r_fullprofile), new authlistener() { @override public void onauthsuccess() { log.d(tag, "succesful linkedin login"); ((mainactivity)getactivity()).showfragment("tile"); } @override public void onautherror(liautherror error) { log.d(tag, "failed linkedin login. error: " + error.tostring()); } }, false); }
i override onactivityresult method this:
@override public void onactivityresult(int requestcode, int resultcode, intent data) { lisessionmanager.getinstance(getactivity().getapplicationcontext()).onactivityresult(getactivity(), requestcode, resultcode, data); // super.onactivityresult(requestcode, resultcode, data); }
but if running app , click on login button, linkedin logo showing, after hidden , application don't call authlistener methods...
i have create linkedin app , set package name , hash value.
i see in log this: request https://www.linkedin.com/uas/mobilesdk/authorize scope=r_fullprofile&duid=5770a1bf-2567-4fd1-9358-b762856df6d3&packagename=com.beee&packagehash=8drcxnsk3lzttd11ijmoiyacpia%3d&csrftoken=ajax%3a1829388572167379991&userauthorized=false
update: checked linkedin profile , saw linkedin application in profile. if remove this, , try login again, see screen linkedin app need premissions, after not calling method...
it doesn't seem sdk supports calls fragment (which assuming doing since call getactivity()). ran same issue , had workaround using listener interface , having parent activity make calls lisessionmanager.init().
you add bit of code onactivityresult() method in order read contents of result, may useful in determining whether or not request running errors.
@override public void onactivityresult( int requestcode, int resultcode, intent data ) { bundle bundle = data.getextras(); set<string> setkeys = bundle.keyset(); (string skey : setkeys) { log.d( tag, string.format("extra: (%s:%s)", skey, bundle.get(skey).tostring() ); } // rest of code }
Comments
Post a Comment