当前位置: 首页>>代码示例>>Java>>正文


Java FacebookOperationCanceledException类代码示例

本文整理汇总了Java中com.facebook.FacebookOperationCanceledException的典型用法代码示例。如果您正苦于以下问题:Java FacebookOperationCanceledException类的具体用法?Java FacebookOperationCanceledException怎么用?Java FacebookOperationCanceledException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FacebookOperationCanceledException类属于com.facebook包,在下文中一共展示了FacebookOperationCanceledException类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getExceptionFromErrorData

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:23,代码来源:NativeProtocol.java

示例2: getExceptionFromErrorData

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:18,代码来源:NativeProtocol.java

示例3: callDialogListener

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:22,代码来源:FbDialog.java

示例4: getExceptionFromErrorData

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:23,代码来源:NativeProtocol.java

示例5: callDialogListener

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:25,代码来源:FbDialog.java

示例6: onComplete

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:20,代码来源:œ≥$4.java

示例7: getExceptionFromErrorData

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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);
}
 
开发者ID:smartenit-eu,项目名称:smartenit,代码行数:18,代码来源:NativeProtocol.java

示例8: handleActivityResult

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:32,代码来源:ShareInternalUtility.java

示例9: createBundleForException

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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;
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:NativeProtocol.java

示例10: onSessionStateChange

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
/** 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();
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:36,代码来源:BFacebookManager.java

示例11: setFacebookLogin

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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"));
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:16,代码来源:ChatSDKAbstractLoginActivity.java

示例12: onSessionStateChange

import com.facebook.FacebookOperationCanceledException; //导入依赖的package包/类
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();
            }
        });
    }
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:34,代码来源:ChatSDKAbstractLoginActivity.java


注:本文中的com.facebook.FacebookOperationCanceledException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。