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 <Foundation/Foundation.h> |
|
10 |
|
|
11 |
NS_ASSUME_NONNULL_BEGIN |
|
12 |
|
|
13 |
@class FBSDKPermission; |
|
14 |
|
|
15 |
/// typedef for FBSDKLoginAuthType |
|
16 |
/// See: https://developers.facebook.com/docs/reference/javascript/FB.login/v10.0#options |
|
17 |
typedef NSString *const FBSDKLoginAuthType NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(LoginAuthType); |
|
18 |
|
|
19 |
/// Rerequest |
|
20 |
FOUNDATION_EXPORT FBSDKLoginAuthType FBSDKLoginAuthTypeRerequest; |
|
21 |
|
|
22 |
/// Reauthorize |
|
23 |
FOUNDATION_EXPORT FBSDKLoginAuthType FBSDKLoginAuthTypeReauthorize; |
|
24 |
|
|
25 |
/// The login tracking preference to use for a login attempt. For more information on the differences between |
|
26 |
/// `enabled` and `limited` see: https://developers.facebook.com/docs/facebook-login/ios/limited-login/ |
|
27 |
typedef NS_ENUM(NSUInteger, FBSDKLoginTracking) { |
|
28 |
FBSDKLoginTrackingEnabled, |
|
29 |
FBSDKLoginTrackingLimited, |
|
30 |
} NS_SWIFT_NAME(LoginTracking); |
|
31 |
|
|
32 |
/// A configuration to use for modifying the behavior of a login attempt. |
|
33 |
NS_SWIFT_NAME(LoginConfiguration) |
|
34 |
@interface FBSDKLoginConfiguration : NSObject |
|
35 |
|
|
36 |
/// The nonce that the configuration was created with. |
|
37 |
/// A unique nonce will be used if none is provided to the initializer. |
|
38 |
@property (nonatomic, readonly, copy) NSString *nonce; |
|
39 |
|
|
40 |
/// The tracking preference. Defaults to `.enabled`. |
|
41 |
@property (nonatomic, readonly) FBSDKLoginTracking tracking; |
|
42 |
|
|
43 |
/// The requested permissions for the login attempt. Defaults to an empty set. |
|
44 |
@property (nonatomic, readonly, copy) NSSet<FBSDKPermission *> *requestedPermissions; |
|
45 |
|
|
46 |
/// The Messenger Page Id associated with this login request. |
|
47 |
@property (nullable, nonatomic, readonly, copy) NSString *messengerPageId; |
|
48 |
|
|
49 |
/// The auth type associated with this login request. |
|
50 |
@property (nullable, nonatomic, readonly) FBSDKLoginAuthType authType; |
|
51 |
|
|
52 |
- (instancetype)init NS_UNAVAILABLE; |
|
53 |
+ (instancetype)new NS_UNAVAILABLE; |
|
54 |
|
|
55 |
/** |
|
56 |
Attempts to initialize a new configuration with the expected parameters. |
|
57 |
|
|
58 |
@param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
59 |
@param tracking the tracking preference to use for a login attempt. |
|
60 |
@param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
61 |
Creation of the configuration will fail if the nonce is invalid. |
|
62 |
@param messengerPageId the associated page id to use for a login attempt. |
|
63 |
*/ |
|
64 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
65 |
tracking:(FBSDKLoginTracking)tracking |
|
66 |
nonce:(NSString *)nonce |
|
67 |
messengerPageId:(nullable NSString *)messengerPageId |
|
68 |
NS_REFINED_FOR_SWIFT; |
|
69 |
|
|
70 |
/** |
|
71 |
Attempts to initialize a new configuration with the expected parameters. |
|
72 |
|
|
73 |
@param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
74 |
@param tracking the tracking preference to use for a login attempt. |
|
75 |
@param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
76 |
Creation of the configuration will fail if the nonce is invalid. |
|
77 |
@param messengerPageId the associated page id to use for a login attempt. |
|
78 |
@param authType auth_type param to use for login. |
|
79 |
*/ |
|
80 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
81 |
tracking:(FBSDKLoginTracking)tracking |
|
82 |
nonce:(NSString *)nonce |
|
83 |
messengerPageId:(nullable NSString *)messengerPageId |
|
84 |
authType:(nullable FBSDKLoginAuthType)authType |
|
85 |
NS_REFINED_FOR_SWIFT; |
|
86 |
|
|
87 |
/** |
|
88 |
Attempts to initialize a new configuration with the expected parameters. |
|
89 |
|
|
90 |
@param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
91 |
@param tracking the tracking preference to use for a login attempt. |
|
92 |
@param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
93 |
Creation of the configuration will fail if the nonce is invalid. |
|
94 |
*/ |
|
95 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
96 |
tracking:(FBSDKLoginTracking)tracking |
|
97 |
nonce:(NSString *)nonce |
|
98 |
NS_REFINED_FOR_SWIFT; |
|
99 |
|
|
100 |
/** |
|
101 |
Attempts to initialize a new configuration with the expected parameters. |
|
102 |
|
|
103 |
@param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
104 |
@param tracking the tracking preference to use for a login attempt. |
|
105 |
@param messengerPageId the associated page id to use for a login attempt. |
|
106 |
*/ |
|
107 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
108 |
tracking:(FBSDKLoginTracking)tracking |
|
109 |
messengerPageId:(nullable NSString *)messengerPageId |
|
110 |
NS_REFINED_FOR_SWIFT; |
|
111 |
|
|
112 |
/** |
|
113 |
Attempts to initialize a new configuration with the expected parameters. |
|
114 |
|
|
115 |
@param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
116 |
@param tracking the tracking preference to use for a login attempt. |
|
117 |
@param messengerPageId the associated page id to use for a login attempt. |
|
118 |
@param authType auth_type param to use for login. |
|
119 |
*/ |
|
120 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
121 |
tracking:(FBSDKLoginTracking)tracking |
|
122 |
messengerPageId:(nullable NSString *)messengerPageId |
|
123 |
authType:(nullable FBSDKLoginAuthType)authType |
|
124 |
NS_REFINED_FOR_SWIFT; |
|
125 |
|
|
126 |
/** |
|
127 |
Attempts to initialize a new configuration with the expected parameters. |
|
128 |
|
|
129 |
@param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
130 |
@param tracking the tracking preference to use for a login attempt. |
|
131 |
*/ |
|
132 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
133 |
tracking:(FBSDKLoginTracking)tracking |
|
134 |
NS_REFINED_FOR_SWIFT; |
|
135 |
|
|
136 |
/** |
|
137 |
Attempts to initialize a new configuration with the expected parameters. |
|
138 |
|
|
139 |
@param tracking the login tracking preference to use for a login attempt. |
|
140 |
*/ |
|
141 |
- (nullable instancetype)initWithTracking:(FBSDKLoginTracking)tracking |
|
142 |
NS_REFINED_FOR_SWIFT; |
|
143 |
|
|
144 |
/** |
|
145 |
Given a string, return the corresponding FBSDKLoginAuthType. Returns nil if the string cannot be mapped to a valid auth type |
|
146 |
|
|
147 |
@param rawValue the raw auth type. |
|
148 |
*/ |
|
149 |
+ (nullable FBSDKLoginAuthType)authTypeForString:(NSString *)rawValue; |
|
150 |
|
|
151 |
@end |
|
152 |
|
|
153 |
NS_ASSUME_NONNULL_END |