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


Java Session.closeAndClearTokenInformation方法代码示例

本文整理汇总了Java中com.facebook.Session.closeAndClearTokenInformation方法的典型用法代码示例。如果您正苦于以下问题:Java Session.closeAndClearTokenInformation方法的具体用法?Java Session.closeAndClearTokenInformation怎么用?Java Session.closeAndClearTokenInformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.Session的用法示例。


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

示例1: logout

import com.facebook.Session; //导入方法依赖的package包/类
public static void logout(Context ctx){
    userFacebookAccessToken = null;

    if (Session.getActiveSession() != null)
    {
        Session.getActiveSession().closeAndClearTokenInformation();
    }
    else
    {
        if (DEBUG) Timber.e("getActiveSessionIsNull");
        Session session = Session.openActiveSessionFromCache(ctx);

        if (session != null)
            session.closeAndClearTokenInformation();
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:17,代码来源:BFacebookManager.java

示例2: logoutImpl

import com.facebook.Session; //导入方法依赖的package包/类
String logoutImpl(Context context) throws MalformedURLException, IOException  {
    checkUserSession("logout");
    Bundle b = new Bundle();
    b.putString("method", "auth.expireSession");
    String response = request(b);

    long currentTimeMillis = System.currentTimeMillis();
    Session sessionToClose = null;

    synchronized (this.lock) {
        sessionToClose = session;

        session = null;
        accessToken = null;
        accessExpiresMillisecondsAfterEpoch = 0;
        lastAccessUpdateMillisecondsAfterEpoch = currentTimeMillis;
        sessionInvalidated = false;
    }

    if (sessionToClose != null) {
        sessionToClose.closeAndClearTokenInformation();
    }

    return response;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:26,代码来源:Facebook.java

示例3: closeSessionAndClearTokenInformation

import com.facebook.Session; //导入方法依赖的package包/类
/**
 * Closes the current session as well as clearing the token cache.
 */
protected final void closeSessionAndClearTokenInformation() {
    if (sessionTracker != null) {
        Session currentSession = sessionTracker.getOpenSession();
        if (currentSession != null) {
            currentSession.closeAndClearTokenInformation();
        }
    }
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:12,代码来源:FacebookFragment.java

示例4: loginError

import com.facebook.Session; //导入方法依赖的package包/类
public void loginError() {
    Session session = Session.getActiveSession();

    if (session != null && session.isOpened()) {
        session.closeAndClearTokenInformation();
    }
    loginMode = false;
    init();
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:10,代码来源:FragmentSocialTimeline.java

示例5: logoutAndUnlink

import com.facebook.Session; //导入方法依赖的package包/类
private void logoutAndUnlink() {

		// logout/unlink and wipe local dataset
		// new CognitoUnlinkTask().execute();

		Session session = Session
				.openActiveSessionFromCache(SnakeGameActivity.this);
		if (session != null) {
			session.closeAndClearTokenInformation();
		}

		// if (googleApiClient != null) {
		// googleApiClient.clearDefaultAccount();
		// }

		AmazonAuthorizationManager mAuthManager = new AmazonAuthorizationManager(
				this, Bundle.EMPTY);
		if (mAuthManager != null) {
			mAuthManager.clearAuthorizationState(null);
		}

		AWSClientManager.getCognitoSync().wipeData();

		Toast.makeText(gameView.getContext(), "Logout Successful",
				Toast.LENGTH_SHORT).show();

	}
 
开发者ID:jinman,项目名称:snake-game-aws,代码行数:28,代码来源:SnakeGameActivity.java

示例6: logout

import com.facebook.Session; //导入方法依赖的package包/类
public void logout() {
    Session session = Session.getActiveSession();
    session.closeAndClearTokenInformation();
}
 
开发者ID:alessandrogurgel,项目名称:pedefacil,代码行数:5,代码来源:FbLoginDelegate.java

示例7: onClick

import com.facebook.Session; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    Context context = getContext();
    final Session openSession = sessionTracker.getOpenSession();

    if (openSession != null) {
        // If the Session is currently open, it must mean we need to log out
        if (confirmLogout) {
            // Create a confirmation dialog
            String logout = getResources().getString(R.string.com_facebook_loginview_log_out_action);
            String cancel = getResources().getString(R.string.com_facebook_loginview_cancel_action);
            String message;
            if (user != null && user.getName() != null) {
                message = String.format(getResources().getString(R.string.com_facebook_loginview_logged_in_as), user.getName());
            } else {
                message = getResources().getString(R.string.com_facebook_loginview_logged_in_using_facebook);
            }
            AlertDialog.Builder builder = new AlertDialog.Builder(context);
            builder.setMessage(message)
                   .setCancelable(true)
                   .setPositiveButton(logout, new DialogInterface.OnClickListener() {
                       public void onClick(DialogInterface dialog, int which) {
                           openSession.closeAndClearTokenInformation();
                       }
                   })
                   .setNegativeButton(cancel, null);
            builder.create().show();
        } else {
            openSession.closeAndClearTokenInformation();
        }
    } else {
        Session currentSession = sessionTracker.getSession();
        if (currentSession == null || currentSession.getState().isClosed()) {
            sessionTracker.setSession(null);
            Session session = new Session.Builder(context).setApplicationId(applicationId).build();
            Session.setActiveSession(session);
            currentSession = session;
        }
        if (!currentSession.isOpened()) {
            Session.OpenRequest openRequest = null;
            if (parentFragment != null) {
                openRequest = new Session.OpenRequest(parentFragment);
            } else if (context instanceof Activity) {
                openRequest = new Session.OpenRequest((Activity)context);
            }

            if (openRequest != null) {
                openRequest.setDefaultAudience(properties.defaultAudience);
                openRequest.setPermissions(properties.permissions);
                openRequest.setLoginBehavior(properties.loginBehavior);

                if (SessionAuthorizationType.PUBLISH.equals(properties.authorizationType)) {
                    currentSession.openForPublish(openRequest);
                } else {
                    currentSession.openForRead(openRequest);
                }
            }
        }
    }

    AppEventsLogger logger = AppEventsLogger.newLogger(getContext());

    Bundle parameters = new Bundle();
    parameters.putInt("logging_in", (openSession != null) ? 0 : 1);

    logger.logSdkEvent(loginLogoutEventName, null, parameters);
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:68,代码来源:LoginButton.java

示例8: onClickLogout

import com.facebook.Session; //导入方法依赖的package包/类
private void onClickLogout() {
	Session session = Session.getActiveSession();
	if (!session.isClosed()) {
		session.closeAndClearTokenInformation();
	}
}
 
开发者ID:ohmp,项目名称:UniversalSocialLoginAndroid,代码行数:7,代码来源:FacebookLoginActivity.java


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