0
我已經添加Facebook到我的Android應用程序共享圖像,現在的事情是,只能從我的Facebook帳戶完成共享,只要我嘗試從另一個帳戶登錄,我不能發佈任何圖片這是我使用的代碼片段。任何幫助表示讚賞 `facebook在Android中集成,發佈所有帳戶的照片
Request uploadRequest = Request.newUploadPhotoRequest(
Session.getActiveSession(), bmp, new Request.Callback() {
@Override
public void onCompleted(Response response) {
Toast.makeText(FacebookUpload.this,
"Photo uploaded successfully",
Toast.LENGTH_LONG).show();
`
有一部分LYK這
`public void postImage() {
if (checkPermissions()) {
Bitmap bmp = null;
String filename = getIntent().getStringExtra("image");
try {
FileInputStream is = this.openFileInput(filename);
bmp = BitmapFactory.decodeStream(is);
is.close();
} catch (Exception e) {
e.printStackTrace();
}
Request uploadRequest = Request.newUploadPhotoRequest(
Session.getActiveSession(), bmp, new Request.Callback() {
@Override
public void onCompleted(Response response) {
Toast.makeText(FacebookUpload.this,
"Photo uploaded successfully",
Toast.LENGTH_LONG).show();
File dir = getFilesDir();
File file = new File(dir, "bitmap.png");
file.delete();
}
});
// post on user's wall.
Bundle params =uploadRequest.getParameters();
Random rand = new Random();
int rndInt = rand.nextInt(3)+1;
if(rndInt==1)
params.putString("name", "download Chummi-Lalli Mobile App from https://play.google.com/store/apps/details?id=com.interactive8.readmestories");
else if(rndInt==2)
params.putString("name","Send gifts to your loved ones from www.ekhudol.com");
else if(rndInt==3)
params.putString("name","Chummilalli brought to you by www.3leafsolutions.co.in");
else
params.putString("name","Chummilalli brought to you by www.3leafsolutions.co.in");
uploadRequest.setParameters(params);
uploadRequest.executeAsync();
}
else
requestPermissions();
}`
n只要我使用另一個帳戶我我的代碼總是轉到這個else部分requestPermission()爲什麼我總是在這裏重定向,一切正常,當我使用我自己的Facebook帳戶
我想,你可能犯了一些邏輯錯誤。在圖像上傳之前檢查你的代碼兩次。 – RAAAAM 2014-10-28 11:02:04
@Hari Ram你可以給我一個線索,我應該檢查,我已經提供給所有用戶從Facebook開發者頁面的應用程序,這不應該是足夠的,如果有問題,那麼它不應該工作無論哪個帳戶我從ryt登錄? – sapamlucy 2014-10-29 05:11:34
嗨,讓我看看完整的代碼。 – Sakthi 2014-11-18 06:13:53