0

I had used a facebook app to post message on wall from https://github.com/facebook/facebook-android-sdk.

Here after user allows the app to use his/her profile, dialog feed comes with an editable area to publish or skip. I want a predefined message there but user will not be able to modify it. I am able to send the predifined message but its editable. How to make it uneditable.

Does any one knows how to do it??

RiksAndroid
  • 815
  • 11
  • 17

2 Answers2

1

You can just use a function to post directly to the users wall. Just make sure that it is clear to the user that the button posts directly, perhaps use a dialog to get them to confirm they want to post. Here is the code I use:

/**
 * Post to a friends wall
 * @param msg Message to post
 * @param userId Id for friend to post to or null to post to users wall
 */
public void postToWall(String msg, String userID) {
    Log.d("Tests", "Testing graph API wall post");
    try {
        if (isSession()) {
            String response = mFacebook.request((userID == null) ? "me" : userID);
            Bundle parameters = new Bundle();
            parameters.putString("message", msg);
            response = mFacebook.request(((userID == null) ? "me" : userID) + "/feed", parameters, "POST");
            Log.d(TAG,response);
            if (response == null || response.equals("") || 
                    response.equals("false")) {
                Log.v("Error", "Blank response");
            }

        } else {
            // no logged in, so relogin
            Log.d(TAG, "sessionNOTValid, relogin");
            mFacebook.authorize(this, PERMS, new LoginDialogListener());
        }
    } catch(Exception e) {
        e.printStackTrace();
    }
}
Kenny
  • 5,522
  • 2
  • 18
  • 29
0

The dialog contains a WebView that loads the actual content from a Facebook URL. So to modify the editable area, you would need to modify the DOM of this webpage. See this question for more information about doing that. It is unclear to me from the answers in that question if this is possible. If it is, you'll need to add the code to the FbDialog class in the Facebook Android SDK.

Community
  • 1
  • 1
Jason Hanley
  • 3,225
  • 2
  • 24
  • 21
  • I think there should be another way other than DOM parsing. We can set message of that dialog, photo etc but not permission to user to not edit?????There should be some easier way to do it. – RiksAndroid Jul 07 '11 at 13:48
  • by the way, i doesn't want to modify that dialog. I just want user to not edit that area. – RiksAndroid Jul 07 '11 at 13:49
  • Maybe there should be a way, but I don't think Facebook has provided it. I would think they purposely don't allow developers to do this from a UX perspective. All that I am saying is that if you want to do this, I think you'll have to go in and modify the dialog yourself. – Jason Hanley Jul 07 '11 at 16:21
  • Some facebook app such as farmville (sorry if not correctly spell), when use our profile, they also give that feed dialog with non editable area. That's the reason why i am trying to do that. – RiksAndroid Jul 08 '11 at 05:45