commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <UIKit/UIKit.h> |
|
10 |
|
|
11 |
#import "TargetConditionals.h" |
|
12 |
|
|
13 |
#if TARGET_OS_TV |
|
14 |
|
|
15 |
@interface FBLoginButton : UIView |
|
16 |
|
|
17 |
@property (nonatomic, copy) NSArray<NSString *> *permissions; |
|
18 |
|
|
19 |
@end |
|
20 |
|
|
21 |
#else |
|
22 |
|
|
23 |
#import <FBSDKCoreKit/FBSDKCoreKit.h> |
|
24 |
#import <FBSDKLoginKit/FBSDKLoginManager.h> |
|
25 |
#import <FBSDKLoginKit/FBSDKTooltipView.h> |
|
26 |
|
|
27 |
NS_ASSUME_NONNULL_BEGIN |
|
28 |
|
|
29 |
@protocol FBSDKLoginButtonDelegate; |
|
30 |
|
|
31 |
/** |
|
32 |
NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) |
|
33 |
Indicates the desired login tooltip behavior. |
|
34 |
*/ |
|
35 |
typedef NS_ENUM(NSUInteger, FBSDKLoginButtonTooltipBehavior) { |
|
36 |
/** The default behavior. The tooltip will only be displayed if |
|
37 |
the app is eligible (determined by possible server round trip) */ |
|
38 |
FBSDKLoginButtonTooltipBehaviorAutomatic = 0, |
|
39 |
/** Force display of the tooltip (typically for UI testing) */ |
|
40 |
FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, |
|
41 |
/** Force disable. In this case you can still exert more refined |
|
42 |
control by manually constructing a `FBSDKLoginTooltipView` instance. */ |
|
43 |
FBSDKLoginButtonTooltipBehaviorDisable = 2, |
|
44 |
} NS_SWIFT_NAME(FBLoginButton.TooltipBehavior); |
|
45 |
|
|
46 |
/** |
|
47 |
A button that initiates a log in or log out flow upon tapping. |
|
48 |
|
|
49 |
`FBSDKLoginButton` works with `FBSDKProfile.currentProfile` to |
|
50 |
determine what to display, and automatically starts authentication when tapped (i.e., |
|
51 |
you do not need to manually subscribe action targets). |
|
52 |
|
|
53 |
Like `FBSDKLoginManager`, you should make sure your app delegate is connected to |
|
54 |
`FBSDKApplicationDelegate` in order for the button's delegate to receive messages. |
|
55 |
|
|
56 |
`FBSDKLoginButton` has a fixed height of @c 30 pixels, but you may change the width. `initWithFrame:CGRectZero` |
|
57 |
will size the button to its minimum frame. |
|
58 |
*/ |
|
59 |
NS_SWIFT_NAME(FBLoginButton) |
|
60 |
@interface FBSDKLoginButton : FBSDKButton |
|
61 |
|
|
62 |
/** |
|
63 |
The default audience to use, if publish permissions are requested at login time. |
|
64 |
*/ |
|
65 |
@property (nonatomic, assign) FBSDKDefaultAudience defaultAudience; |
|
66 |
/** |
|
67 |
Gets or sets the delegate. |
|
68 |
*/ |
|
69 |
@property (nonatomic, weak) IBOutlet id<FBSDKLoginButtonDelegate> delegate; |
|
70 |
/*! |
|
71 |
@abstract The permissions to request. |
|
72 |
@discussion To provide the best experience, you should minimize the number of permissions you request, and only ask for them when needed. |
|
73 |
For example, do not ask for "user_location" until you the information is actually used by the app. |
|
74 |
|
|
75 |
Note this is converted to NSSet and is only |
|
76 |
an NSArray for the convenience of literal syntax. |
|
77 |
|
|
78 |
See [the permissions guide]( https://developers.facebook.com/docs/facebook-login/permissions/ ) for more details. |
|
79 |
*/ |
|
80 |
@property (nonatomic, copy) NSArray<NSString *> *permissions; |
|
81 |
/** |
|
82 |
Gets or sets the desired tooltip behavior. |
|
83 |
*/ |
|
84 |
@property (nonatomic, assign) FBSDKLoginButtonTooltipBehavior tooltipBehavior; |
|
85 |
/** |
|
86 |
Gets or sets the desired tooltip color style. |
|
87 |
*/ |
|
88 |
@property (nonatomic, assign) FBSDKTooltipColorStyle tooltipColorStyle; |
|
89 |
/** |
|
90 |
Gets or sets the desired tracking preference to use for login attempts. Defaults to `.enabled` |
|
91 |
*/ |
|
92 |
@property (nonatomic, assign) FBSDKLoginTracking loginTracking; |
|
93 |
/** |
|
94 |
Gets or sets an optional nonce to use for login attempts. A valid nonce must be a non-empty string without whitespace. |
|
95 |
An invalid nonce will not be set. Instead, default unique nonces will be used for login attempts. |
|
96 |
*/ |
|
97 |
@property (nullable, nonatomic, copy) NSString *nonce; |
|
98 |
/** |
|
99 |
Gets or sets an optional page id to use for login attempts. |
|
100 |
*/ |
|
101 |
@property (nullable, nonatomic, copy) NSString *messengerPageId; |
|
102 |
/** |
|
103 |
Gets or sets the auth_type to use in the login request. Defaults to rerequest. |
|
104 |
*/ |
|
105 |
@property (nullable, nonatomic) FBSDKLoginAuthType authType; |
|
106 |
|
|
107 |
@end |
|
108 |
|
|
109 |
NS_ASSUME_NONNULL_END |
|
110 |
|
|
111 |
#endif |