Java Code Examples for com.facebook.FacebookCallback

The following examples show how to use com.facebook.FacebookCallback. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: UberClone   Source File: Login.java    License: MIT License 7 votes vote down vote up
private void setupFacebookStuff() {

        // This should normally be on your application class
        FacebookSdk.sdkInitialize(getApplicationContext());

        mLoginManager = LoginManager.getInstance();
        mFacebookCallbackManager = CallbackManager.Factory.create();

        LoginManager.getInstance().registerCallback(mFacebookCallbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                //login
                firebaseHelper.registerByFacebookAccount();
            }

            @Override
            public void onCancel() {
                Toast.makeText(Login.this,"The login was canceled",Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onError(FacebookException error) {
                Toast.makeText(Login.this,"There was an error in the login",Toast.LENGTH_SHORT).show();
            }
        });
    }
 
Example 2
Source Project: social-app-android   Source File: LoginActivity.java    License: Apache License 2.0 6 votes vote down vote up
private void initFacebookSignIn() {
    mCallbackManager = CallbackManager.Factory.create();
    LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            LogUtil.logDebug(TAG, "facebook:onSuccess:" + loginResult);
            presenter.handleFacebookSignInResult(loginResult);
        }

        @Override
        public void onCancel() {
            LogUtil.logDebug(TAG, "facebook:onCancel");
        }

        @Override
        public void onError(FacebookException error) {
            LogUtil.logError(TAG, "facebook:onError", error);
            showSnackBar(error.getMessage());
        }
    });

    findViewById(R.id.facebookSignInButton).setOnClickListener(v -> presenter.onFacebookSignInClick());
}
 
Example 3
Source Project: UberClone   Source File: Login.java    License: MIT License 6 votes vote down vote up
private void setupFacebookStuff() {

        // This should normally be on your application class
        FacebookSdk.sdkInitialize(getApplicationContext());

        mLoginManager = LoginManager.getInstance();
        mFacebookCallbackManager = CallbackManager.Factory.create();

        LoginManager.getInstance().registerCallback(mFacebookCallbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                //login
                firebaseHelper.registerByFacebookAccount();
            }

            @Override
            public void onCancel() {
                Toast.makeText(Login.this,"The login was canceled",Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onError(FacebookException error) {
                Toast.makeText(Login.this,"There was an error in the login",Toast.LENGTH_SHORT).show();
            }
        });
    }
 
Example 4
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 6 votes vote down vote up
public static void registerSharerCallback(
        final int requestCode,
        final CallbackManager callbackManager,
        final FacebookCallback<Sharer.Result> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }

    ((CallbackManagerImpl) callbackManager).registerCallback(
            requestCode,
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return handleActivityResult(
                            requestCode,
                            resultCode,
                            data,
                            getShareResultProcessor(callback));
                }
            });
}
 
Example 5
Source Project: kognitivo   Source File: VideoUploader.java    License: Apache License 2.0 6 votes vote down vote up
public static synchronized void uploadAsync(
        ShareVideoContent videoContent,
        String graphNode,
        FacebookCallback<Sharer.Result> callback)
        throws FileNotFoundException {
    if (!initialized) {
        registerAccessTokenTracker();
        initialized = true;
    }

    Validate.notNull(videoContent, "videoContent");
    Validate.notNull(graphNode, "graphNode");
    ShareVideo video = videoContent.getVideo();
    Validate.notNull(video, "videoContent.video");
    Uri videoUri = video.getLocalUrl();
    Validate.notNull(videoUri, "videoContent.video.localUrl");

    UploadContext uploadContext = new UploadContext(videoContent, graphNode, callback);
    uploadContext.initialize();

    pendingUploads.add(uploadContext);

    enqueueUploadStart(
            uploadContext,
            0);
}
 
