Java 类com.facebook.FacebookOperationCanceledException 实例源码

项目:kognitivo    文件:NativeProtocol.java   
public static FacebookException getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:letv    文件:NativeProtocol.java   
public static FacebookException getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }
    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }
    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }
    if (type == null || !type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookException(description);
    }
    return new FacebookOperationCanceledException(description);
}
项目:Move-Alarm_ORCA    文件:NativeProtocol.java   
public static FacebookException getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:yelo-android    文件:FbDialog.java   
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);
        }
    }
}
项目:BrillaMXAndroid    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:BrillaMXAndroid    文件:FbDialog.java   
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);
        }
    }
}
项目:TP-Formation-Android    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:TP-Formation-Android    文件:FbDialog.java   
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);
        }
    }
}
项目:AutoTimeHelper    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:AutoTimeHelper    文件:FbDialog.java   
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);
        }
    }
}
项目:BrainStudio    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:BrainStudio    文件:FbDialog.java   
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);
        }
    }
}
项目:SocioBlood    文件:NativeProtocol.java   
public static FacebookException getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:QuizUpWinner    文件:FbDialog.java   
private void callDialogListener(Bundle paramBundle, FacebookException paramFacebookException)
{
  if (this.mListener == null)
    return;
  if (paramBundle != null)
  {
    this.mListener.onComplete(paramBundle);
    return;
  }
  if ((paramFacebookException instanceof FacebookDialogException))
  {
    FacebookDialogException localFacebookDialogException = (FacebookDialogException)paramFacebookException;
    DialogError localDialogError = new DialogError(localFacebookDialogException.getMessage(), localFacebookDialogException.getErrorCode(), localFacebookDialogException.getFailingUrl());
    this.mListener.onError(localDialogError);
    return;
  }
  if ((paramFacebookException instanceof FacebookOperationCanceledException))
  {
    this.mListener.onCancel();
    return;
  }
  FacebookError localFacebookError = new FacebookError(paramFacebookException.getMessage());
  this.mListener.onFacebookError(localFacebookError);
}
项目:QuizUpWinner    文件:œ≥$4.java   
public final void onComplete(Bundle paramBundle, FacebookException paramFacebookException)
{
  if (paramFacebookException == null)
  {
    if (paramBundle.getString("post_id") != null)
    {
      ϳ.ˊ(this.ˊ.ͺ, true, false, false);
      return;
    }
    ϳ.ˊ(this.ˊ.ͺ, false, false, true);
    return;
  }
  if ((paramFacebookException instanceof FacebookOperationCanceledException))
  {
    ϳ.ˊ(this.ˊ.ͺ, false, false, true);
    return;
  }
  ϳ.ˊ(this.ˊ.ͺ, false, true, false);
}
项目:Qtino.SharingKit    文件:FbDialog.java   
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);
        }
    }
}
项目:smartenit    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    // TODO This is not going to work for JS dialogs, where the keys are not STATUS_ERROR_TYPE etc.
    // TODO However, it should keep existing dialogs functional
    String type = errorData.getString(STATUS_ERROR_TYPE);
    String description = errorData.getString(STATUS_ERROR_DESCRIPTION);

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:smartenit    文件:FbDialog.java   
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);
        }
    }
}
项目:DualRunner    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    // TODO This is not going to work for JS dialogs, where the keys are not STATUS_ERROR_TYPE etc.
    // TODO However, it should keep existing dialogs functional
    String type = errorData.getString(STATUS_ERROR_TYPE);
    String description = errorData.getString(STATUS_ERROR_DESCRIPTION);

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:DualRunner    文件:FbDialog.java   
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);
        }
    }
}
项目:p2psafety    文件:FbDialog.java   
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);
        }
    }
}
项目:MeNextAndroid    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    String type = errorData.getString(BRIDGE_ARG_ERROR_TYPE);
    if (type == null) {
        type = errorData.getString(STATUS_ERROR_TYPE);
    }

    String description = errorData.getString(BRIDGE_ARG_ERROR_DESCRIPTION);
    if (description == null) {
        description = errorData.getString(STATUS_ERROR_DESCRIPTION);
    }

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:MeNextAndroid    文件:FbDialog.java   
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);
        }
    }
}
项目:ClassParticipation2    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    // TODO This is not going to work for JS dialogs, where the keys are not STATUS_ERROR_TYPE etc.
    // TODO However, it should keep existing dialogs functional
    String type = errorData.getString(STATUS_ERROR_TYPE);
    String description = errorData.getString(STATUS_ERROR_DESCRIPTION);

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:ClassParticipation2    文件:FbDialog.java   
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);
        }
    }
}
项目:PetTinder    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    // TODO This is not going to work for JS dialogs, where the keys are not STATUS_ERROR_TYPE etc.
    // TODO However, it should keep existing dialogs functional
    String type = errorData.getString(STATUS_ERROR_TYPE);
    String description = errorData.getString(STATUS_ERROR_DESCRIPTION);

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:PetTinder    文件:FbDialog.java   
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);
        }
    }
}
项目:StoryTeller    文件:FbDialog.java   
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);
        }
    }
}
项目:HereAStory-Android    文件:NativeProtocol.java   
public static Exception getExceptionFromErrorData(Bundle errorData) {
    if (errorData == null) {
        return null;
    }

    // TODO This is not going to work for JS dialogs, where the keys are not STATUS_ERROR_TYPE etc.
    // TODO However, it should keep existing dialogs functional
    String type = errorData.getString(STATUS_ERROR_TYPE);
    String description = errorData.getString(STATUS_ERROR_DESCRIPTION);

    if (type != null && type.equalsIgnoreCase(ERROR_USER_CANCELED)) {
        return new FacebookOperationCanceledException(description);
    }

    /* TODO parse error values and create appropriate exception class */
    return new FacebookException(description);
}
项目:HereAStory-Android    文件:FbDialog.java   
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);
        }
    }
}
项目:Abelana-Android    文件:FbDialog.java   
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);
        }
    }
}
项目:localhost-android    文件:FbDialog.java   
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);
        }
    }
}
项目:facebook-api-android-maven    文件:FbDialog.java   
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);
        }
    }
}
项目:kognitivo    文件:ShareInternalUtility.java   
public static boolean handleActivityResult(
        int requestCode,
        int resultCode,
        Intent data,
        ResultProcessor resultProcessor) {
    AppCall appCall = getAppCallFromActivityResult(requestCode, resultCode, data);
    if (appCall == null) {
        return false;
    }

    NativeAppCallAttachmentStore.cleanupAttachmentsForCall(appCall.getCallId());
    if (resultProcessor == null) {
        return true;
    }

    FacebookException exception = NativeProtocol.getExceptionFromErrorData(
            NativeProtocol.getErrorDataFromResultIntent(data));
    if (exception != null) {
        if (exception instanceof FacebookOperationCanceledException) {
            resultProcessor.onCancel(appCall);
        } else {
            resultProcessor.onError(appCall, exception);
        }
    } else {
        // If here, we did not find an error in the result.
        Bundle results = NativeProtocol.getSuccessResultsFromIntent(data);
        resultProcessor.onSuccess(appCall, results);
    }

    return true;
}
项目:kognitivo    文件:NativeProtocol.java   
public static Bundle createBundleForException(FacebookException e) {
    if (e == null) {
        return null;
    }

    Bundle errorBundle = new Bundle();
    errorBundle.putString(BRIDGE_ARG_ERROR_DESCRIPTION, e.toString());
    if (e instanceof FacebookOperationCanceledException) {
        errorBundle.putString(BRIDGE_ARG_ERROR_TYPE, ERROR_USER_CANCELED);
    }

    return errorBundle;
}
项目:AndroidBackendlessChat    文件:BFacebookManager.java   
/** Re authenticate after session state changed.*/
public static Promise<Object, BError, Void> onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (DEBUG) Timber.i("Session changed state");

    // If we can start the login process with no errors this promise wont be used. 
    // The returned promise will be from the loginWithFacebook.
    Deferred<Object, BError, Void> deferred = new DeferredObject<>();

    if (exception != null)
    {
        exception.printStackTrace();
        if (exception instanceof FacebookOperationCanceledException)
        {
            deferred.reject(new BError(BError.Code.EXCEPTION, exception));
            return deferred.promise();
        }
    }

    if (state.isOpened()) {
        if (DEBUG) Timber.i("Session is open.");

        // We will need this session later to make request.
        userFacebookAccessToken = Session.getActiveSession().getAccessToken();

        return loginWithFacebook();

    } else if (state.isClosed()) {
        // Logged out of Facebook
        if (DEBUG) Timber.i("Session is closed.");
        deferred.reject(new BError(BError.Code.SESSION_CLOSED, "Facebook session is closed."));
    }


    return deferred.promise();
}
项目:AndroidBackendlessChat    文件:ChatSDKAbstractLoginActivity.java   
protected void setFacebookLogin(){
    facebookLogin.setOnErrorListener(new LoginButton.OnErrorListener() {
        @Override
        public void onError(FacebookException error) {
            if (error instanceof FacebookOperationCanceledException)
                return;
            else if (error.getMessage() != null && error.getMessage().equals("Log in attempt aborted."))
                return;

            showAlertToast("Facebook error: " + error.getMessage() + " " + error.getClass().getSimpleName());
        }
    });

    facebookLogin.setReadPermissions(Arrays.asList("email", "user_friends"));
}
项目:AndroidBackendlessChat    文件:ChatSDKAbstractLoginActivity.java   
public void onSessionStateChange(Session session, SessionState state, Exception exception){

        if (!getNetworkAdapter().facebookEnabled())
        {
            return;
        }

        if (exception != null)
        {
            exception.printStackTrace();
            if (exception instanceof FacebookOperationCanceledException)
            {
                return;
            }
        }else showOrUpdateProgDialog(getString(R.string.authenticating));

        BFacebookManager.onSessionStateChange(session, state, exception).done(new DoneCallback<Object>() {
            @Override
            public void onDone(Object o) {
                if (DEBUG) Timber.i("Connected to facebook");
                afterLogin();
            }
        }).fail(new FailCallback<BError>() {
            @Override
            public void onFail(BError bError) {
                if (DEBUG) Timber.i(TAG, "Error connecting to Facebook");
//                Toast.makeText(LoginActivity.this, "Failed connect to facebook.", Toast.LENGTH_SHORT).show();
                showAlertToast( getString(R.string.login_activity_facebook_connection_fail_toast) );
                BFacebookManager.logout(ChatSDKAbstractLoginActivity.this);
                dismissProgDialog();
            }
        });
    }
