Facebook me/feed 只能在开发者帐户上发帖 [英] Facebook me/feed can only post on developers account only

查看:25
本文介绍了Facebook me/feed 只能在开发者帐户上发帖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到了一个奇怪的情况.在发布到 facebook 时,我希望我的应用程序绕过对话框要求写一些东西并显示我自己的自定义对话框.因此我必须使用me/feed".应用程序当我在开发者帐户中发布内容时工作正常.但是当我尝试在其他帐户中发布时,它有时不返回任何内容或有时返回:

I am encountering a strange situation here.While posting to facebook I want my app to bypass the dialog the asks to write something and show my own customize dialog.For that reason I have to use "me/feed".The app works fine when I post something in the developers account.But when I try to post in some other account it sometime returns nothing or sometime returns:

08-21 12:26:29.332: D/Facebook-Util(6796): POST URL: https://graph.facebook.com/me/feed
08-21 12:26:29.722: D/Tests(6796): got response: {"error":{"message":"(#200) The user hasn't authorized the application to perform this action","type":"OAuthException","code":200}}

我真的很困惑我在这里犯了什么错误.为什么除了开发者帐户之外没有发布消息..?

I am really confused about what mistake I am doing here.Why the message is not posting other than the developers account..?

这是我的相关代码:

if (facebook.isSessionValid()) {
                            facebook.authorize(BoonDriveActivity.this,
                                    new String[] { "publish_stream","publish_actions","manage_pages","status_update"},//This are the permissions
                                    new DialogListener() {

                                        @Override
                                        public void onCancel() {
                                            // Function to handle cancel event
                                        }

                                        @Override
                                        public void onComplete(Bundle values) {
                                            // Function to handle complete event
                                            // Edit Preferences and update facebook acess_token
                                            final SharedPreferences.Editor editor = mPrefs.edit();
                                            editor.putString("access_token",
                                                    facebook.getAccessToken());
                                            editor.putLong("access_expires",
                                                    facebook.getAccessExpires());
                                            editor.commit();
                                            LayoutInflater inflater=BoonDriveActivity.this.getLayoutInflater();
                                            View layout=inflater.inflate(R.layout.createsharedialoglinkedin,null);
                                            final AlertDialog d1 = new AlertDialog.Builder(BoonDriveActivity.this)
                                            // Your other options here ...
                                            .setView(layout)
                                            .create();//My custom dialog
                                            d1.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
                                            d1.show();
                                            lntxtfilename=(TextView)layout.findViewById(R.id.txtfilename);
                                            lnetmessage=(EditText)layout.findViewById(R.id.et_message);
                                            ln_btn_share=(Button)layout.findViewById(R.id.btn_share);
                                            ln_btn_showlink=(Button)layout.findViewById(R.id.btn_showlink);
                                            lnshowlink=(EditText)layout.findViewById(R.id.et_showlink);
                                            ln_btn_share.setText("SHARE ON FACEBOOK");
                                            ln_btn_showlink.setOnClickListener(new View.OnClickListener() {

                                                @Override
                                                public void onClick(View v) {
                                                    // TODO Auto-generated method stub
                                                    ln_btn_showlink.setVisibility(View.GONE);
                                                    lnshowlink.setVisibility(View.VISIBLE);
                                                    lnshowlink.setText(finallink);
                                                }
                                            });
                                            lntxtfilename.setText("Share"+" "+filename+" "+"with:");

                                            ln_btn_share.setOnClickListener(new View.OnClickListener() {

                                                @Override
                                                public void onClick(View v) {
                                                    // TODO Auto-generated method stub
                                                    //String s = ((GlobalFilename)BoonDriveActivity.this.getApplication()).getGlobalState();
                                                    if(lnetmessage.length()==0)
                                                    {
                                                        Toast.makeText(BoonDriveActivity.this,"Please enter message",Toast.LENGTH_LONG).show();
                                                    }
                                                    else{
                                                    String share1 = lnetmessage.getText().toString();
                                                    //String finalmsg=share1+"
"+s;
                                                    System.out.println("This is the final msg linkedin--->"+ finallink);
                                                    //lnetmessage.setText(finalmsg);
                                                    //postToWall();
                                                    postToWall(share1,finallink);
                                                     d1.dismiss();
                                                    }
                                                }
                                            });



                                        }

                                        @Override
                                        public void onError(DialogError error) {
                                            // Function to handle error

                                        }

                                        @Override
                                        public void onFacebookError(FacebookError fberror) {
                                            // Function to handle Facebook errors

                                        }

                                    });
                        }



                    } 

我搜索了很多关于这个,但找不到解决方案.请帮助.

I searched a lot about this,but couldn't find a solution.Please help.

我正在使用以下方法发布到墙上:

I am using the following method to post to wall:

@SuppressWarnings("deprecation")
    public void postToWall(String message,String link){

        Bundle parameters = new Bundle();

                parameters.putString("message", message+link);
               // parameters.putString("link",link);
               /* parameters.putString("description", "topic share");
                parameters.putString("picture", link);*/
                try {
                     String response = facebook.request("me");
                    facebook.request("me");
             response = facebook.request("me/feed", parameters, "POST");
            Log.d("Tests", "got response: " + response);
            if (response == null || response.equals("") ||
                    response.equals("false")) {
                showToast("Blank response.");
            }
            else {
                showToast("Message posted to your facebook wall!");
            }

        } catch (Exception e) {
            showToast("Failed to post to wall!");
            e.printStackTrace();

        }
    }

推荐答案

如果您的应用尚未经过审核,则此应用的管理员和开发人员以外的其他用户都无法授予适当的权限.

If your app hasn't been reviewed yet, no other users than the admins and developers of this app are able to give to appropriate permissions.

文档中对此进行了描述:

This is described in the docs:

引用:

如果您是应用的开发者并且是唯一使用该应用的人,则您的应用无需通过审核.由于您是开发人员,因此所有应用程序功能都应该可用.您仍然需要让您的应用退出开发者模式,但您应该能够在不经过审核的情况下做到这一点.

If you're the developer of an app and are the only person using it, then your app doesn't need to go through review. Since you're the developer, all app capabilities should be available. You will still need to take your app out of developer mode, but you should be able to do that without going through review.

顺便说一句,没有 status_update 权限...

And, BTW, there is no status_update permission...

这篇关于Facebook me/feed 只能在开发者帐户上发帖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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