An error occurred while posting to your friends wall using Facebook android sdk 3.6 (latest version)

I get the following error when posting to friends wall using Android Android sdk

enter image description here

This is how I wrote the post code.

private void publishFeedDialog() { Bundle params = new Bundle(); params.putString("name", "Facebook SDK for Android"); params.putString("caption", "Build great social apps and get more installs."); params.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."); params.putString("link", "https://developers.facebook.com/android"); params.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"); params.putString("to", "xxxxx81890xxxxx"); WebDialog feedDialog = ( new WebDialog.FeedDialogBuilder(this, Session.getActiveSession(), params)) .setOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { // TODO Auto-generated method stub 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) { Toast.makeText(MainActivity.this.getApplicationContext(), "Posted story, id: "+postId, Toast.LENGTH_SHORT).show(); } else { // User clicked the Cancel button Toast.makeText(MainActivity.this.getApplicationContext(), "Publish cancelled", Toast.LENGTH_SHORT).show(); } } else if (error instanceof FacebookOperationCanceledException) { // User clicked the "x" button Toast.makeText(MainActivity.this.getApplicationContext(), "Publish cancelled", Toast.LENGTH_SHORT).show(); } else { // Generic, ex: network error Toast.makeText(MainActivity.this.getApplicationContext(), "Error posting story", Toast.LENGTH_SHORT).show(); } } }) .build(); feedDialog.show(); } 

when i delete this line

 params.putString("to", "xxxxx381890xxxxx"); 

from the code above, it was successfully posted on my wall. can anyone suggest me how to fix this problem? I really did not understand where I was doing wrong.

thanks

Logcat:

 02-10 19:02:54.567: D/WML_SISO(12014): InitPasteboardJni 02-10 19:02:54.577: W/webcore(12014): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up. 02-10 19:02:54.577: W/webcore(12014): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:2510) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.WebViewCore$EventHub.access$12800(WebViewCore.java:1219) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:2622) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.WebView.sendOurVisibleRect(WebView.java:3894) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:976) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.ZoomManager.access$2100(ZoomManager.java:57) 02-10 19:02:54.577: W/webcore(12014): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:1509) 02-10 19:02:54.577: W/webcore(12014): at android.os.Handler.handleCallback(Handler.java:605) 02-10 19:02:54.577: W/webcore(12014): at android.os.Handler.dispatchMessage(Handler.java:92) 02-10 19:02:54.577: W/webcore(12014): at android.os.Looper.loop(Looper.java:137) 02-10 19:02:54.577: W/webcore(12014): at android.app.ActivityThread.main(ActivityThread.java:4517) 02-10 19:02:54.577: W/webcore(12014): at java.lang.reflect.Method.invokeNative(Native Method) 02-10 19:02:54.577: W/webcore(12014): at java.lang.reflect.Method.invoke(Method.java:511) 02-10 19:02:54.577: W/webcore(12014): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:985) 02-10 19:02:54.577: W/webcore(12014): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:752) 02-10 19:02:54.577: W/webcore(12014): at dalvik.system.NativeStart.main(Native Method) 
0
source share

Source: https://habr.com/ru/post/953124/


All Articles