简体   繁体   English

Android Facebook提要发布错误

[英]Android facebook feed posting error

I'm trying to post on facebook from my android app. 我正在尝试从我的Android应用发布到Facebook。 It is working fine using previously created app id. 使用先前创建的应用程序ID可以正常工作。

Some thread is saying it is because of publish_actions. 一些线程说这是因为publish_actions。

But using new on it is giving following error. 但是在上面使用new会产生以下错误。

Response: {"error":{"message":"(#200) Requires extended permission: publish_actions","type":"OAuthException","code":200}}

My posting code is below: 我的发布代码如下:

public void shareVideoInFacebook() {

        mPrefs = getPreferences(MODE_PRIVATE);
        byte[] data = null;
//      shareAdvertisement();
        String link = "http://techslides.com/demos/sample-videos/small.mp4";
        String dataMsg = "Share for DateClip";
        Bundle param;
        facebook = new Facebook(APP_ID);
        System.out.println("Access Token: " + pref.getFbAccessToken());
        facebook.setAccessToken(pref.getFbAccessToken());
        facebook.setAccessExpires(pref.getFbAccessExpire());
        AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
        InputStream is = null;
        try {
            // is = new FileInputStream(dataPath);
            // data = readBytes(is);
            param = new Bundle();
            param.putString("message", dataMsg);
            param.putString("filename", "DateClip");
            // param.putByteArray("video", data);
            param.putString("name", "DateClip");
            param.putString("caption",
                    "Build great social apps and get more installs.");
            param.putString("description", "Watch the Video");
            param.putString("link", link);
            // param.putString("picture",
            // "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png");
            mAsyncRunner.request("me/feed", param, "POST",
                    new RequestListener() {

                        @Override
                        public void onMalformedURLException(
                                MalformedURLException e, Object state) {
                            // TODO Auto-generated method stub

                        }

                        @Override
                        public void onIOException(IOException e, Object state) {
                            // TODO Auto-generated method stub
                            System.out.println("IO Exception.........");
                        }

                        @Override
                        public void onFileNotFoundException(
                                FileNotFoundException e, Object state) {
                            // TODO Auto-generated method stub
                            // Toast.makeText(getApplicationContext(),
                            // "File not found...", Toast.LENGTH_LONG).show();
                            System.out.println("FileNotfound.........");
                        }

                        @Override
                        public void onFacebookError(FacebookError e,
                                Object state) {
                            // TODO Auto-generated method stub
                            // Toast.makeText(getApplicationContext(),
                            // "Error...", Toast.LENGTH_LONG).show();
                            System.out.println("Error.........");
                        }

                        @Override
                        public void onComplete(String response, Object state) {
                            // TODO Auto-generated method stub
                            // Toast.makeText(getApplicationContext(),
                            // "Sharing Completed...",
                            // Toast.LENGTH_LONG).show();
                            System.out
                                    .println("Successfully Sent.......................................................");
                            System.out.println("Response: " + response);
                            runOnUiThread(new Runnable() {
                                public void run() {
                                    // UI code goes here
                                    Toast.makeText(getApplicationContext(),
                                            "Successfully shared on Facebook.",
                                            Toast.LENGTH_LONG).show();
//                                  shareForPassionPoint();
                                }

                            });
                        }
                    }, null);
            // mAsyncRunner.request(dataPath, parameters, httpMethod, new F,
            // state);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

Please help me. 请帮我。

This was the case with out iOS app. 没有iOS应用程序就是这种情况。 It may be the same for Android also. Android可能也一样。

" Please get your app reviewed again. “请再次审核您的应用。

Recently, all the permissions except 3 basic ones (email, public_profile and user_friends) have been removed from the app if you had it reviewed by an older version of the Graph API. 最近,如果您通过Graph API的较早版本进行了检查,则除了3个基本权限(电子邮件,public_profile和user_friends)以外的所有权限均已从应用程序中删除。

Follow the steps as described here: https://developers.facebook.com/docs/facebook-login/review " 请按照此处所述的步骤操作: https : //developers.facebook.com/docs/facebook-login/review

Hope this helps :) 希望这可以帮助 :)

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

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