2015-06-04 122 views
0

我想分享圖像從我的Android應用程序在Facebook上,我還沒有完成yet.I想確定它是否共享Facebook上的圖像正確。我寫的代碼共享圖像,我認爲它但是,當我運行我的應用程序時,臉書問我是否接受我的應用程序來獲取我的信息,這是迄今爲止工作良好。但只是在sharePhoto之前...有這個錯誤publish_actions權限是missing.Does它意味着我有釋放我的應用程序使用Facebook嗎?不能我使用我的管理員或Facebook的測試人員帳戶分享圖像?我只是想知道,如果我的應用程序共享圖像properly.ty 這是我的代碼安卓Facebook的sdk共享圖像

permissionNeeds= Arrays.asList("publish_actions"); 
    Bitmap image = BitmapFactory.decodeResource(getApplicationContext().getResources(), 
      R.mipmap.ic_launcher); 
    SharePhoto photo = new SharePhoto.Builder() 
      .setBitmap(image) 
      .setUserGenerated(true) 
      .build(); 

    SharePhotoContent content = new SharePhotoContent.Builder() 
      .addPhoto(photo) 
      .build(); 
    ShareApi.share(content, null); 

回答

0

爲了確保您的Facebook應用程序在開發模式,而不是公衆。而你的facebook acc在Facebook應用的管理員或測試者列表中

+0

如何讓我的應用開發者模式 –

0

你顯然不能在登錄時請求share_photo權限。從你的代碼片斷中,你沒有與permissionNeeds做任何事情。

必須調用setPublishPermissions上的登錄按鈕,或者logInWithPublishPermissions如果你使用的LoginManager,並傳入請求的權限(你在這裏叫permissionNeeds)的列表。