Tuesday, 24 July 2012

Android: Posting a Facebook question with options

Posting a question which has no associated options is easy to figure out from the Facebook documentation. Posting a question which does have associated options I struggled to find a single example for and figured out by pure luck, a shot in the dark! Solution below:

Bundle params = new Bundle();
params.putString("questions", "This is a question.");
params.putString("options", "[\"Option 1\", \"Option 2\"]");

new AsyncFacebookRunner(myFacebookObject)
    .request("me/questions", params, "POST" myRequestListener);

No comments: