@Override
 public void share(
     Activity context,
     Entity entity,
     PropagationInfo urlSet,
     String comment,
     boolean autoAuth,
     ActionType type,
     SocialNetworkListener listener) {
   if (listener != null) {
     listener.onBeforePost(context, getNetwork(), null);
   }
   super.share(context, entity, urlSet, comment, autoAuth, type, listener);
 }
  @Override
  public void postPhoto(
      Activity parent,
      String appId,
      String link,
      String caption,
      Uri photoUri,
      SocialNetworkListener listener) {

    try {
      Bundle params = new Bundle();
      params.putString("caption", caption + ": " + link);
      params.putByteArray("photo", facebookImageUtils.scaleImage(parent, photoUri));

      Facebook fb = newFacebook(appId);

      final FacebookSessionStore store = newFacebookSessionStore();

      store.restore(fb, parent);

      AsyncFacebookRunner runner = newAsyncFacebookRunner(fb);

      RequestListener requestListener = newRequestListener(parent, listener);

      runner.request("me/photos", params, "POST", requestListener, null);
    } catch (IOException e) {
      if (listener != null) {
        listener.onError(parent, SocialNetwork.FACEBOOK, "Unable to scale image for upload", e);
      }

      if (logger != null) {
        logger.error("Unable to scale image for upload", e);
      } else {
        e.printStackTrace();
      }
    }
  }