Example 6
Source Project: kognitivo   Source File: VideoUploader.java    License: Apache License 2.0 6 votes vote down vote up
private UploadContext(
        ShareVideoContent videoContent,
        String graphNode,
        FacebookCallback<Sharer.Result> callback) {
    // Store off the access token right away so that under no circumstances will we
    // end up with different tokens between phases. We will rely on the access token tracker
    // to cancel pending uploads.
    this.accessToken = AccessToken.getCurrentAccessToken();
    this.videoUri = videoContent.getVideo().getLocalUrl();
    this.title = videoContent.getContentTitle();
    this.description = videoContent.getContentDescription();
    this.ref = videoContent.getRef();
    this.graphNode = graphNode;
    this.callback = callback;
    this.params = videoContent.getVideo().getParameters();
}
 
Example 7
Source Project: kognitivo   Source File: ShareApi.java    License: Apache License 2.0 6 votes vote down vote up
private void shareLinkContent(final ShareLinkContent linkContent,
                              final FacebookCallback<Sharer.Result> callback) {
    final GraphRequest.Callback requestCallback = new GraphRequest.Callback() {
        @Override
        public void onCompleted(GraphResponse response) {
            final JSONObject data = response.getJSONObject();
            final String postId = (data == null ? null : data.optString("id"));
            ShareInternalUtility.invokeCallbackWithResults(callback, postId, response);
        }
    };
    final Bundle parameters = new Bundle();
    this.addCommonParameters(parameters, linkContent);
    parameters.putString("message", this.getMessage());
    parameters.putString("link", Utility.getUriString(linkContent.getContentUrl()));
    parameters.putString("picture", Utility.getUriString(linkContent.getImageUrl()));
    parameters.putString("name", linkContent.getContentTitle());
    parameters.putString("description", linkContent.getContentDescription());
    parameters.putString("ref", linkContent.getRef());
    new GraphRequest(
            AccessToken.getCurrentAccessToken(),
            getGraphPath("feed"),
            parameters,
            HttpMethod.POST,
            requestCallback).executeAsync();
}
 
Example 8
Source Project: kognitivo   Source File: JoinAppGroupDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
 
Example 9
Source Project: kognitivo   Source File: CreateAppGroupDialog.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected void registerCallbackImpl(
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results.getString("id")));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(getRequestCode(), callbackManagerCallback);
}
 
Example 10
Source Project: kognitivo   Source File: LoginManager.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Registers a login callback to the given callback manager.
 * @param callbackManager The callback manager that will encapsulate the callback.
 * @param callback The login callback that will be called on login completion.
 */
public void registerCallback(
        final CallbackManager callbackManager,
        final FacebookCallback<LoginResult> callback) {
    if (!(callbackManager instanceof CallbackManagerImpl)) {
        throw new FacebookException("Unexpected CallbackManager, " +
                "please use the provided Factory.");
    }
    ((CallbackManagerImpl) callbackManager).registerCallback(
            CallbackManagerImpl.RequestCodeOffset.Login.toRequestCode(),
            new CallbackManagerImpl.Callback() {
                @Override
                public boolean onActivityResult(int resultCode, Intent data) {
                    return LoginManager.this.onActivityResult(
                            resultCode,
                            data,
                            callback);
                }
            }
    );
}
 
Example 11
Source Project: social-login-helper-Deprecated-   Source File: FacebookHelper.java    License: MIT License 6 votes vote down vote up
public FacebookHelper(@NonNull FacebookListener facebookListener) {
  mListener = facebookListener;
  mCallBackManager = CallbackManager.Factory.create();
  FacebookCallback<LoginResult> mCallBack = new FacebookCallback<LoginResult>() {
    @Override public void onSuccess(LoginResult loginResult) {
      mListener.onFbSignInSuccess(loginResult.getAccessToken().getToken(),
          loginResult.getAccessToken().getUserId());
    }

    @Override public void onCancel() {
      mListener.onFbSignInFail("User cancelled operation");
    }

    @Override public void onError(FacebookException e) {
      mListener.onFbSignInFail(e.getMessage());
    }
  };
  LoginManager.getInstance().registerCallback(mCallBackManager, mCallBack);
}
 
