简体   繁体   English

我/提要没有发布到Facebook墙上

[英]me/feed not posting to facebook wall

My facebook wall posting AND checkins were working until last week... Now they have stopped working. 我的Facebook墙贴和签到信息一直有效到上周……现在他们已停止工作。 it is really strange... I am not sure what is causing it. 真的很奇怪...我不确定是什么原因造成的。

I can login to facebook fine. 我可以登录Facebook罚款。 That is proven because I can receive my facebook profile picture. 事实证明,因为我可以收到我的Facebook个人资料照片。

At the top of the class extending activity I have specified these fields: 在类扩展活动的顶部,我指定了以下字段:

private static final String APP_ID = "286529654765268";
private static final String[] PERMISSIONS = {"publish_stream", "publish_actions", "publish_checkins", "create_event"};
private static final String TOKEN = "access_token";
private static final String EXPIRES = "expires_in";
private static final String KEY = "facebook-credentials";
private Facebook facebook = new Facebook(APP_ID);

I use the facebook object throughout my class. 我在整个课堂上都使用facebook对象。

This is how I post a message: 这是我发布消息的方式:

            defaultMessage = edittext.getText().toString();
            String response = null;
            try{
                SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("settings", 0);
            String imageUrl = "www.somesite.com/somejpg.jpg";
             Bundle params = new Bundle();
             params.putString(Facebook.TOKEN, facebook.getAccessToken());
             params.putString("caption", defaultMessage);
             params.putString("description", "a description");
             params.putString("picture", imageUrl);
             params.putString("name", "A Name");

//
             response = facebook.request("me/feed", params, "POST");
             facebook.request("me/feed", params, "POST");
            } catch(Exception e){
                e.getStackTrace();
            }
             if(response != "false" || response != null){
                 Toast.makeText(getApplicationContext(), "Status Updated Successfully!", Toast.LENGTH_LONG).show();
                 Log.e("facebook response", response);
             }

I authorize onCreate. 我授权onCreate。 Here is where I do it: 这是我要做的:

public void facebookAuthorize(){
    facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new DialogListener() {
        @Override
        public void onComplete(Bundle values) {

            String me = null;
            String id = null;

            try {
                me = facebook.request("me");
            } catch (MalformedURLException e2) {
                // TODO Auto-generated catch block
                e2.printStackTrace();
            } catch (IOException e2) {
                // TODO Auto-generated catch block
                e2.printStackTrace();
            }


            JSONObject json_id = null;
            try {
                json_id = new JSONObject(me);
            } catch (org.json.JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            try {
                id = json_id.getString("id");
            } catch (org.json.JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            Log.e("Id", id);

            URL img_value = null;
             try {
                img_value = new URL("http://graph.facebook.com/"+id+"/picture?type=large");
            } catch (MalformedURLException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
             Bitmap mIcon1 = null;
            try {
                mIcon1 = BitmapFactory.decodeStream(img_value.openConnection().getInputStream());
            } catch (IOException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
            if(mIcon1 != null){
             badge.setImageBitmap(mIcon1);
            }

            Toast.makeText(getApplicationContext(), "Successfully logged in!", Toast.LENGTH_LONG).show();


        }

        @Override
        public void onFacebookError(FacebookError error) {}

        @Override
        public void onCancel() {}

        @Override
        public void onError(com.facebook.android.DialogError e) {
            // TODO Auto-generated method stub

        }
    });

    if(restore(facebook, getApplicationContext())){
    //authorize the user. 
    facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new DialogListener() {
        @Override
        public void onComplete(Bundle values) {
            Toast.makeText(getApplicationContext(), "Successfully Logged In to facebook!", Toast.LENGTH_LONG).show();
        }

        @Override
        public void onCancel() {}

        @Override
        public void onFacebookError(com.facebook.android.FacebookError e) {
            e.printStackTrace();
                        if(facebook.isSessionValid()){
                Toast.makeText(getApplicationContext(), "Successfully Logged in to Facebook!", Toast.LENGTH_LONG).show();
                // download the users avatar

                        }
            else{
                Log.e("FACEBOOK FAIL", "Facebook has epicly failed with an error in onCreate in Social Sharing or you are logged in already");
            }
        }

        @Override
        public void onError(com.facebook.android.DialogError e) {
            // TODO Auto-generated method stub

        }
    });
    } else { save(facebook, getApplicationContext()); }

}

I do not get an error. 我没有收到错误。 It appears to work but does not appear on my wall. 它似乎可以工作,但没有出现在我的墙上。

I get a facebook response with a post id too... The application is not blocked from posting on my profile. 我也收到带有帖子ID的Facebook回复...该应用程序未被阻止在我的个人资料上发布。

Im at my wits end trying to figure out the issue. 我竭尽全力试图找出问题所在。 Any help would be great!. 任何帮助将是巨大的!

I get a facebook response with a post id too... 我也收到带有帖子ID的Facebook回复...

What response do you get if you try to look up your post via that id? 如果您尝试通过该ID查找帖子,会收到什么答复?

If you can see your post this way, then it's just not displayed on your wall (for reasons such as hiding/deleting previous posts, negative app feedback, …) 如果您可以通过这种方式看到自己的信息,那么该信息就不会显示在墙上(由于诸如隐藏/删除以前的信息,负面的应用反馈等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM