com.facebook.AccessTokenTracker Java Examples

The following examples show how to use com.facebook.AccessTokenTracker. 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 File: VideoUploader.java    From kognitivo with Apache License 2.0 6 votes vote down vote up
private static void registerAccessTokenTracker() {
    accessTokenTracker = new AccessTokenTracker() {
        @Override
        protected void onCurrentAccessTokenChanged(
                AccessToken oldAccessToken,
                AccessToken currentAccessToken) {
            if (oldAccessToken == null) {
                // If we never had an access token, then there would be no pending uploads.
                return;
            }

            if (currentAccessToken == null ||
                    !Utility.areObjectsEqual(
                            currentAccessToken.getUserId(),
                            oldAccessToken.getUserId())) {
                // Cancel any pending uploads since the user changed.
                cancelAllRequests();
            }
        }
    };
}
 
Example #2
Source File: FacebookHelper.java    From AndroidBlueprints with Apache License 2.0 5 votes vote down vote up
private void initAccessTokenTracker() {
    mAccessTokenTracker = new AccessTokenTracker() {
        @Override
        protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken currentAccessToken) {
            // Set the access token using
            // currentAccessToken when it's loaded or set.
            // If the access token is available already assign it.
            mFacebookAccessToken = AccessToken.getCurrentAccessToken();
            //                Toast.makeText(mActivity, "Facebook current Access Token changed", Toast.LENGTH_SHORT)
            //                        .show();
        }
    };
}
 
Example #3
Source File: LoginMaster.java    From uPods-android with Apache License 2.0 5 votes vote down vote up
private void initFacebook() {
    FacebookSdk.setApplicationId(Config.FACEBOOK_APP_ID);

    AccessTokenTracker accessTokenTracker = new AccessTokenTracker() {
        @Override
        protected void onCurrentAccessTokenChanged(AccessToken oldAccessToken, AccessToken newAccessToken) {
            Logger.printInfo(LOG_TAG, "Is loged in with facebook");
        }
    };
    accessTokenTracker.startTracking();
}
 
Example #4
Source File: FacebookHelper.java    From AndroidBlueprints with Apache License 2.0 2 votes vote down vote up
/**
 * Gets facebook access token tracker.
 *
 * @return the facebook access token tracker
 */
public AccessTokenTracker getFacebookAccessTokenTracker() {
    return this.mAccessTokenTracker;
}