Package 

Class LoginButton

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback , android.view.KeyEvent.Callback , android.view.ViewTreeObserver.OnPreDrawListener , android.view.accessibility.AccessibilityEventSource

    
    public class LoginButton
    extends FacebookButtonBase
                        

    A Log In/Log Out button that maintains login state and logs in/out for the app.

    This control requires the app ID to be specified in the AndroidManifest.xml.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public enum LoginButton.ToolTipMode

      The display modes for the login button tool tip.

    • Method Summary

      Modifier and Type Method Description
      void setLoginText(String loginText)
      void setLogoutText(String logoutText)
      void setToolTipStyle(ToolTipPopup.Style toolTipStyle) Sets the style (background) of the Tool Tip popup.
      LoginButton.ToolTipMode getToolTipMode() Return the current ToolTipMode for this LoginButton
      void setToolTipMode(LoginButton.ToolTipMode toolTipMode) Sets the mode of the Tool Tip popup.
      long getToolTipDisplayTime() Gets the current amount of time (in ms) that the tool tip will be displayed to the user.
      void setToolTipDisplayTime(long displayTime) Sets the amount of time (in milliseconds) that the tool tip will be shown to the user.
      String getLoggerID() The logger ID associated with the LoginButton
      CallbackManager getCallbackManager() Returns the callback manager registered to the login button.
      void setDefaultAudience(DefaultAudience defaultAudience) Sets the default audience to use when the user logs in.
      DefaultAudience getDefaultAudience() Gets the default audience to use when the user logs in.
      void setReadPermissions(List<String> permissions) Set the permissions to use when the user logs in.
      void setReadPermissions(Array<String> permissions) Set the permissions to use when the user logs in.
      void setPermissions(List<String> permissions) Set the permissions to use when the user logs in.
      void setPermissions(Array<String> permissions) Set the permissions to use when the user logs in.
      void setPublishPermissions(List<String> permissions) Set the permissions to use when the user logs in.
      void setPublishPermissions(Array<String> permissions) Set the permissions to use when the user logs in.
      void clearPermissions() Clears the permissions currently associated with this LoginButton.
      void setLoginBehavior(LoginBehavior loginBehavior) Sets the login behavior during authorization.
      LoginBehavior getLoginBehavior() Gets the login behavior during authorization.
      void setLoginTargetApp(LoginTargetApp targetApp) Sets the login target app for authorization.
      LoginTargetApp getLoginTargetApp() Gets the login target app for authorization.
      String getAuthType() Gets the authType being used.
      String getMessengerPageId() Gets the messengerPageId being used.
      boolean getResetMessengerState() Gets the resetMessengerState being used.
      void setAuthType(String authType) Sets the authType to be used.
      void setMessengerPageId(String messengerPageId) Sets the messengerPageId to be used in the login request.
      void setResetMessengerState(boolean resetMessengerState) Test param for developers of the app to reset their Messenger state.
      boolean getShouldSkipAccountDeduplication() Gets the value on if we should skip account deduplication.
      void dismissToolTip() Dismisses the Tooltip if it is currently visible
      void registerCallback(CallbackManager callbackManager, FacebookCallback<LoginResult> callback) Registers a login callback to the given callback manager.
      void unregisterCallback(CallbackManager callbackManager) Unregisters a login callback to the given callback manager.
      • Methods inherited from class com.facebook.FacebookButtonBase

        getAndroidxActivityResultRegistryOwner, getCompoundPaddingLeft, getCompoundPaddingRight, getFragment, getNativeFragment, getRequestCode, setFragment, setOnClickListener
      • Methods inherited from class android.widget.Button

        getAccessibilityClassName, onResolvePointerIcon
      • Methods inherited from class android.widget.TextView

        addExtraDataToAccessibilityNodeInfo, addTextChangedListener, append, autofill, beginBatchEdit, bringPointIntoView, cancelLongPress, clearComposingText, computeScroll, debug, didTouchFocusSelect, drawableHotspotChanged, endBatchEdit, extractText, findViewsWithText, getAutoLinkMask, getAutoSizeMaxTextSize, getAutoSizeMinTextSize, getAutoSizeStepGranularity, getAutoSizeTextAvailableSizes, getAutoSizeTextType, getAutofillType, getAutofillValue, getBaseline, getBreakStrategy, getCompoundDrawablePadding, getCompoundDrawableTintBlendMode, getCompoundDrawableTintList, getCompoundDrawableTintMode, getCompoundDrawables, getCompoundDrawablesRelative, getCompoundPaddingBottom, getCompoundPaddingEnd, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingStart, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getCustomInsertionActionModeCallback, getCustomSelectionActionModeCallback, getEditableText, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFirstBaselineToTopHeight, getFocusedRect, getFontFeatureSettings, getFontVariationSettings, getFreezesText, getGravity, getHighlightColor, getHint, getHintTextColors, getHyphenationFrequency, getImeActionId, getImeActionLabel, getImeHintLocales, getImeOptions, getIncludeFontPadding, getInputExtras, getInputType, getJustificationMode, getKeyListener, getLastBaselineToBottomHeight, getLayout, getLetterSpacing, getLineBounds, getLineCount, getLineHeight, getLineSpacingExtra, getLineSpacingMultiplier, getLinkTextColors, getLinksClickable, getMarqueeRepeatLimit, getMaxEms, getMaxHeight, getMaxLines, getMaxWidth, getMinEms, getMinHeight, getMinLines, getMinWidth, getMovementMethod, getOffsetForPosition, getPaint, getPaintFlags, getPrivateImeOptions, getSelectionEnd, getSelectionStart, getShadowColor, getShadowDx, getShadowDy, getShadowRadius, getShowSoftInputOnFocus, getText, getTextClassifier, getTextColors, getTextCursorDrawable, getTextDirectionHeuristic, getTextLocale, getTextLocales, getTextMetricsParams, getTextScaleX, getTextSelectHandle, getTextSelectHandleLeft, getTextSelectHandleRight, getTextSize, getTotalPaddingBottom, getTotalPaddingEnd, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingStart, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasOverlappingRendering, hasSelection, invalidateDrawable, isAllCaps, isCursorVisible, isElegantTextHeight, isFallbackLineSpacing, isHorizontallyScrollable, isInputMethodTarget, isSingleLine, isSuggestionsEnabled, isTextSelectable, jumpDrawablesToCurrentState, length, moveCursorToVisibleOffset, onBeginBatchEdit, onCheckIsTextEditor, onCommitCompletion, onCommitCorrection, onCreateInputConnection, onDragEvent, onEditorAction, onEndBatchEdit, onGenericMotionEvent, onKeyDown, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPreDraw, onPrivateIMECommand, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onTextContextMenuItem, onTouchEvent, onTrackballEvent, onWindowFocusChanged, performLongClick, removeTextChangedListener, sendAccessibilityEventUnchecked, setAllCaps, setAutoLinkMask, setAutoSizeTextTypeUniformWithConfiguration, setAutoSizeTextTypeUniformWithPresetSizes, setAutoSizeTextTypeWithDefaults, setBreakStrategy, setCompoundDrawablePadding, setCompoundDrawableTintBlendMode, setCompoundDrawableTintList, setCompoundDrawableTintMode, setCompoundDrawables, setCompoundDrawablesRelative, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCursorVisible, setCustomInsertionActionModeCallback, setCustomSelectionActionModeCallback, setEditableFactory, setElegantTextHeight, setEllipsize, setEms, setEnabled, setError, setExtractedText, setFallbackLineSpacing, setFilters, setFirstBaselineToTopHeight, setFontFeatureSettings, setFontVariationSettings, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHintTextColor, setHorizontallyScrolling, setHyphenationFrequency, setImeActionLabel, setImeHintLocales, setImeOptions, setIncludeFontPadding, setInputExtras, setInputType, setJustificationMode, setKeyListener, setLastBaselineToBottomHeight, setLetterSpacing, setLineHeight, setLineSpacing, setLines, setLinkTextColor, setLinksClickable, setMarqueeRepeatLimit, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setOnEditorActionListener, setPadding, setPaddingRelative, setPaintFlags, setPrivateImeOptions, setRawInputType, setScroller, setSelectAllOnFocus, setSelected, setShadowLayer, setShowSoftInputOnFocus, setSingleLine, setSpannableFactory, setText, setTextAppearance, setTextClassifier, setTextColor, setTextCursorDrawable, setTextIsSelectable, setTextKeepState, setTextLocale, setTextLocales, setTextMetricsParams, setTextScaleX, setTextSelectHandle, setTextSelectHandleLeft, setTextSelectHandleRight, setTextSize, setTransformationMethod, setTypeface, setWidth, showContextMenu
      • Methods inherited from class android.view.View

        addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewWithTag, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasPointerCapture, hasTransientState, hasWindowFocus, inflate, invalidate, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onStartTemporaryDetach, onVisibilityAggregated, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreDefaultFocus, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSoundEffectsEnabled, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoginButton

        LoginButton(Context context)
        Create the LoginButton by inflating from XML
      • LoginButton

        LoginButton(Context context, AttributeSet attrs)
        Create the LoginButton by inflating from XML
      • LoginButton

        LoginButton(Context context, AttributeSet attrs, int defStyle)
        Create the LoginButton by inflating from XML and applying a style.
    • Method Detail

      • setToolTipStyle

         void setToolTipStyle(ToolTipPopup.Style toolTipStyle)

        Sets the style (background) of the Tool Tip popup. Currently a blue style and a black style aresupported. Blue is default

        Parameters:
        toolTipStyle - The style of the tool tip popup.
      • setToolTipMode

         void setToolTipMode(LoginButton.ToolTipMode toolTipMode)

        Sets the mode of the Tool Tip popup. Currently supported modes are default (normal behavior),always_on (popup remains up until forcibly dismissed), and always_off (popup doesn't show)

        Parameters:
        toolTipMode - The new mode for the tool tip
      • getToolTipDisplayTime

         long getToolTipDisplayTime()

        Gets the current amount of time (in ms) that the tool tip will be displayed to the user.

      • setToolTipDisplayTime

         void setToolTipDisplayTime(long displayTime)

        Sets the amount of time (in milliseconds) that the tool tip will be shown to the user. Thedefault is {@value com.facebook.login.widget.ToolTipPopup#DEFAULT_POPUP_DISPLAY_TIME}. Anyvalue that is less than or equal to zero will cause the tool tip to be displayed indefinitely.

        Parameters:
        displayTime - The amount of time (in milliseconds) that the tool tip will be displayed tothe user
      • setDefaultAudience

         void setDefaultAudience(DefaultAudience defaultAudience)

        Sets the default audience to use when the user logs in. This value is only useful whenspecifying publish permissions for the native login dialog.

        Parameters:
        defaultAudience - the default audience value to use
      • getDefaultAudience

         DefaultAudience getDefaultAudience()

        Gets the default audience to use when the user logs in. This value is only useful whenspecifying publish permissions for the native login dialog.

      • setReadPermissions

         void setReadPermissions(List<String> permissions)

        Set the permissions to use when the user logs in. The permissions here can only be readpermissions. If any publish permissions are included, the login attempt by the user will fail.The LoginButton can only be associated with either read permissions or publish permissions, butnot both. Calling both setReadPermissions and setPublishPermissions on the same instance ofLoginButton will result in an exception being thrown unless clearPermissions is called inbetween.

        This method is only meaningful if called before the user logs in. If this is called afterlogin, and the list of permissions passed in is not a subset of the permissions granted duringthe authorization, it will log an error.

        It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the read permissions to use
      • setReadPermissions

         void setReadPermissions(Array<String> permissions)

        Set the permissions to use when the user logs in. The permissions here can only be readpermissions. If any publish permissions are included, the login attempt by the user will fail.The LoginButton can only be associated with either read permissions or publish permissions, butnot both. Calling both setReadPermissions and setPublishPermissions on the same instance ofLoginButton will result in an exception being thrown unless clearPermissions is called inbetween.

        This method is only meaningful if called before the user logs in. If this is called afterlogin, and the list of permissions passed in is not a subset of the permissions granted duringthe authorization, it will log an error.

        It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the read permissions to use
      • setPermissions

         void setPermissions(List<String> permissions)

        Set the permissions to use when the user logs in. The permissions here can be either read orwrite permissions.

        * This method is only meaningful if called before the user logs in. If this is called *after login, and the list of permissions passed in is not a subset of the permissions grantedduring the authorization, it will log an error. *

        * It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the read and write permissions to use
      • setPermissions

         void setPermissions(Array<String> permissions)

        Set the permissions to use when the user logs in. The permissions here can be either read orwrite permissions.

        * This method is only meaningful if called before the user logs in. If this is called *after login, and the list of permissions passed in is not a subset of the permissions grantedduring the authorization, it will log an error. *

        * It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the read and write permissions to use
      • setPublishPermissions

         void setPublishPermissions(List<String> permissions)

        Set the permissions to use when the user logs in. The permissions here should only be publishpermissions. If any read permissions are included, the login attempt by the user may fail. TheLoginButton can only be associated with either read permissions or publish permissions, but notboth. Calling both setReadPermissions and setPublishPermissions on the same instance ofLoginButton will result in an exception being thrown unless clearPermissions is called inbetween.

        This method is only meaningful if called before the user logs in. If this is called afterlogin, and the list of permissions passed in is not a subset of the permissions granted duringthe authorization, it will log an error.

        It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the publish permissions to use
      • setPublishPermissions

         void setPublishPermissions(Array<String> permissions)

        Set the permissions to use when the user logs in. The permissions here should only be publishpermissions. If any read permissions are included, the login attempt by the user may fail. TheLoginButton can only be associated with either read permissions or publish permissions, but notboth. Calling both setReadPermissions and setPublishPermissions on the same instance ofLoginButton will result in an exception being thrown unless clearPermissions is called inbetween.

        This method is only meaningful if called before the user logs in. If this is called afterlogin, and the list of permissions passed in is not a subset of the permissions granted duringthe authorization, it will log an error.

        It's important to always pass in a consistent set of permissions to this method, or managethe setting of permissions outside of the LoginButton class altogether (by using theLoginManager explicitly).

        Parameters:
        permissions - the publish permissions to use
      • clearPermissions

         void clearPermissions()

        Clears the permissions currently associated with this LoginButton.

      • setLoginBehavior

         void setLoginBehavior(LoginBehavior loginBehavior)

        Sets the login behavior during authorization. If null is specified, the default ( LoginBehavior.NATIVE_WITH_FALLBACK will be used.

        Parameters:
        loginBehavior - The LoginBehavior that specifieswhat behaviors should be attempted during authorization.
      • getLoginBehavior

         LoginBehavior getLoginBehavior()

        Gets the login behavior during authorization. If null is returned, the default ( LoginBehavior.NATIVE_WITH_FALLBACK will be used.

      • setLoginTargetApp

         void setLoginTargetApp(LoginTargetApp targetApp)

        Sets the login target app for authorization. If null is specified, the default LoginTargetApp.FACEBOOK will be used.

        Parameters:
        targetApp - The LoginTargetApp that specifieswhat app in the Facebook Family of Apps will be used for authorization.
      • getLoginTargetApp

         LoginTargetApp getLoginTargetApp()

        Gets the login target app for authorization. If null is returned, the default ( LoginTargetApp.FACEBOOK will be used.

      • setAuthType

         void setAuthType(String authType)

        Sets the authType to be used.

        Parameters:
        authType - the authType
      • setMessengerPageId

         void setMessengerPageId(String messengerPageId)

        Sets the messengerPageId to be used in the login request.

        Parameters:
        messengerPageId - the messengerPageId
      • setResetMessengerState

         void setResetMessengerState(boolean resetMessengerState)

        Test param for developers of the app to reset their Messenger state.

        Parameters:
        resetMessengerState - the resetMessengerState
      • getShouldSkipAccountDeduplication

         boolean getShouldSkipAccountDeduplication()

        Gets the value on if we should skip account deduplication. The setter is only available inFamilyLoginButton as this is an x-FoA specific feature.

      • dismissToolTip

         void dismissToolTip()

        Dismisses the Tooltip if it is currently visible

      • registerCallback

         void registerCallback(CallbackManager callbackManager, FacebookCallback<LoginResult> callback)

        Registers a login callback to the given callback manager.

        Parameters:
        callbackManager - The callback manager that will encapsulate the callback.
        callback - The login callback that will be called on login completion.
      • unregisterCallback

         void unregisterCallback(CallbackManager callbackManager)

        Unregisters a login callback to the given callback manager.

        Parameters:
        callbackManager - The callback manager that will encapsulate the callback.