Facebook的我/饲料只能张贴在开发商仅占 [英] Facebook me/feed can only post on developers account only

查看:94
本文介绍了Facebook的我/饲料只能张贴在开发商仅占的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个奇怪的现象here.While张贴到Facebook的我想我的应用程序绕过要求写的东西,并显示自己的自定义dialog.For这个原因,我不得不使用对话框我/饲料.The应用程序当我发布一些在开发account.But当我尝试发布它的某个时候返回任何内容或某个时候返回一些其他帐户正常工作:

  12月8日至21号:26:29.332:D / Facebook的-的Util(6796):POST网址:https://graph.facebook.com/me/feed
十二月8日至21日:26:29.722:D /测试(6796):得到了响应:{错误:{消息:(#200)的用户没有授权的应用程序来执行此操作,型:OAuthException,code:200}}
 

我真搞不清楚是什么错误,我做here.Why消息没有公布以外的开发者账户..?

这是我的相关code:

 如果(facebook.isSessionValid()){
                            facebook.authorize(BoonDriveActivity.this,
                                    新的String [] {publish_stream,publish_actions,manage_pages,status_update} //这是权限
                                    新DialogListener(){

                                        @覆盖
                                        公共无效OnCancel的(){
                                            //函数处理取消事件
                                        }

                                        @覆盖
                                        公共无效的onComplete(束值){
                                            //函数来处理完成事件
                                            //编辑preferences和更新Facebook的acess_token
                                            最终的共享preferences.Editor编辑= M prefs.edit();
                                            editor.putString(access_token
                                                    facebook.getAccessToken());
                                            editor.putLong(access_expires
                                                    facebook.getAccessExpires());
                                            editor.commit();
                                            LayoutInflater充气= BoonDriveActivity.this.getLayoutInflater();
                                            查看布局= inflater.inflate(R.layout.createsharedialoglinkedin,NULL);
                                            最后AlertDialog D1 =新AlertDialog.Builder(BoonDriveActivity.this)
                                            //此处是您的其他选项...
                                            .setView(布局)
                                            .create(); //我的自定义对话框
                                            。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_m​​essage);
                                            ln_btn_share =(按钮)layout.findViewById(R.id.btn_share);
                                            ln_btn_showlink =(按钮)layout.findViewById(R.id.btn_showlink);
                                            lnshowlink =(EditText上)layout.findViewById(R.id.et_showlink);
                                            ln_btn_share.setText(在Facebook上分享);
                                            ln_btn_showlink.setOnClickListener(新View.OnClickListener(){

                                                @覆盖
                                                公共无效的onClick(视图v){
                                                    // TODO自动生成方法存根
                                                    ln_btn_showlink.setVisibility(View.GONE);
                                                    lnshowlink.setVisibility(View.VISIBLE);
                                                    lnshowlink.setText(finallink);
                                                }
                                            });
                                            lntxtfilename.setText(股份++文件名+有:+);

                                            ln_btn_share.setOnClickListener(新View.OnClickListener(){

                                                @覆盖
                                                公共无效的onClick(视图v){
                                                    // TODO自动生成方法存根
                                                    //的String =((GlobalFilename)BoonDriveActivity.this.getApplication())getGlobalState()。
                                                    如果(lnetmessage.length()== 0)
                                                    {
                                                        Toast.makeText(BoonDriveActivity.this,请输入信息,Toast.LENGTH_LONG).show();
                                                    }
                                                    其他{
                                                    。字符串为share1 = lnetmessage.getText()的toString();
                                                    //字符串finalmsg =为share1 +\ N+ S;
                                                    的System.out.println(这是最后的味精LinkedIn  - >中+ finallink);
                                                    //lnetmessage.setText(finalmsg);
                                                    // postToWall();
                                                    postToWall(为share1,finallink);
                                                     d1.dismiss();
                                                    }
                                                }
                                            });



                                        }

                                        @覆盖
                                        公共无效onerror的(DialogError错误){
                                            //函数来处理错误

                                        }

                                        @覆盖
                                        公共无效onFacebookError(FacebookError fberror){
                                            //函数来处理Facebook的错误

                                        }

                                    });
                        }



                    }
 

我搜索了很多关于这一点,但无法找到一个solution.Please帮助。

我使用下面的方法张贴到墙上:

  @燮pressWarnings(德precation)
    公共无效postToWall(字符串消息,串链接){

        捆绑参数=新包();

                parameters.putString(消息,消息+链接);
               // parameters.putString(链接的链接);
               / * parameters.putString(说明,主题股);
                parameters.putString(图片报的链接); * /
                尝试 {
                     字符串响应= facebook.request(我);
                    facebook.request(我);
             响应= facebook.request(ME /饲料,参数,POST);
            Log.d(测试,得到了回应:+响应);
            如果(响应==空|| response.equals()||
                    response.equals(假)){
                showToast(空白回应。);
            }
            其他 {
                showToast(消息发布到你的Facebook墙上!);
            }

        }赶上(例外五){
            showToast(无法​​张贴到墙上!);
            e.printStackTrace();

        }
    }
 

解决方案

如果你的程序没有任何评价,没有其他用户不是这个应用程序的管理员和开发人员都能够给予相应的权限。

这是在文档描述的:

报价:

  

如果你是一个应用程序的开发,并使用它的唯一的人,那么你的应用程序并不需要经过审查。既然你是开发商,所有的应用程序的功能应该可用。你仍然需要把你的应用程序在开发者模式,但你应该能够做到这一点,而无需通过审查。

和,顺便说一句,有没有 status_update 许可...

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..?

This is my relevant code:

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+"\n"+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:

Quote:

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.

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

这篇关于Facebook的我/饲料只能张贴在开发商仅占的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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