how to share text on facebook Through android app which is login through facebook Parse -
i working on adding share on facebook functionality app. have new version of parse sdk facebook .
i can't seem find information on how use parse's fb sdk implement share.
i have facebook session open app don't understand how post text or share text on facebook in android.
please give me suggestions .
thanks in advance...
i got ans :)
here solution :
bundle params = new bundle(); params.putstring("name", "facebook sdk android"); params.putstring("caption", "build great social apps , more installs."); params.putstring("description", "the facebook sdk android makes easier , faster develop facebook integrated android apps."); params.putstring("link", "https://developers.facebook.com/android"); params.putstring("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/images/iossdk_logo.png"); webdialog feeddialog = ( new webdialog.feeddialogbuilder(getactivity(), session.getactivesession(), params)) .setoncompletelistener(new oncompletelistener() { @override public void oncomplete(bundle values, facebookexception error) { if (error == null) { // when story posted, echo success // , post id. final string postid = values.getstring("post_id"); if (postid != null) { toast.maketext(getactivity(), "posted story, id: "+postid, toast.length_short).show(); } else { // user clicked cancel button toast.maketext(getactivity().getapplicationcontext(), "publish cancelled", toast.length_short).show(); } } else if (error instanceof facebookoperationcanceledexception) { // user clicked "x" button toast.maketext(getactivity().getapplicationcontext(), "publish cancelled", toast.length_short).show(); } else { // generic, ex: network error toast.maketext(getactivity().getapplicationcontext(), "error posting story", toast.length_short).show(); } } }) .build(); feeddialog.show();
Comments
Post a Comment