Facebook login without using facebook login button on Android with native dialog -
in application, have requirement login facebook without using login button. have tried following code snippet
session s = new session(activity); session.setactivesession(s); session.openrequest request = new session.openrequest(activity); request.setloginbehavior(sessionloginbehavior.suppress_sso); request.setcallback( new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { if (exception != null) { toast.maketext(activity, "facebook" + exception.getmessage(), toast.length_short).show(); closetask = true; } else if(session.getstate().isopened()){} } });
but opening web dialog. requirement open native dialog if facebook app installed. if facebook app not installed open web dialog.
thanks, manish garg
you should remove line:
request.setloginbehavior(sessionloginbehavior.suppress_sso);
it tells sdk suppress sso (which native dialog).
Comments
Post a Comment