Search in sources :

Example 1 with FacebookDialogException

use of com.facebook.FacebookDialogException in project phonegap-facebook-plugin by Wizcorp.

the class FbDialog method callDialogListener.

private void callDialogListener(Bundle values, FacebookException error) {
    if (mListener == null) {
        return;
    }
    if (values != null) {
        mListener.onComplete(values);
    } else {
        if (error instanceof FacebookDialogException) {
            FacebookDialogException facebookDialogException = (FacebookDialogException) error;
            DialogError dialogError = new DialogError(facebookDialogException.getMessage(), facebookDialogException.getErrorCode(), facebookDialogException.getFailingUrl());
            mListener.onError(dialogError);
        } else if (error instanceof FacebookOperationCanceledException) {
            mListener.onCancel();
        } else {
            FacebookError facebookError = new FacebookError(error.getMessage());
            mListener.onFacebookError(facebookError);
        }
    }
}
Also used : FacebookOperationCanceledException(com.facebook.FacebookOperationCanceledException) FacebookDialogException(com.facebook.FacebookDialogException)

Example 2 with FacebookDialogException

use of com.facebook.FacebookDialogException in project facebook-api-android-maven by avianey.

the class FbDialog method callDialogListener.

private void callDialogListener(Bundle values, FacebookException error) {
    if (mListener == null) {
        return;
    }
    if (values != null) {
        mListener.onComplete(values);
    } else {
        if (error instanceof FacebookDialogException) {
            FacebookDialogException facebookDialogException = (FacebookDialogException) error;
            DialogError dialogError = new DialogError(facebookDialogException.getMessage(), facebookDialogException.getErrorCode(), facebookDialogException.getFailingUrl());
            mListener.onError(dialogError);
        } else if (error instanceof FacebookOperationCanceledException) {
            mListener.onCancel();
        } else {
            FacebookError facebookError = new FacebookError(error.getMessage());
            mListener.onFacebookError(facebookError);
        }
    }
}
Also used : FacebookOperationCanceledException(com.facebook.FacebookOperationCanceledException) FacebookDialogException(com.facebook.FacebookDialogException)

Aggregations

FacebookDialogException (com.facebook.FacebookDialogException)2 FacebookOperationCanceledException (com.facebook.FacebookOperationCanceledException)2