Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a custom Wall Post with Facebook API on Android
    primarykey
    data
    text
    <p>I'm new to Facebook API on Android, and basically, what I'm trying to do is creating custom wall post for an application I'm developing. Like when you listen a Shazam a song and you can share the result with your friends. I believe I've got to create a custom attachment. Here's my code for setting the attachment:</p> <pre><code>mPostButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Bundle myParams = new Bundle(); String attachment="{\"name\":\"Gran Turismo 5\"," + "\"href\":\"http://www.unknown.com/?lang=fr\"," + "\"caption\":\"Sony Computer Entertainment\",\"description\":" + "\"Une vidéo proposée par Cedemo.\",\"media\":" + "[{\"type\":\"image\",\"src\":" + "\"http://www.unknown.com/prepicture//thumb_title/15/15061_1.jpg\"," + "\"href\":\"http://www.unknown.com/?lang=fr\"}],\"properties\":" + "{\"Autre lien\":{\"text\":\"Cedemo\",\"href\":\"http://www.unknown.com\"}}}"; myParams.putString("attachment", URLEncoder.encode(attachment); mFacebook.dialog(Option.this, "stream.publish",myParams, new SampleDialogListener()); </code></pre> <p>And then, later on:</p> <pre><code>public class SampleDialogListener extends BaseDialogListener { public void onComplete(Bundle values) { final String postId = values.getString("post_id"); if (postId != null) { Log.d("Facebook-Example", "Dialog Success! post_id=" + postId); mAsyncRunner.request(postId,values, new WallPostRequestListener()); } else { Log.d("Facebook-Example", "No wall post made"); } } } </code></pre> <p>I didn't wrote the attachment String, It's just a test taken from another question made in this forum. Anyway, when I call myAsync.request, my app shows an error message, how am I supposed to pass the attachment to my dialog? Hope I've been clear enough.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload