Facebook发布到墙壁给予例外 [英] Facebook post to wall give exception

查看:107
本文介绍了Facebook发布到墙壁给予例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要发布短信到我的Facebook墙上。我的例子code是:

 公共无效postOnMyFacebookWall(弦乐味精){
    Log.d(测试,测试图形API的墙后);
     尝试{
            字符串的响应= facebook.request(我);
            捆绑参数=新包();
            parameters.putString(信息,味精);
            parameters.putString(说明,测试测试测试);
            响应= facebook.request(ME /饲料,参数,
                    POST);
            Log.d(测试,得到了回应:+响应);
            如果(响应==空|| response.equals()||
                    response.equals(假)){
               Log.v(错误,空白响应);
           }
     }赶上(例外五){
         e.printStackTrace();
     }
}

我呼吁授权功能,使得调用这个函数之前得到ACCESS_TOKEN。但有以下类型的错误:

 键消息预期的byte [],但价值是java.lang.String。默认值为<&空GT;被退回。

当我在我的Facebook墙上看到,后可见有太多...
任何想法... ???


解决方案

 键消息预期的byte [],但价值是java.lang.String。默认值为<&空GT;被退回。

这个错误不会影响你的后墙上,
但是,更新code,这是旧法在后墙上,这个code为邮政的Facebook墙上尝试:

 捆绑参数=新包();
parameters.putString(信息,文字是瘸子听好了。);
parameters.putString(法,stream.publish);
串响应= ZValues​​.authenticatedFacebook.request(参数);
Log.v(回应,响应);

I want to post text message to my facebook wall. My example 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 have called authorize function and got access_token before making call to this function. But got the following type of error:

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

And when I see on my facebook wall, the post is visible there too... Any idea...???

解决方案

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

This Error will not affect your Post on wall, But update your code , that's old method for Post in wall,Try with this code for Post in 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);

这篇关于Facebook发布到墙壁给予例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