Example 12
Source Project: AndroidBlueprints   Source File: FacebookHelper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Register call back manager.
 *
 * @param activity the activity
 */
private void registerCallBackManager(final Activity activity) {
    LoginManager.getInstance()
            .registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
                @Override
                public void onSuccess(LoginResult loginResult) {
                    mLoginResult = loginResult;
                    getUserProfile(activity);
                }

                @Override
                public void onCancel() {
                    mFacebookLoginResultCallBack.onFacebookLoginCancel();
                }

                @Override
                public void onError(FacebookException error) {
                    mFacebookLoginResultCallBack.onFacebookLoginError(error);
                }
            });
}
 
Example 13
Source Project: AndroidBlueprints   Source File: FacebookHelper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Register call back manager to Google log in button.
 *
 * @param activity    the activity
 * @param loginButton the login button
 */
private void registerCallBackManager(final Activity activity, LoginButton loginButton) {
    loginButton.registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            mLoginResult = loginResult;
            getUserProfile(activity);
        }

        @Override
        public void onCancel() {
            mFacebookLoginResultCallBack.onFacebookLoginCancel();
        }

        @Override
        public void onError(FacebookException error) {
            mFacebookLoginResultCallBack.onFacebookLoginError(error);
        }
    });
}
 
Example 14
Source Project: social-app-android   Source File: LoginActivity.java    License: Apache License 2.0 6 votes vote down vote up
private void initFacebookSignIn() {
    mCallbackManager = CallbackManager.Factory.create();
    LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            LogUtil.logDebug(TAG, "facebook:onSuccess:" + loginResult);
            presenter.handleFacebookSignInResult(loginResult);
        }

        @Override
        public void onCancel() {
            LogUtil.logDebug(TAG, "facebook:onCancel");
        }

        @Override
        public void onError(FacebookException error) {
            LogUtil.logError(TAG, "facebook:onError", error);
            showSnackBar(error.getMessage());
        }
    });

    findViewById(R.id.facebookSignInButton).setOnClickListener(v -> presenter.onFacebookSignInClick());
}
 
Example 15
Source Project: HaiNaBaiChuan   Source File: LoginFragment.java    License: Apache License 2.0 6 votes vote down vote up
private void initFaceBookLogin() {
    callbackManager = CallbackManager.Factory.create();
    btnLoginFacebook.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            showDialog();
            presenter.requestFacebook(loginResult);
            LogUtil.e2(loginResult.getAccessToken().toString());
        }

        @Override
        public void onCancel() {

        }

        @Override
        public void onError(FacebookException error) {

        }
    });
}
 
Example 16
public void navigateToFacebookSignUpForResult(Collection<String> permissions) {
  facebookLoginManager.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
    @Override public void onSuccess(LoginResult loginResult) {
      facebookLoginSubject.call(
          new FacebookLoginResult(loginResult, FacebookLoginResult.STATE_SUCCESS, null));
    }

    @Override public void onCancel() {
      facebookLoginSubject.call(
          new FacebookLoginResult(null, FacebookLoginResult.STATE_CANCELLED, null));
    }

    @Override public void onError(FacebookException error) {
      facebookLoginSubject.call(
          new FacebookLoginResult(null, FacebookLoginResult.STATE_ERROR, error));
    }
  });
  facebookLoginManager.logInWithReadPermissions(activityNavigator.getActivity(), permissions);
}
 
Example 17
Source Project: Learning-Resources   Source File: FireSignin.java    License: MIT License 6 votes vote down vote up
private void signInFacebook() {

        mPrgrsbrMain.setVisibility(View.VISIBLE);
        LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile", "email"));
        LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {

                // Facebook Sign In was successful, authenticate with Firebase
                firebaseAuthWithFacebook(loginResult.getAccessToken());
            }

            @Override
            public void onCancel() {
                LogManager.printLog(LOGTYPE_DEBUG, "facebook:onCancel");
                mPrgrsbrMain.setVisibility(View.GONE);
            }

            @Override
            public void onError(FacebookException error) {
                Log.d(LOG_TAG, "facebook:onError", error);
                mPrgrsbrMain.setVisibility(View.GONE);
            }
        });
    }
 
