hi i am trying achieve the text sharing on facebook,i have created the app on facebook with the necessary informations after completing these procedures , i implemented Facebook share on my app, whenever i am trying to post message on facebook using my account (which i have been used to create the appID)it has posted on facebook but it won't if i tried to post the message using some other facebook account,the account gets logged in but it won't post the message on the wall.please any one help me to get out of this problem thanks in advance
Asked
Active
Viewed 707 times
1
-
@ChristianSt.hi i just used the sample code that facebook provide along with their samples(Hello Facebook sample) i just changed the app id and relevant changes like package name and class name,i thing that i made some mistakes over adding permissions – Francis May 19 '14 at 07:21
1 Answers
1
refer to https://stackoverflow.com/a/15783274/2771869
Taken from Share on User's Wall using Facebook SDK:
private void share() {
Bundle bundle = new Bundle();
bundle.putString("caption", "Harlem Shake Launcher for Android");
bundle.putString("description", "Your android can do the Harlem Shake. Download it from google play");
bundle.putString("link", "https://play.google.com/store/apps/details?id=mobi.shush.harlemlauncher");
bundle.putString("name", "Harlem Shake Launcher");
bundle.putString("picture", "http://shush.mobi/bla.png");
new WebDialog.FeedDialogBuilder(mContext, mySession, bundle).build().show();
}
If you need to login (add this in you activity wherever you need to login/share):
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if(session.isOpened()) {
share();
}
}
});
You will need to add to your activity:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(requestCode) {
default:
if(Session.getActiveSession() != null) //I need to check if this null just to sleep peacefully at night
Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
break;
}
}

Community
- 1
- 1

Mohammad Rababah
- 1,730
- 4
- 17
- 32