@Override public void onError(FacebookException exception) { ShareInternalUtility.invokeCallbackWithException(callback, exception); } };
private void shareVideoContent(final ShareVideoContent videoContent, final FacebookCallback<Sharer.Result> callback) { try { VideoUploader.uploadAsync(videoContent, getGraphNode(), callback); } catch (final FileNotFoundException ex) { ShareInternalUtility.invokeCallbackWithException(callback, ex); } }
@Override public void onComplete() { try { handleImagesOnAction(parameters); new GraphRequest( AccessToken.getCurrentAccessToken(), getGraphPath( URLEncoder.encode(action.getActionType(), DEFAULT_CHARSET)), parameters, HttpMethod.POST, requestCallback).executeAsync(); } catch (final UnsupportedEncodingException ex) { ShareInternalUtility.invokeCallbackWithException(callback, ex); } }
params = getSharePhotoCommonParameters(photo, photoContent); } catch (JSONException e) { ShareInternalUtility.invokeCallbackWithException(callback, e); return; ShareInternalUtility.invokeCallbackWithException(callback, ex);
/** * Share the content. * * @param callback the callback to call once the share is complete. */ public void share(FacebookCallback<Sharer.Result> callback) { if (!this.canShare()) { ShareInternalUtility.invokeCallbackWithError( callback, "Insufficient permissions for sharing content via Api."); return; } final ShareContent shareContent = this.getShareContent(); // Validate the share content try { ShareContentValidation.validateForApiShare(shareContent); } catch (FacebookException ex) { ShareInternalUtility.invokeCallbackWithException(callback, ex); return; } if (shareContent instanceof ShareLinkContent) { this.shareLinkContent((ShareLinkContent) shareContent, callback); } else if (shareContent instanceof SharePhotoContent) { this.sharePhotoContent((SharePhotoContent) shareContent, callback); } else if (shareContent instanceof ShareVideoContent) { this.shareVideoContent((ShareVideoContent) shareContent, callback); } else if (shareContent instanceof ShareOpenGraphContent) { this.shareOpenGraphContent((ShareOpenGraphContent) shareContent, callback); } }