Example 18
Source Project: edx-app-android   Source File: FacebookAuth.java    License: Apache License 2.0 6 votes vote down vote up
public FacebookAuth(Activity activity) {
    super(activity);
    callbackManager = CallbackManager.Factory.create();
    LoginManager.getInstance().registerCallback(callbackManager,
            new FacebookCallback<LoginResult>() {
                @Override
                public void onSuccess(LoginResult loginResult) {
                    if (callback != null) {
                        callback.onLogin(loginResult.getAccessToken().getToken());
                    }
                    logger.debug("Facebook Logged in successfully.");
                }

                @Override
                public void onCancel() {
                    logger.debug("Facebook Log in canceled.");
                }

                @Override
                public void onError(FacebookException error) {
                    logger.error(error);
                }
            });
}
 
Example 19
Source Project: FimiX8-RE   Source File: FaceBookManager.java    License: MIT License 5 votes vote down vote up
public void login(Context context, final LoginCallback callback) {
    this.loginCallback = callback;
    this.mCallbackManager = Factory.create();
    FacebookSdk.sdkInitialize(context);
    this.loginManager = LoginManager.getInstance();
    this.loginManager.registerCallback(this.mCallbackManager, new FacebookCallback<LoginResult>() {
        public void onSuccess(LoginResult loginResult) {
            GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphJSONObjectCallback() {
                public void onCompleted(JSONObject object, GraphResponse response) {
                    Log.i(FaceBookManager.TAG, "onCompleted: ");
                    if (object != null) {
                        Map<String, String> map = new HashMap();
                        map.put("name", object.optString("name"));
                        map.put(BlockInfo.KEY_UID, object.optString("id"));
                        FaceBookManager.this.loginCallback.loginSuccess(map);
                    }
                }
            }).executeAsync();
        }

        public void onCancel() {
            Log.i(FaceBookManager.TAG, "onCancel: ");
        }

        public void onError(FacebookException error) {
            Log.i(FaceBookManager.TAG, "onError: ");
            callback.loginFail(error.getMessage());
        }
    });
    LoginManager.getInstance().logInWithReadPermissions((Activity) context, Arrays.asList(new String[]{"public_profile", "user_friends"}));
}
 
Example 20
private void facebookShare(String caption, String mediaPath) {
    final File media = new File(mediaPath);
    final Uri uri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".social.share.fileprovider",
            media);
    final SharePhoto photo = new SharePhoto.Builder().setImageUrl(uri).setCaption(caption).build();
    final SharePhotoContent content = new SharePhotoContent.Builder().addPhoto(photo).build();
    final ShareDialog shareDialog = new ShareDialog(activity);
    shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
        @Override
        public void onSuccess(Sharer.Result result) {
            channel.invokeMethod("onSuccess", null);
            Log.d("SocialSharePlugin", "Sharing successfully done.");
        }

        @Override
        public void onCancel() {
            channel.invokeMethod("onCancel", null);
            Log.d("SocialSharePlugin", "Sharing cancelled.");
        }

        @Override
        public void onError(FacebookException error) {
            channel.invokeMethod("onError", error.getMessage());
            Log.d("SocialSharePlugin", "Sharing error occurred.");
        }
    });

    if (ShareDialog.canShow(SharePhotoContent.class)) {
        shareDialog.show(content);
    }
}
 