项目:chat-sdk-android-push-firebase    文件:BFacebookManager.java   
/** Re authenticate after session state changed.*/
public static Promise<Object, BError, Void> onSessionStateChange(Session session, SessionState state, Exception exception) {
    if (DEBUG) Timber.i("Session changed state");

    // If we can start the login process with no errors this promise wont be used. 
    // The returned promise will be from the loginWithFacebook.
    Deferred<Object, BError, Void> deferred = new DeferredObject<>();

    if (exception != null)
    {
        exception.printStackTrace();
        if (exception instanceof FacebookOperationCanceledException)
        {
            deferred.reject(new BError(BError.Code.EXCEPTION, exception));
            return deferred.promise();
        }
    }

    if (state.isOpened()) {
        if (DEBUG) Timber.i("Session is open.");

        // We will need this session later to make request.
        userFacebookAccessToken = Session.getActiveSession().getAccessToken();

        return loginWithFacebook();

    } else if (state.isClosed()) {
        // Logged out of Facebook
        if (DEBUG) Timber.i("Session is closed.");
        deferred.reject(new BError(BError.Code.SESSION_CLOSED, "Facebook session is closed."));
    }


    return deferred.promise();
}
项目:chat-sdk-android-push-firebase    文件:ChatSDKAbstractLoginActivity.java   
protected void setFacebookLogin(){
    facebookLogin.setOnErrorListener(new LoginButton.OnErrorListener() {
        @Override
        public void onError(FacebookException error) {
            if (error instanceof FacebookOperationCanceledException)
                return;
            else if (error.getMessage() != null && error.getMessage().equals("Log in attempt aborted."))
                return;

            showAlertToast("Facebook error: " + error.getMessage() + " " + error.getClass().getSimpleName());
        }
    });

    facebookLogin.setReadPermissions(Arrays.asList("email", "user_friends"));
}