Domanda

I'm trying to allow a user to post there status to their FB wall from with in my Android app. I'm having a problem with the Privacy/Audience for the post is always set to "Only Me" I want to set this to "Friends", but I can't find a way to do this. Below is my code snippet of how i'm accomplishing this:

    Bundle params = new Bundle();
    params.putString("description", " ");
    params.putString("name", "testtest app");
    params.putString("link", "http://www.testtestapp.com/");

    WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(QuickCalc.this, Session.getActiveSession(), params)).setOnCompleteListener(new OnCompleteListener() {

            @Override
            public void onComplete(Bundle values, FacebookException error) {
                if (error == null) {
                    // When the story is posted, echo the success
                    // and the post Id.
                    final String postId = values.getString("post_id");
                    if (postId != null) {
                    } else {
                        // User clicked the Cancel button
                    }
                } else {
                    // Generic, ex: network error
                }
            }

        })
        .build();
    feedDialog.show();
È stato utile?

Soluzione

The audience level is set when the user first authorizes your app with write permissions, and cannot be changed by the app (for pretty obvious reasons).

When you ask for write permissions, you can request a certain default audience level by calling the setDefaultAudience method, but the user can edit the app settings from the Facebook website, and change the audience setting at any time.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top