Example 21
private void facebookShareLink(String quote, String url) {
    final Uri uri = Uri.parse(url);
    final ShareLinkContent content = new ShareLinkContent.Builder().setContentUrl(uri).setQuote(quote).build();
    final ShareDialog shareDialog = new ShareDialog(activity);
    shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
        @Override
        public void onSuccess(Sharer.Result result) {
            channel.invokeMethod("onSuccess", null);
            Log.d("SocialSharePlugin", "Sharing successfully done.");
        }

        @Override
        public void onCancel() {
            channel.invokeMethod("onCancel", null);
            Log.d("SocialSharePlugin", "Sharing cancelled.");
        }

        @Override
        public void onError(FacebookException error) {
            channel.invokeMethod("onError", error.getMessage());
            Log.d("SocialSharePlugin", "Sharing error occurred.");
        }
    });

    if (ShareDialog.canShow(ShareLinkContent.class)) {
        shareDialog.show(content);
    }
}
 
Example 22
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
public static void invokeCallbackWithException(
        FacebookCallback<Sharer.Result> callback,
        final Exception exception) {
    if (exception instanceof FacebookException) {
        invokeOnErrorCallback(callback, (FacebookException) exception);
        return;
    }
    invokeCallbackWithError(
            callback,
            "Error preparing share content: " + exception.getLocalizedMessage());
}
 
Example 23
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
public static void invokeCallbackWithResults(
        FacebookCallback<Sharer.Result> callback,
        final String postId,
        final GraphResponse graphResponse) {
    FacebookRequestError requestError = graphResponse.getError();
    if (requestError != null) {
        String errorMessage = requestError.getErrorMessage();
        if (Utility.isNullOrEmpty(errorMessage)) {
            errorMessage = "Unexpected error sharing.";
        }
        invokeOnErrorCallback(callback, graphResponse, errorMessage);
    } else {
        invokeOnSuccessCallback(callback, postId);
    }
}
 
Example 24
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
static void invokeOnSuccessCallback(
        FacebookCallback<Sharer.Result> callback,
        String postId) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_SUCCEEDED, null);
    if (callback != null) {
        callback.onSuccess(new Sharer.Result(postId));
    }
}
 
Example 25
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        GraphResponse response,
        String message) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, message);
    if (callback != null) {
        callback.onError(new FacebookGraphResponseException(response, message));
    }
}
 
Example 26
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        String message) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, message);
    if (callback != null) {
        callback.onError(new FacebookException(message));
    }
}
 
Example 27
Source Project: kognitivo   Source File: ShareInternalUtility.java    License: Apache License 2.0 5 votes vote down vote up
static void invokeOnErrorCallback(
        FacebookCallback<Sharer.Result> callback,
        FacebookException ex) {
    logShareResult(AnalyticsEvents.PARAMETER_SHARE_OUTCOME_ERROR, ex.getMessage());
    if (callback != null) {
        callback.onError(ex);
    }
}
 
Example 28
Source Project: kognitivo   Source File: LikeDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void registerCallbackImpl (
        final CallbackManagerImpl callbackManager,
        final FacebookCallback<Result> callback) {
    final ResultProcessor resultProcessor = (callback == null)
            ? null
            : new ResultProcessor(callback) {
        @Override
        public void onSuccess(AppCall appCall, Bundle results) {
            callback.onSuccess(new Result(results));
        }
    };

    CallbackManagerImpl.Callback callbackManagerCallback = new CallbackManagerImpl.Callback() {
        @Override
        public boolean onActivityResult(int resultCode, Intent data) {
            return ShareInternalUtility.handleActivityResult(
                    getRequestCode(),
                    resultCode,
                    data,
                    resultProcessor);
        }
    };

    callbackManager.registerCallback(
            getRequestCode(),
            callbackManagerCallback);
}
 
Example 29
Source Project: kognitivo   Source File: ShareApi.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Convenience method to share a piece of content.
 *
 * @param shareContent the content to share.
 * @param callback     the callback to call once the share is complete.
 */
public static void share(
        final ShareContent shareContent,
        final FacebookCallback<Sharer.Result> callback) {
    new ShareApi(shareContent)
            .share(callback);
}
 
Example 30
Source Project: kognitivo   Source File: ShareApi.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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);
    }
}