A button that initiates a log in or log out flow upon tapping.
FBSDKLoginButton
works with [FBSDKAccessToken currentAccessToken]
to
determine what to display, and automatically starts authentication when tapped (i.e.,
you do not need to manually subscribe action targets).
Like FBSDKLoginManager
, you should make sure your app delegate is connected to
FBSDKApplicationDelegate
in order for the button's delegate to receive messages.
FBSDKLoginButton
has a fixed height of @c 30 pixels, but you may change the width. initWithFrame:CGRectZero
will size the button to its minimum frame.
Superclass: | FBSDKButton |
Declared in: | FBSDKLoginButton.h |
defaultAudience
The default audience to use, if publish permissions are requested at login time.
@property (assign,
nonatomic) FBSDKDefaultAudience defaultAudience;
FBSDKLoginButton.h
delegate
Gets or sets the delegate.
@property (weak,
nonatomic) IBOutlet id<FBSDKLoginButtonDelegate> delegate;
FBSDKLoginButton.h
loginBehavior
Gets or sets the login behavior to use
@property (assign,
nonatomic) FBSDKLoginBehavior loginBehavior;
FBSDKLoginButton.h
publishPermissions
The publish permissions to request.
@property (copy,
nonatomic) NSArray *publishPermissions;
Use defaultAudience
to specify the default audience to publish to.
Note this is converted to NSSet and is only
an NSArray for the convenience of literal syntax.
FBSDKLoginButton.h
readPermissions
The read permissions to request.
@property (copy,
nonatomic) NSArray *readPermissions;
Note, that if read permissions are specified, then publish permissions should not be specified. This is converted to NSSet and is only an NSArray for the convenience of literal syntax.
FBSDKLoginButton.h
tooltipBehavior
Gets or sets the desired tooltip behavior.
@property (assign,
nonatomic) FBSDKLoginButtonTooltipBehavior tooltipBehavior;
FBSDKLoginButton.h
tooltipColorStyle
Gets or sets the desired tooltip color style.
@property (assign,
nonatomic) FBSDKTooltipColorStyle tooltipColorStyle;
FBSDKLoginButton.h
NS_ENUM
Indicates the desired login tooltip behavior.
typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) { /*! The default behavior. The tooltip will only be displayed if */ FBSDKLoginButtonTooltipBehaviorAutomatic = 0, /*! Force display of the tooltip (typically for UI testing) */ FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, /*! Force disable. In this case you can still exert more refined */ FBSDKLoginButtonTooltipBehaviorDisable = 2 };
Constant | Description |
---|---|
FBSDKLoginButtonTooltipBehaviorAutomatic | The default behavior. The tooltip will only be displayed if the app is eligible (determined by possible server round trip) |
FBSDKLoginButtonTooltipBehaviorForceDisplay | Force display of the tooltip (typically for UI testing) |
FBSDKLoginButtonTooltipBehaviorDisable | Force disable. In this case you can still exert more refined
control by manually constructing a |
FBSDKLoginButtonTooltipBehavior)
FBSDKLoginButton.h
NS_ENUM(NSUInteger,
Indicates the desired login tooltip behavior.
typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) { /*! The default behavior. The tooltip will only be displayed if */ FBSDKLoginButtonTooltipBehaviorAutomatic = 0, /*! Force display of the tooltip (typically for UI testing) */ FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, /*! Force disable. In this case you can still exert more refined */ FBSDKLoginButtonTooltipBehaviorDisable = 2 };
Constant | Description |
---|---|
FBSDKLoginButtonTooltipBehaviorAutomatic | The default behavior. The tooltip will only be displayed if the app is eligible (determined by possible server round trip) |
FBSDKLoginButtonTooltipBehaviorForceDisplay | Force display of the tooltip (typically for UI testing) |
FBSDKLoginButtonTooltipBehaviorDisable | Force disable. In this case you can still exert more refined
control by manually constructing a |
FBSDKLoginButtonTooltipBehavior)
FBSDKLoginButton.h