2015-06-24 4 views
-1

У меня есть две возможности поделиться изображением на facebook.One, чтобы прямо отправить изображение на пользователя s wall and the other to share image on a facebook fan page that i have created recently by the users. I done share image on user s стена успешно. Но я не знаю, как обмениваться имиджем на странице facebook.Как обмениваться фотографиями на определенной странице фейсбука на андроиде?

+0

попробовать [это] (https://developers.facebook.com/docs/graph-api/reference/v2.3/page/feed#publish) – calvinfly

+0

Благодаря @calvinfly я примерил, что теперь его 's working.Thanks много – Selvam

ответ

0
private void shareToPage() { 
//Getting image intent as bytearray 
    byte[] byteArray = getIntent().getByteArrayExtra("image"); 
      Bundle bundle = new Bundle(); 
      bundle.putByteArray("object_attachment", byteArray); 
      bundle.putString("message", "some message here"); 

      GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(), 
        "/" + pageID + "/photos", 
        bundle, 
        HttpMethod.POST, 
        new GraphRequest.Callback() { 

         @Override 
         public void onCompleted(GraphResponse graphResponse) { 
          Log.d("Page response==>",graphResponse.toString()); 

           Toast.makeText(SharePageActivity.this, "Photo uploaded successfully", Toast.LENGTH_LONG).show(); 
    }); 
      graphRequest.executeAsync(); 
    } 
Смежные вопросы