Facebook API exception "This link cannot be published."

I use facebook sdk 3.6for android. I am trying to exchange links with fb wall users through my application.
I used

Bundle postParam = new Bundle();
postParam.putString("link","http://mylink.com/image/09324 324.jpg"
postParam.putString("caption","my caption");
… … …

Request request = new Request(session, "me/feed", postParam, HttpMethod.POST, reqCallback);
            RequestAsyncTask reqTask = new RequestAsyncTask(request);
            reqTask.execute();

The link contains a space .
I can visit this link from the browser simply by replacing the space character with %20. But when I do the same thing with link.replaceAll(" ","%20");, I get Facebook api exception,

ErrorMessage = This link could not be posted.
ErrorCode = 1500
ErrorType=  FacebookApiException

, url, URLEncoder %20 replaceAll String.
.

.. log cat bundle .
:. ( log cat ) , .

?

+3
3

hmmm, ,

link.replaceAll("\\s","");

\ s = , ( , ..)

:

, :)

0

Actually, I used facebook shareDialog and a real user with a status dialog box in which the application can fill out a message link, picture,description and"(the message is filled only in webview, i.e. on a device without fb application), and the user can edit / fill the status and Publish on your timeline.

This is a more convenient way to post someone to the wall, because the user can see what he is posting.

Sorry to answer my question so recently, although I already solved it.

0
source

All Articles