1.페이스북의 LoginButton에 setReadPermissions기을 사용하여 publish_actions을 추가한다
mFaceBookLoginButton= (LoginButton) findViewById(R.id.facebook_login_button);
//권한을 신청한다mFaceBookLoginButton.setReadPermissions(Arrays.asList("public_profile, email, user_birthday,publish_actions"));
2.ShareApi.share을 사용하여 공유한다
Bitmap bitmap= BitmapFactory.decodeFile(filepath);
SharePhoto photo=new SharePhoto.Builder() .setBitmap(bitmap) .build();SharePhotoContent content=new SharePhotoContent.Builder() .addPhoto(photo) .build(); //간편 공유시 사용ShareApi.share(content, new FacebookCallback<Sharer.Result>() { @Override public void onSuccess(Sharer.Result result) { MakeContent.getInstance().ContextLoggerInfo(result.toString()); } @Override public void onCancel() { } @Override public void onError(FacebookException e) { MakeContent.getInstance().ContextLoggerInfo(e.toString()); }});
没有评论:
发表评论