Facebook post to wall gives an exception

I want to post a text message on my facebook wall. My sample code is:

public void postOnMyFacebookWall(String msg) { Log.d("Tests", "Testing graph API wall post"); try { String response = facebook.request("me"); Bundle parameters = new Bundle(); parameters.putString("message", msg); parameters.putString("description", "test test test"); response = facebook.request("me/feed", parameters, "POST"); Log.d("Tests", "got response: " + response); if (response == null || response.equals("") || response.equals("false")) { Log.v("Error", "Blank response"); } } catch(Exception e) { e.printStackTrace(); } } 

I called the authorization function and got access_token before calling this function. But received the following type of errors:

 key message expected byte[] but value was a java.lang.String. The default value <null> was returned. 

And when I see facebook on my wall, a message is also visible there ... Any idea ... ???

+1
source share
1 answer
 key message expected byte[] but value was a java.lang.String. The default value <null> was returned. 

This error will not affect your message on the wall, But update your code, this old method for publishing on the wall, try with this code for publishing on Facebook Wall:

 Bundle parameters = new Bundle(); parameters.putString("message", "Text is lame. Listen up:"); parameters.putString("method", "stream.publish"); String response = ZValues.authenticatedFacebook.request(parameters); Log.v("response", response); 
+2
source

All Articles