[英]Android facebook feed posting error
我正在嘗試從我的Android應用發布到Facebook。 使用先前創建的應用程序ID可以正常工作。
一些線程說這是因為publish_actions。
但是在上面使用new會產生以下錯誤。
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();
}
}
請幫我。
沒有iOS應用程序就是這種情況。 Android可能也一樣。
“請再次審核您的應用。
最近,如果您通過Graph API的較早版本進行了檢查,則除了3個基本權限(電子郵件,public_profile和user_friends)以外的所有權限均已從應用程序中刪除。
請按照此處所述的步驟操作: https : //developers.facebook.com/docs/facebook-login/review “
希望這可以幫助 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.