簡體   English   中英

注銷時在Facebook SDK 4.0中禁用“共享”按鈕

[英]Disable Share button in Facebook SDK 4.0 on Logout

我實現了示例hello facebook,但在某些方面感到困惑。

首先,當我從Android Studio在真實設備中測試應用程序時,已經(可能)已從已登錄的Facebook應用程序啟用了發布更新按鈕

當我通過按應用程序的Facebook登錄按鈕正常登錄時,會顯示個人資料圖片和姓名。 但是為什么我注銷后仍然啟用“共享”按鈕?

private void updateUI() {

    boolean enableButtons = AccessToken.getCurrentAccessToken() != null;

    postStatusUpdateButton.setEnabled(enableButtons || canPresentShareDialog);


    Profile profile = Profile.getCurrentProfile();
    if (enableButtons && profile != null) {
        profilePictureView.setProfileId(profile.getId());
        greeting.setText(getString(R.string.hello_user, profile.getLastName()));
    } else {

我應該把postStatusUpdateButton.setEnabled(false);放到這里嗎?

        profilePictureView.setProfileId(null);
        greeting.setText(null);
    }
}

“共享”按鈕不需要用戶登錄(通過您的應用程序)即可共享。 它將切換到Facebook應用程序或彈出Web視圖。 無論哪種情況,他們都可以登錄Facebook,而無需通過您的應用程序登錄。

這就是為什么即使沒有訪問令牌也不會禁用它的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM