2014-09-03 62 views
0

我想从我的Android应用程序发布在Facebook上。它使用以前创建的应用程序ID正常工作。Android的Facebook饲料发布错误

有些线程说这是因为publish_actions。

但是使用它会产生以下错误。

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

我张贴代码如下:

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(); 
     } 

    } 

请帮助我。

+0

http://stackoverflow.com/questions/25420126/facebook-me -feed灿只-后的开发人员账户,只 – kgandroid 2015-06-08 12:53:14

回答

0

这就是iOS应用程序的情况。对于Android也可能是相同的。

“ 请让您的应用再次审议。

近日,除3分基本的人(电子邮件,public_profile和user_friends)从应用程序已被移除所有的权限,如果你有它由一个老版本的审查。图形API

按照以下步骤如下所述:https://developers.facebook.com/docs/facebook-login/review

希望这有助于:)