commit | author | age
|
2e29a3
|
1 |
#if 0 |
L |
2 |
#elif defined(__arm64__) && __arm64__ |
e0ec42
|
3 |
// Generated by Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) |
2e29a3
|
4 |
#ifndef FBSDKLOGINKIT_SWIFT_H |
L |
5 |
#define FBSDKLOGINKIT_SWIFT_H |
|
6 |
#pragma clang diagnostic push |
|
7 |
#pragma clang diagnostic ignored "-Wgcc-compat" |
|
8 |
|
|
9 |
#if !defined(__has_include) |
|
10 |
# define __has_include(x) 0 |
|
11 |
#endif |
|
12 |
#if !defined(__has_attribute) |
|
13 |
# define __has_attribute(x) 0 |
|
14 |
#endif |
|
15 |
#if !defined(__has_feature) |
|
16 |
# define __has_feature(x) 0 |
|
17 |
#endif |
|
18 |
#if !defined(__has_warning) |
|
19 |
# define __has_warning(x) 0 |
|
20 |
#endif |
|
21 |
|
|
22 |
#if __has_include(<swift/objc-prologue.h>) |
|
23 |
# include <swift/objc-prologue.h> |
|
24 |
#endif |
|
25 |
|
e0ec42
|
26 |
#pragma clang diagnostic ignored "-Wduplicate-method-match" |
2e29a3
|
27 |
#pragma clang diagnostic ignored "-Wauto-import" |
e0ec42
|
28 |
#if defined(__OBJC__) |
2e29a3
|
29 |
#include <Foundation/Foundation.h> |
e0ec42
|
30 |
#endif |
L |
31 |
#if defined(__cplusplus) |
|
32 |
#include <cstdint> |
|
33 |
#include <cstddef> |
|
34 |
#include <cstdbool> |
|
35 |
#else |
2e29a3
|
36 |
#include <stdint.h> |
L |
37 |
#include <stddef.h> |
|
38 |
#include <stdbool.h> |
e0ec42
|
39 |
#endif |
2e29a3
|
40 |
|
L |
41 |
#if !defined(SWIFT_TYPEDEFS) |
|
42 |
# define SWIFT_TYPEDEFS 1 |
|
43 |
# if __has_include(<uchar.h>) |
|
44 |
# include <uchar.h> |
|
45 |
# elif !defined(__cplusplus) |
|
46 |
typedef uint_least16_t char16_t; |
|
47 |
typedef uint_least32_t char32_t; |
|
48 |
# endif |
|
49 |
typedef float swift_float2 __attribute__((__ext_vector_type__(2))); |
|
50 |
typedef float swift_float3 __attribute__((__ext_vector_type__(3))); |
|
51 |
typedef float swift_float4 __attribute__((__ext_vector_type__(4))); |
|
52 |
typedef double swift_double2 __attribute__((__ext_vector_type__(2))); |
|
53 |
typedef double swift_double3 __attribute__((__ext_vector_type__(3))); |
|
54 |
typedef double swift_double4 __attribute__((__ext_vector_type__(4))); |
|
55 |
typedef int swift_int2 __attribute__((__ext_vector_type__(2))); |
|
56 |
typedef int swift_int3 __attribute__((__ext_vector_type__(3))); |
|
57 |
typedef int swift_int4 __attribute__((__ext_vector_type__(4))); |
|
58 |
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); |
|
59 |
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); |
|
60 |
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); |
|
61 |
#endif |
|
62 |
|
|
63 |
#if !defined(SWIFT_PASTE) |
|
64 |
# define SWIFT_PASTE_HELPER(x, y) x##y |
|
65 |
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) |
|
66 |
#endif |
|
67 |
#if !defined(SWIFT_METATYPE) |
|
68 |
# define SWIFT_METATYPE(X) Class |
|
69 |
#endif |
|
70 |
#if !defined(SWIFT_CLASS_PROPERTY) |
|
71 |
# if __has_feature(objc_class_property) |
|
72 |
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ |
|
73 |
# else |
|
74 |
# define SWIFT_CLASS_PROPERTY(...) |
|
75 |
# endif |
|
76 |
#endif |
|
77 |
|
|
78 |
#if __has_attribute(objc_runtime_name) |
|
79 |
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) |
|
80 |
#else |
|
81 |
# define SWIFT_RUNTIME_NAME(X) |
|
82 |
#endif |
|
83 |
#if __has_attribute(swift_name) |
|
84 |
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) |
|
85 |
#else |
|
86 |
# define SWIFT_COMPILE_NAME(X) |
|
87 |
#endif |
|
88 |
#if __has_attribute(objc_method_family) |
|
89 |
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) |
|
90 |
#else |
|
91 |
# define SWIFT_METHOD_FAMILY(X) |
|
92 |
#endif |
|
93 |
#if __has_attribute(noescape) |
|
94 |
# define SWIFT_NOESCAPE __attribute__((noescape)) |
|
95 |
#else |
|
96 |
# define SWIFT_NOESCAPE |
|
97 |
#endif |
|
98 |
#if __has_attribute(ns_consumed) |
|
99 |
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) |
|
100 |
#else |
|
101 |
# define SWIFT_RELEASES_ARGUMENT |
|
102 |
#endif |
|
103 |
#if __has_attribute(warn_unused_result) |
|
104 |
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
|
105 |
#else |
|
106 |
# define SWIFT_WARN_UNUSED_RESULT |
|
107 |
#endif |
|
108 |
#if __has_attribute(noreturn) |
|
109 |
# define SWIFT_NORETURN __attribute__((noreturn)) |
|
110 |
#else |
|
111 |
# define SWIFT_NORETURN |
|
112 |
#endif |
|
113 |
#if !defined(SWIFT_CLASS_EXTRA) |
|
114 |
# define SWIFT_CLASS_EXTRA |
|
115 |
#endif |
|
116 |
#if !defined(SWIFT_PROTOCOL_EXTRA) |
|
117 |
# define SWIFT_PROTOCOL_EXTRA |
|
118 |
#endif |
|
119 |
#if !defined(SWIFT_ENUM_EXTRA) |
|
120 |
# define SWIFT_ENUM_EXTRA |
|
121 |
#endif |
|
122 |
#if !defined(SWIFT_CLASS) |
|
123 |
# if __has_attribute(objc_subclassing_restricted) |
|
124 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA |
|
125 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
126 |
# else |
|
127 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
128 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
129 |
# endif |
|
130 |
#endif |
|
131 |
#if !defined(SWIFT_RESILIENT_CLASS) |
|
132 |
# if __has_attribute(objc_class_stub) |
|
133 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) |
|
134 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
135 |
# else |
|
136 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) |
|
137 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
138 |
# endif |
|
139 |
#endif |
|
140 |
|
|
141 |
#if !defined(SWIFT_PROTOCOL) |
|
142 |
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
143 |
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
144 |
#endif |
|
145 |
|
|
146 |
#if !defined(SWIFT_EXTENSION) |
|
147 |
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) |
|
148 |
#endif |
|
149 |
|
|
150 |
#if !defined(OBJC_DESIGNATED_INITIALIZER) |
|
151 |
# if __has_attribute(objc_designated_initializer) |
|
152 |
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) |
|
153 |
# else |
|
154 |
# define OBJC_DESIGNATED_INITIALIZER |
|
155 |
# endif |
|
156 |
#endif |
|
157 |
#if !defined(SWIFT_ENUM_ATTR) |
|
158 |
# if defined(__has_attribute) && __has_attribute(enum_extensibility) |
|
159 |
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) |
|
160 |
# else |
|
161 |
# define SWIFT_ENUM_ATTR(_extensibility) |
|
162 |
# endif |
|
163 |
#endif |
|
164 |
#if !defined(SWIFT_ENUM) |
|
165 |
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type |
|
166 |
# if __has_feature(generalized_swift_name) |
|
167 |
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type |
|
168 |
# else |
|
169 |
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) |
|
170 |
# endif |
|
171 |
#endif |
|
172 |
#if !defined(SWIFT_UNAVAILABLE) |
|
173 |
# define SWIFT_UNAVAILABLE __attribute__((unavailable)) |
|
174 |
#endif |
|
175 |
#if !defined(SWIFT_UNAVAILABLE_MSG) |
|
176 |
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) |
|
177 |
#endif |
|
178 |
#if !defined(SWIFT_AVAILABILITY) |
|
179 |
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) |
|
180 |
#endif |
|
181 |
#if !defined(SWIFT_WEAK_IMPORT) |
|
182 |
# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) |
|
183 |
#endif |
|
184 |
#if !defined(SWIFT_DEPRECATED) |
|
185 |
# define SWIFT_DEPRECATED __attribute__((deprecated)) |
|
186 |
#endif |
|
187 |
#if !defined(SWIFT_DEPRECATED_MSG) |
|
188 |
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) |
|
189 |
#endif |
|
190 |
#if __has_feature(attribute_diagnose_if_objc) |
|
191 |
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) |
|
192 |
#else |
|
193 |
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) |
|
194 |
#endif |
e0ec42
|
195 |
#if defined(__OBJC__) |
2e29a3
|
196 |
#if !defined(IBSegueAction) |
L |
197 |
# define IBSegueAction |
|
198 |
#endif |
e0ec42
|
199 |
#endif |
L |
200 |
#if !defined(SWIFT_EXTERN) |
|
201 |
# if defined(__cplusplus) |
|
202 |
# define SWIFT_EXTERN extern "C" |
|
203 |
# else |
|
204 |
# define SWIFT_EXTERN extern |
|
205 |
# endif |
|
206 |
#endif |
|
207 |
#if !defined(SWIFT_CALL) |
|
208 |
# define SWIFT_CALL __attribute__((swiftcall)) |
|
209 |
#endif |
|
210 |
#if defined(__cplusplus) |
|
211 |
#if !defined(SWIFT_NOEXCEPT) |
|
212 |
# define SWIFT_NOEXCEPT noexcept |
|
213 |
#endif |
|
214 |
#else |
|
215 |
#if !defined(SWIFT_NOEXCEPT) |
|
216 |
# define SWIFT_NOEXCEPT |
|
217 |
#endif |
|
218 |
#endif |
|
219 |
#if defined(__cplusplus) |
|
220 |
#if !defined(SWIFT_CXX_INT_DEFINED) |
|
221 |
#define SWIFT_CXX_INT_DEFINED |
|
222 |
namespace swift { |
|
223 |
using Int = ptrdiff_t; |
|
224 |
using UInt = size_t; |
|
225 |
} |
|
226 |
#endif |
|
227 |
#endif |
|
228 |
#if defined(__OBJC__) |
2e29a3
|
229 |
#if __has_feature(modules) |
L |
230 |
#if __has_warning("-Watimport-in-framework-header") |
|
231 |
#pragma clang diagnostic ignored "-Watimport-in-framework-header" |
|
232 |
#endif |
e0ec42
|
233 |
@import CoreFoundation; |
L |
234 |
@import FBSDKCoreKit; |
|
235 |
@import Foundation; |
|
236 |
@import ObjectiveC; |
|
237 |
@import UIKit; |
2e29a3
|
238 |
#endif |
L |
239 |
|
e0ec42
|
240 |
#import <FBSDKLoginKit/FBSDKLoginKit.h> |
L |
241 |
|
|
242 |
#endif |
2e29a3
|
243 |
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" |
L |
244 |
#pragma clang diagnostic ignored "-Wduplicate-method-arg" |
|
245 |
#if __has_warning("-Wpragma-clang-attribute") |
|
246 |
# pragma clang diagnostic ignored "-Wpragma-clang-attribute" |
|
247 |
#endif |
|
248 |
#pragma clang diagnostic ignored "-Wunknown-pragmas" |
|
249 |
#pragma clang diagnostic ignored "-Wnullability" |
e0ec42
|
250 |
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
2e29a3
|
251 |
|
L |
252 |
#if __has_attribute(external_source_symbol) |
|
253 |
# pragma push_macro("any") |
|
254 |
# undef any |
|
255 |
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FBSDKLoginKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) |
|
256 |
# pragma pop_macro("any") |
|
257 |
#endif |
|
258 |
|
e0ec42
|
259 |
#if defined(__OBJC__) |
L |
260 |
|
|
261 |
@class NSString; |
|
262 |
|
|
263 |
/// Represents a code verifier used in the PKCE (Proof Key for Code Exchange) |
|
264 |
/// process. This is a cryptographically random string using the characters |
|
265 |
/// A-Z, a-z, 0-9, and the punctuation characters -._~ (hyphen, period, |
|
266 |
/// underscore, and tilde), between 43 and 128 characters long. |
|
267 |
SWIFT_CLASS_NAMED("CodeVerifier") |
|
268 |
@interface FBSDKCodeVerifier : NSObject |
|
269 |
/// The string value of the code verifier |
|
270 |
@property (nonatomic, readonly, copy) NSString * _Nonnull value; |
|
271 |
/// The SHA256 hashed challenge of the code verifier |
|
272 |
@property (nonatomic, readonly, copy) NSString * _Nonnull challenge; |
|
273 |
/// Attempts to initialize a new code verifier instance with the given string. |
|
274 |
/// Creation will fail and return nil if the string is invalid. |
|
275 |
/// @param string the code verifier string |
|
276 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string; |
|
277 |
/// Initializes a new code verifier instance with a random string value |
|
278 |
- (nonnull instancetype)init; |
|
279 |
@end |
|
280 |
|
|
281 |
/// Passed to openURL to indicate which default audience to use for sessions that post data to Facebook. |
|
282 |
/// Certain operations such as publishing a status or publishing a photo require an audience. When the user |
|
283 |
/// grants an application permission to perform a publish operation, a default audience is selected as the |
|
284 |
/// publication ceiling for the application. This enumerated value allows the application to select which |
|
285 |
/// audience to ask the user to grant publish permission for. |
|
286 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKDefaultAudience, "DefaultAudience", open) { |
|
287 |
/// Indicates that the user’s friends are able to see posts made by the application |
|
288 |
FBSDKDefaultAudienceFriends = 0, |
|
289 |
/// Indicates that only the user is able to see posts made by the application |
|
290 |
FBSDKDefaultAudienceOnlyMe = 1, |
|
291 |
/// Indicates that all Facebook users are able to see posts made by the application |
|
292 |
FBSDKDefaultAudienceEveryone = 2, |
|
293 |
}; |
|
294 |
|
|
295 |
@class NSURL; |
|
296 |
@class NSDate; |
|
297 |
|
|
298 |
/// Describes the initial response when starting the device login flow. |
|
299 |
/// This is used by <code>DeviceLoginManager</code>. |
|
300 |
SWIFT_CLASS_NAMED("DeviceLoginCodeInfo") |
|
301 |
@interface FBSDKDeviceLoginCodeInfo : NSObject |
|
302 |
/// The unique id for this login flow. |
|
303 |
@property (nonatomic, readonly, copy) NSString * _Nonnull identifier; |
|
304 |
/// The short “user_code” that should be presented to the user. |
|
305 |
@property (nonatomic, readonly, copy) NSString * _Nonnull loginCode; |
|
306 |
/// The verification URL. |
|
307 |
@property (nonatomic, readonly, copy) NSURL * _Nonnull verificationURL; |
|
308 |
/// The expiration date. |
|
309 |
@property (nonatomic, readonly, copy) NSDate * _Nonnull expirationDate; |
|
310 |
/// The polling interval |
|
311 |
@property (nonatomic, readonly) NSUInteger pollingInterval; |
|
312 |
- (nonnull instancetype)initWithIdentifier:(NSString * _Nonnull)identifier loginCode:(NSString * _Nonnull)loginCode verificationURL:(NSURL * _Nonnull)verificationURL expirationDate:(NSDate * _Nonnull)expirationDate pollingInterval:(NSUInteger)pollingInterval OBJC_DESIGNATED_INITIALIZER; |
|
313 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
314 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
315 |
@end |
|
316 |
|
|
317 |
/// Custom error codes for device login errors in the login error domain |
|
318 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKDeviceLoginError, "DeviceLoginErrorCode", open) { |
|
319 |
/// Your device is polling too frequently. |
|
320 |
FBSDKDeviceLoginErrorExcessivePolling = 1349172, |
|
321 |
/// User has declined to authorize your application. |
|
322 |
FBSDKDeviceLoginErrorAuthorizationDeclined = 1349173, |
|
323 |
/// User has not yet authorized your application. Continue polling. |
|
324 |
FBSDKDeviceLoginErrorAuthorizationPending = 1349174, |
|
325 |
/// The code you entered has expired. |
|
326 |
FBSDKDeviceLoginErrorCodeExpired = 1349152, |
|
327 |
}; |
|
328 |
|
|
329 |
@protocol FBSDKDeviceLoginManagerDelegate; |
|
330 |
|
|
331 |
/// Use this class to perform a device login flow. |
|
332 |
/// The device login flow starts by requesting a code from the device login API. |
|
333 |
/// This class informs the delegate when this code is received. You should then present the |
|
334 |
/// code to the user to enter. In the meantime, this class polls the device login API |
|
335 |
/// periodically and informs the delegate of the results. |
|
336 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/for-devices">Facebook Device Login</a>. |
|
337 |
SWIFT_CLASS_NAMED("DeviceLoginManager") |
|
338 |
@interface FBSDKDeviceLoginManager : NSObject |
|
339 |
/// The device login manager delegate. |
|
340 |
@property (nonatomic, weak) id <FBSDKDeviceLoginManagerDelegate> _Nullable delegate; |
|
341 |
/// The requested permissions. |
|
342 |
@property (nonatomic, readonly, copy) NSArray<NSString *> * _Nonnull permissions; |
|
343 |
/// The optional URL to redirect the user to after they complete the login. |
|
344 |
/// The URL must be configured in your App Settings -> Advanced -> OAuth Redirect URIs |
|
345 |
@property (nonatomic, copy) NSURL * _Nullable redirectURL; |
|
346 |
/// Initializes a new instance. |
|
347 |
/// @param permissions The permissions to request. |
|
348 |
/// @param enableSmartLogin Whether to enable smart login. |
|
349 |
- (nonnull instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions enableSmartLogin:(BOOL)enableSmartLogin OBJC_DESIGNATED_INITIALIZER; |
|
350 |
/// Starts the device login flow |
|
351 |
/// This instance will retain self until the flow is finished or cancelled. |
|
352 |
- (void)start; |
|
353 |
/// Attempts to cancel the device login flow. |
|
354 |
- (void)cancel; |
|
355 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
356 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
357 |
@end |
|
358 |
|
|
359 |
@class NSNetService; |
|
360 |
@class NSNumber; |
|
361 |
|
|
362 |
@interface FBSDKDeviceLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <NSNetServiceDelegate> |
|
363 |
- (void)netService:(NSNetService * _Nonnull)service didNotPublish:(NSDictionary<NSString *, NSNumber *> * _Nonnull)errorValues; |
|
364 |
@end |
|
365 |
|
|
366 |
|
|
367 |
@class FBSDKDeviceLoginManagerResult; |
|
368 |
|
|
369 |
/// A delegate for <code>DeviceLoginManager</code>. |
|
370 |
SWIFT_PROTOCOL_NAMED("DeviceLoginManagerDelegate") |
|
371 |
@protocol FBSDKDeviceLoginManagerDelegate |
|
372 |
/// Indicates the device login flow has started. You should parse <code>codeInfo</code> to present the code to the user to enter. |
|
373 |
/// @param loginManager the login manager instance. |
|
374 |
/// @param codeInfo the code info data. |
|
375 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager startedWithCodeInfo:(FBSDKDeviceLoginCodeInfo * _Nonnull)codeInfo; |
|
376 |
/// Indicates the device login flow has finished. |
|
377 |
/// @param loginManager the login manager instance. |
|
378 |
/// @param result the results of the login flow. |
|
379 |
/// @param error the error, if available. |
|
380 |
/// The flow can be finished if the user completed the flow, cancelled, or if the code has expired. |
|
381 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager completedWithResult:(FBSDKDeviceLoginManagerResult * _Nullable)result error:(NSError * _Nullable)error; |
|
382 |
@end |
|
383 |
|
|
384 |
@class FBSDKAccessToken; |
|
385 |
|
|
386 |
/// Represents the results of the a device login flow. This is used by <code>DeviceLoginManager</code> |
|
387 |
SWIFT_CLASS_NAMED("DeviceLoginManagerResult") |
|
388 |
@interface FBSDKDeviceLoginManagerResult : NSObject |
|
389 |
/// The token |
|
390 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable accessToken; |
|
391 |
/// Indicates if the login was cancelled by the user, or if the device login code has expired. |
|
392 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
393 |
/// Internal method exposed to facilitate transition to Swift. |
|
394 |
/// API Subject to change or removal without warning. Do not use. |
|
395 |
/// @warning INTERNAL - DO NOT USE |
|
396 |
- (nonnull instancetype)initWithToken:(FBSDKAccessToken * _Nullable)token isCancelled:(BOOL)cancelled OBJC_DESIGNATED_INITIALIZER; |
|
397 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
398 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
399 |
@end |
|
400 |
|
|
401 |
@protocol FBSDKLoginButtonDelegate; |
|
402 |
enum FBSDKLoginButtonTooltipBehavior : NSUInteger; |
|
403 |
enum FBSDKTooltipColorStyle : NSUInteger; |
|
404 |
enum FBSDKLoginTracking : NSUInteger; |
|
405 |
@class NSCoder; |
|
406 |
|
|
407 |
/// A button that initiates a log in or log out flow upon tapping. |
|
408 |
/// <code>LoginButton</code> works with <code>AccessToken.current</code> to determine what to display, |
|
409 |
/// and automatically starts authentication when tapped (i.e., you do not need to manually subscribe action targets). |
|
410 |
/// Like <code>LoginManager</code>, you should make sure your app delegate is connected to <code>ApplicationDelegate</code> |
|
411 |
/// in order for the button’s delegate to receive messages. |
|
412 |
/// <code>LoginButton</code> has a fixed height of 30 pixels, but you may change the width. |
|
413 |
/// Initializing the button with <code>nil</code> frame will size the button to its minimum frame. |
|
414 |
SWIFT_CLASS_NAMED("FBLoginButton") |
|
415 |
@interface FBSDKLoginButton : FBSDKButton |
|
416 |
/// The default audience to use, if publish permissions are requested at login time. |
|
417 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
418 |
/// Gets or sets the delegate. |
|
419 |
@property (nonatomic, weak) IBOutlet id <FBSDKLoginButtonDelegate> _Nullable delegate; |
|
420 |
/// The permissions to request. |
|
421 |
/// To provide the best experience, you should minimize the number of permissions you request, and only ask for them when needed. |
|
422 |
/// For example, do not ask for “user_location” until you the information is actually used by the app. |
|
423 |
/// Note this is converted to NSSet and is only |
|
424 |
/// an NSArray for the convenience of literal syntax. |
|
425 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/permissions/">the permissions guide</a> for more details. |
|
426 |
@property (nonatomic, copy) NSArray<NSString *> * _Nonnull permissions; |
|
427 |
/// Gets or sets the desired tooltip behavior. |
|
428 |
@property (nonatomic) enum FBSDKLoginButtonTooltipBehavior tooltipBehavior; |
|
429 |
/// Gets or sets the desired tooltip color style. |
|
430 |
@property (nonatomic) enum FBSDKTooltipColorStyle tooltipColorStyle; |
|
431 |
/// Gets or sets the desired tracking preference to use for login attempts. Defaults to <code>.enabled</code> |
|
432 |
@property (nonatomic) enum FBSDKLoginTracking loginTracking; |
|
433 |
/// Gets or sets an optional nonce to use for login attempts. A valid nonce must be a non-empty string without whitespace. |
|
434 |
/// An invalid nonce will not be set. Instead, default unique nonces will be used for login attempts. |
|
435 |
@property (nonatomic, copy) NSString * _Nullable nonce; |
|
436 |
/// Gets or sets an optional page id to use for login attempts. |
|
437 |
@property (nonatomic, copy) NSString * _Nullable messengerPageId; |
|
438 |
/// Gets or sets the login authorization type to use in the login request. Defaults to <code>rerequest</code>. Use <code>nil</code> to avoid |
|
439 |
/// requesting permissions that were previously denied. |
|
440 |
@property (nonatomic) FBSDKLoginAuthType _Nullable authType; |
|
441 |
/// The code verifier used in the PKCE process. |
|
442 |
/// If not provided, a code verifier will be randomly generated. |
|
443 |
@property (nonatomic, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
444 |
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; |
|
445 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE; |
|
446 |
- (void)didMoveToWindow; |
|
447 |
- (CGRect)imageRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
448 |
- (CGRect)titleRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
449 |
- (void)layoutSubviews; |
|
450 |
- (CGSize)sizeThatFits:(CGSize)size SWIFT_WARN_UNUSED_RESULT; |
|
451 |
@end |
|
452 |
|
|
453 |
/// Indicates the desired login tooltip behavior. |
|
454 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginButtonTooltipBehavior, "TooltipBehavior", open) { |
|
455 |
/// The default behavior. The tooltip will only be displayed if |
|
456 |
/// the app is eligible (determined by possible server round trip) |
|
457 |
FBSDKLoginButtonTooltipBehaviorAutomatic = 0, |
|
458 |
/// Force display of the tooltip (typically for UI testing) |
|
459 |
FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, |
|
460 |
/// Force disable. In this case you can still exert more refined |
|
461 |
/// control by manually constructing a <code>FBSDKLoginTooltipView</code> instance. |
|
462 |
FBSDKLoginButtonTooltipBehaviorDisable = 2, |
|
463 |
}; |
|
464 |
|
|
465 |
enum FBSDKTooltipViewArrowDirection : NSUInteger; |
|
466 |
|
|
467 |
/// Tooltip bubble with text in it used to display tips for UI elements, |
|
468 |
/// with a pointed arrow (to refer to the UI element). |
|
469 |
/// The tooltip fades in and will automatically fade out. See <code>displayDuration</code>. |
|
470 |
SWIFT_CLASS_NAMED("FBTooltipView") |
|
471 |
@interface FBSDKTooltipView : UIView |
|
472 |
/// Gets or sets the amount of time in seconds the tooltip should be displayed. |
|
473 |
/// Set this to zero to make the display permanent until explicitly dismissed. |
|
474 |
/// Defaults to six seconds. |
|
475 |
@property (nonatomic) NSTimeInterval displayDuration; |
|
476 |
/// Gets or sets the color style after initialization. |
|
477 |
/// Defaults to value passed to -initWithTagline:message:colorStyle:. |
|
478 |
@property (nonatomic) enum FBSDKTooltipColorStyle colorStyle; |
|
479 |
/// Gets or sets the message. |
|
480 |
@property (nonatomic, copy) NSString * _Nullable message; |
|
481 |
/// Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
|
482 |
@property (nonatomic, copy) NSString * _Nullable tagline; |
|
483 |
/// Convenience constructor |
|
484 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
485 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
486 |
/// Designated initializer. |
|
487 |
/// If you need to show a tooltip for login, consider using the <code>FBSDKLoginTooltipView</code> view. |
|
488 |
/// See FBSDKLoginTooltipView |
|
489 |
/// \param tagline First part of the label, that will be highlighted with different color. Can be nil. |
|
490 |
/// |
|
491 |
/// \param message Main message to display. |
|
492 |
/// |
|
493 |
/// \param colorStyle Color style to use for tooltip. |
|
494 |
/// |
|
495 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
496 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; |
|
497 |
/// Show tooltip at the top or at the bottom of given view. |
|
498 |
/// Tooltip will be added to anchorView.window.rootViewController.view |
|
499 |
/// Use this method to present the tooltip with automatic positioning or |
|
500 |
/// use -presentInView:withArrowPosition:direction: for manual positioning |
|
501 |
/// If anchorView is nil or has no window - this method does nothing. |
|
502 |
/// \param anchorView view to show at, must be already added to window view hierarchy, in order to decide |
|
503 |
/// where tooltip will be shown. (If there’s not enough space at the top of the anchorView in window bounds - |
|
504 |
/// tooltip will be shown at the bottom of it) |
|
505 |
/// |
|
506 |
- (void)presentFromView:(UIView * _Nonnull)anchorView; |
|
507 |
/// Adds tooltip to given view, with given position and arrow direction. |
|
508 |
/// \param view View to be used as superview. |
|
509 |
/// |
|
510 |
/// \param arrowPosition Point in view’s cordinates, where arrow will be pointing |
|
511 |
/// |
|
512 |
/// \param direction whenever arrow should be pointing up (message bubble is below the arrow) or down (message bubble is above the arrow). |
|
513 |
/// |
|
514 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
515 |
/// Remove tooltip manually. |
|
516 |
/// Calling this method isn’t necessary - tooltip will dismiss itself automatically after the <code>displayDuration</code>. |
|
517 |
- (void)dismiss; |
|
518 |
- (void)drawRect:(CGRect)rect; |
|
519 |
- (void)layoutSubviews; |
|
520 |
- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; |
|
521 |
@end |
|
522 |
|
|
523 |
/// FBSDKTooltipViewArrowDirection enum |
|
524 |
/// Passed on construction to determine arrow orientation. |
|
525 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipViewArrowDirection, "ArrowDirection", closed) { |
|
526 |
FBSDKTooltipViewArrowDirectionDown = 0, |
|
527 |
FBSDKTooltipViewArrowDirectionUp = 1, |
|
528 |
}; |
|
529 |
|
|
530 |
/// FBSDKTooltipColorStyle enum |
|
531 |
/// Passed on construction to determine color styling. |
|
532 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipColorStyle, "ColorStyle", closed) { |
|
533 |
FBSDKTooltipColorStyleFriendlyBlue = 0, |
|
534 |
FBSDKTooltipColorStyleNeutralGray = 1, |
|
535 |
}; |
|
536 |
|
|
537 |
@protocol FBSDKLoginTooltipViewDelegate; |
|
538 |
|
|
539 |
/// Represents a tooltip to be displayed next to a Facebook login button |
|
540 |
/// to highlight features for new users. |
|
541 |
/// The <code>FBSDKLoginButton</code> may display this view automatically. If you do |
|
542 |
/// not use the <code>FBSDKLoginButton</code>, you can manually call one of the <code>present*</code> methods |
|
543 |
/// as appropriate and customize behavior via <code>FBSDKLoginTooltipViewDelegate</code> delegate. |
|
544 |
/// By default, the <code>FBSDKLoginTooltipView</code> is not added to the superview until it is |
|
545 |
/// determined the app has migrated to the new login experience. You can override this |
|
546 |
/// (e.g., to test the UI layout) by implementing the delegate or setting <code>forceDisplay</code> to YES. |
|
547 |
SWIFT_CLASS_NAMED("FBLoginTooltipView") |
|
548 |
@interface FBSDKLoginTooltipView : FBSDKTooltipView |
|
549 |
/// the delegate |
|
550 |
@property (nonatomic, weak) id <FBSDKLoginTooltipViewDelegate> _Nullable delegate; |
|
551 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
552 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
553 |
@property (nonatomic) BOOL forceDisplay; |
|
554 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
555 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
556 |
@property (nonatomic) BOOL shouldForceDisplay; |
|
557 |
/// Create tooltip |
|
558 |
- (nonnull instancetype)init; |
|
559 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
560 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
561 |
@end |
|
562 |
|
|
563 |
|
|
564 |
/// Internal Type exposed to facilitate transition to Swift. |
|
565 |
/// API Subject to change or removal without warning. Do not use. |
|
566 |
/// <ul> |
|
567 |
/// <li> |
|
568 |
/// Warning INTERNAL: DO NOT USE |
|
569 |
/// </li> |
|
570 |
/// </ul> |
|
571 |
SWIFT_CLASS_NAMED("FBPermission") |
|
572 |
@interface FBSDKPermission : NSObject |
|
573 |
@property (nonatomic, readonly, copy) NSString * _Nonnull description; |
|
574 |
@property (nonatomic, readonly) NSUInteger hash; |
|
575 |
/// Attempts to initialize a new permission with the given string. |
|
576 |
/// Creation will fail and return nil if the string is invalid. |
|
577 |
/// \param string The raw permission string |
|
578 |
/// |
|
579 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER; |
|
580 |
/// Returns a set of <code>FBPermission</code> from a set of raw permissions strings. |
|
581 |
/// Will return nil if any of the input permissions is invalid. |
|
582 |
+ (NSSet<FBSDKPermission *> * _Nullable)permissionsFromRawPermissions:(NSSet<NSString *> * _Nonnull)rawPermissions SWIFT_WARN_UNUSED_RESULT; |
|
583 |
/// Returns a set of string permissions from a set of <code>FBPermission</code> by |
|
584 |
/// extracting the “value” property for each element. |
|
585 |
+ (NSSet<NSString *> * _Nonnull)rawPermissionsFromPermissions:(NSSet<FBSDKPermission *> * _Nonnull)permissions SWIFT_WARN_UNUSED_RESULT; |
|
586 |
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; |
|
587 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
588 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
589 |
@end |
2e29a3
|
590 |
|
L |
591 |
|
|
592 |
|
e0ec42
|
593 |
|
L |
594 |
@class FBSDKLoginManagerLoginResult; |
|
595 |
|
|
596 |
/// A delegate for <code>FBSDKLoginButton</code> |
|
597 |
SWIFT_PROTOCOL_NAMED("LoginButtonDelegate") |
|
598 |
@protocol FBSDKLoginButtonDelegate <NSObject> |
|
599 |
/// Sent to the delegate when the button was used to login. |
|
600 |
/// @param loginButton The button being used to log in |
|
601 |
/// @param result The results of the login |
|
602 |
/// @param error The error (if any) from the login |
|
603 |
- (void)loginButton:(FBSDKLoginButton * _Nonnull)loginButton didCompleteWithResult:(FBSDKLoginManagerLoginResult * _Nullable)result error:(NSError * _Nullable)error; |
|
604 |
/// Sent to the delegate when the button was used to logout. |
|
605 |
/// @param loginButton The button being used to log out. |
|
606 |
- (void)loginButtonDidLogOut:(FBSDKLoginButton * _Nonnull)loginButton; |
|
607 |
@optional |
|
608 |
/// Sent to the delegate when the button is about to login. |
|
609 |
/// @param loginButton The button being used to log in |
|
610 |
/// @return <code>true</code> if the login should be allowed to proceed, <code>false</code> otherwise |
|
611 |
- (BOOL)loginButtonWillLogin:(FBSDKLoginButton * _Nonnull)loginButton SWIFT_WARN_UNUSED_RESULT; |
|
612 |
@end |
|
613 |
|
|
614 |
|
|
615 |
/// A configuration to use for modifying the behavior of a login attempt. |
|
616 |
SWIFT_CLASS_NAMED("LoginConfiguration") |
|
617 |
@interface FBSDKLoginConfiguration : NSObject |
|
618 |
/// The nonce that the configuration was created with. |
|
619 |
/// A unique nonce will be used if none is provided to the initializer. |
|
620 |
@property (nonatomic, readonly, copy) NSString * _Nonnull nonce; |
|
621 |
/// The tracking preference. Defaults to <code>.enabled</code>. |
|
622 |
@property (nonatomic, readonly) enum FBSDKLoginTracking tracking; |
|
623 |
/// The requested permissions for the login attempt. Defaults to an empty set. |
|
624 |
@property (nonatomic, readonly, copy) NSSet<FBSDKPermission *> * _Nonnull requestedPermissions; |
|
625 |
/// The Messenger Page Id associated with this login request. |
|
626 |
@property (nonatomic, readonly, copy) NSString * _Nullable messengerPageId; |
|
627 |
/// The auth type associated with this login request. |
|
628 |
@property (nonatomic, readonly) FBSDKLoginAuthType _Nullable authType; |
|
629 |
/// The code verifier used in the PKCE process. |
|
630 |
/// If not provided, a code verifier will be randomly generated. |
|
631 |
@property (nonatomic, readonly, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
632 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
633 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
634 |
/// @param tracking the tracking preference to use for a login attempt. |
|
635 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
636 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
637 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
638 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId; |
|
639 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
640 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
641 |
/// @param tracking the tracking preference to use for a login attempt. |
|
642 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
643 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
644 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
645 |
/// @param authType auth_type param to use for login. |
|
646 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
647 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
648 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
649 |
/// @param tracking the tracking preference to use for a login attempt. |
|
650 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
651 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
652 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce; |
|
653 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
654 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
655 |
/// @param tracking the tracking preference to use for a login attempt. |
|
656 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
657 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId; |
|
658 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
659 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
660 |
/// @param tracking the tracking preference to use for a login attempt. |
|
661 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
662 |
/// @param authType auth_type param to use for login. |
|
663 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
664 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
665 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
666 |
/// @param tracking the tracking preference to use for a login attempt. |
|
667 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
668 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
669 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
670 |
/// @param authType auth_type param to use for login. |
|
671 |
/// @param codeVerifier The code verifier used in the PKCE process. |
|
672 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType codeVerifier:(FBSDKCodeVerifier * _Nonnull)codeVerifier OBJC_DESIGNATED_INITIALIZER; |
|
673 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
674 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
675 |
/// @param tracking the tracking preference to use for a login attempt. |
|
676 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking; |
|
677 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
678 |
/// @param tracking the login tracking preference to use for a login attempt. |
|
679 |
- (nullable instancetype)initWithTracking:(enum FBSDKLoginTracking)tracking; |
|
680 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
681 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
682 |
@end |
|
683 |
|
|
684 |
/// Custom error codes for login errors in the login error domain |
|
685 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKLoginError, "LoginErrorCode", open) { |
|
686 |
/// Reserved |
|
687 |
FBSDKLoginErrorReserved = 300, |
|
688 |
/// The error code for unknown errors |
|
689 |
FBSDKLoginErrorUnknown = 301, |
|
690 |
/// The user’s password has changed and must log in again |
|
691 |
FBSDKLoginErrorPasswordChanged = 302, |
|
692 |
/// The user must log in to their account on www.facebook.com to restore access |
|
693 |
FBSDKLoginErrorUserCheckpointed = 303, |
|
694 |
/// Indicates a failure to request new permissions because the user has changed |
|
695 |
FBSDKLoginErrorUserMismatch = 304, |
|
696 |
/// The user must confirm their account with Facebook before logging in |
|
697 |
FBSDKLoginErrorUnconfirmedUser = 305, |
|
698 |
/// The Accounts framework failed without returning an error, indicating the app’s slider in the |
|
699 |
/// iOS Facebook Settings (device Settings -> Facebook -> App Name) has been disabled. |
|
700 |
FBSDKLoginErrorSystemAccountAppDisabled = 306, |
|
701 |
/// An error occurred related to Facebook system Account store |
|
702 |
FBSDKLoginErrorSystemAccountUnavailable = 307, |
|
703 |
/// The login response was missing a valid challenge string |
|
704 |
FBSDKLoginErrorBadChallengeString = 308, |
|
705 |
/// The ID token returned in login response was invalid |
|
706 |
FBSDKLoginErrorInvalidIDToken = 309, |
|
707 |
/// A current access token was required and not provided |
|
708 |
FBSDKLoginErrorMissingAccessToken = 310, |
|
709 |
}; |
|
710 |
|
|
711 |
@class UIViewController; |
|
712 |
|
|
713 |
/// Provides methods for logging the user in and out. |
|
714 |
/// It works directly with <code>AccessToken</code> (for data access) and <code>AuthenticationToken</code> (for authentication); |
|
715 |
/// it sets the “current” tokens upon successful authorizations (or sets to <code>nil</code> in case of <code>logOut</code>). |
|
716 |
/// You should check <code>AccessToken.current</code> before calling a login method to see if there is |
|
717 |
/// a cached token available (typically in a <code>viewDidLoad</code> implementation). |
|
718 |
/// @warning If you are managing your own tokens outside of <code>AccessToken</code>, you will need to set |
|
719 |
/// <code>AccessToken.current</code> before calling a login method to authorize further permissions on your tokens. |
|
720 |
SWIFT_CLASS_NAMED("LoginManager") |
|
721 |
@interface FBSDKLoginManager : NSObject |
|
722 |
/// The default audience. You should set this if you intend to ask for publish permissions. |
|
723 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
724 |
/// Initialize an instance of <code>LoginManager.</code> |
|
725 |
/// \param defaultAudience Optional default audience to use. Default: <code>.friends</code>. |
|
726 |
/// |
|
727 |
- (nonnull instancetype)initWithDefaultAudience:(enum FBSDKDefaultAudience)defaultAudience; |
|
728 |
/// Logs the user in or authorizes additional permissions. |
|
729 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
730 |
/// controller will be automatically determined and used. |
|
731 |
/// @param configuration the login configuration to use. |
|
732 |
/// @param completion the login completion handler. |
|
733 |
/// Use this method when asking for permissions. You should only ask for permissions when they |
|
734 |
/// are needed and the value should be explained to the user. You can inspect the |
|
735 |
/// <code>FBSDKLoginManagerLoginResultBlock</code>’s <code>result.declinedPermissions</code> to provide more information |
|
736 |
/// to the user if they decline permissions. |
|
737 |
/// To reduce unnecessary login attempts, you should typically check if <code>AccessToken.current</code> |
|
738 |
/// already contains the permissions you need. If it does, you probably do not need to call this method. |
|
739 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
740 |
/// called on a previous login attempt will result in an error. |
|
741 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
742 |
- (void)logInFromViewController:(UIViewController * _Nullable)viewController configuration:(FBSDKLoginConfiguration * _Nullable)configuration completion:(FBSDKLoginManagerLoginResultBlock _Nonnull)completion; |
|
743 |
/// Logs the user in or authorizes additional permissions. |
|
744 |
/// @param permissions the optional array of permissions. Note this is converted to NSSet and is only |
|
745 |
/// an NSArray for the convenience of literal syntax. |
|
746 |
/// @param viewController the view controller to present from. If nil, the topmost view controller will be |
|
747 |
/// automatically determined as best as possible. |
|
748 |
/// @param handler the callback. |
|
749 |
/// Use this method when asking for read permissions. You should only ask for permissions when they |
|
750 |
/// are needed and explain the value to the user. You can inspect the <code>FBSDKLoginManagerLoginResultBlock</code>’s |
|
751 |
/// <code>result.declinedPermissions</code> to provide more information to the user if they decline permissions. |
|
752 |
/// You typically should check if <code>AccessToken.current</code> already contains the permissions you need before |
|
753 |
/// asking to reduce unnecessary login attempts. For example, you could perform that check in <code>viewDidLoad</code>. |
|
754 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
755 |
/// called on a previous login attempt will result in an error. |
|
756 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
757 |
- (void)logInWithPermissions:(NSArray<NSString *> * _Nonnull)permissions fromViewController:(UIViewController * _Nullable)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nullable)handler; |
|
758 |
/// Requests user’s permission to reathorize application’s data access, after it has expired due to inactivity. |
|
759 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
760 |
/// controller will be automatically determined and used. |
|
761 |
/// @param handler the callback. |
|
762 |
/// Use this method when you need to reathorize your app’s access to user data via the Graph API. |
|
763 |
/// You should only call this after access has expired. |
|
764 |
/// You should provide as much context to the user as possible as to why you need to reauthorize the access, the |
|
765 |
/// scope of access being reathorized, and what added value your app provides when the access is reathorized. |
|
766 |
/// You can inspect the <code>result.declinedPermissions</code> to determine if you should provide more information to the |
|
767 |
/// user based on any declined permissions. |
|
768 |
/// @warning This method will reauthorize using a <code>LoginConfiguration</code> with <code>FBSDKLoginTracking</code> set to <code>.enabled</code>. |
|
769 |
/// @warning This method will present UI the user. You typically should call this if <code>AccessToken.isDataAccessExpired</code> |
|
770 |
/// is true. |
|
771 |
- (void)reauthorizeDataAccess:(UIViewController * _Nonnull)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nonnull)handler; |
|
772 |
/// Logs the user out |
|
773 |
/// This nils out the singleton instances of <code>AccessToken</code>, <code>AuthenticationToken</code> and <code>Profle</code>. |
|
774 |
/// @note This is only a client side logout. It will not log the user out of their Facebook account. |
|
775 |
- (void)logOut; |
|
776 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
|
777 |
@end |
|
778 |
|
|
779 |
|
|
780 |
|
|
781 |
@class UIApplication; |
|
782 |
|
|
783 |
@interface FBSDKLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <FBSDKURLOpening> |
|
784 |
+ (FBSDKLoginManager * _Nonnull)makeOpener SWIFT_WARN_UNUSED_RESULT; |
|
785 |
- (BOOL)application:(UIApplication * _Nullable)application openURL:(NSURL * _Nullable)url sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
786 |
- (BOOL)canOpenURL:(NSURL * _Nonnull)url forApplication:(UIApplication * _Nullable)application sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
787 |
- (void)applicationDidBecomeActive:(UIApplication * _Nonnull)application; |
|
788 |
- (BOOL)isAuthenticationURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
789 |
- (BOOL)shouldStopPropagationOfURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
790 |
@end |
|
791 |
|
|
792 |
@class FBSDKAuthenticationToken; |
|
793 |
|
|
794 |
/// Describes the result of a login attempt. |
|
795 |
SWIFT_CLASS_NAMED("LoginManagerLoginResult") |
|
796 |
@interface FBSDKLoginManagerLoginResult : NSObject |
|
797 |
/// The access token |
|
798 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable token; |
|
799 |
/// The authentication token |
|
800 |
@property (nonatomic, readonly, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
801 |
/// Whether the login was cancelled by the user |
|
802 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
803 |
/// The set of permissions granted by the user in the associated request. |
|
804 |
/// Inspect the token’s permissions set for a complete list. |
|
805 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull grantedPermissions; |
|
806 |
/// The set of permissions declined by the user in the associated request. |
|
807 |
/// Inspect the token’s permissions set for a complete list. |
|
808 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull declinedPermissions; |
|
809 |
/// Creates a new result |
|
810 |
/// @param token The access token |
|
811 |
/// @param authenticationToken The authentication token |
|
812 |
/// @param isCancelled whether The login was cancelled by the user |
|
813 |
/// @param grantedPermissions The set of granted permissions |
|
814 |
/// @param declinedPermissions The set of declined permissions |
|
815 |
- (nonnull instancetype)initWithToken:(FBSDKAccessToken * _Nullable)token authenticationToken:(FBSDKAuthenticationToken * _Nullable)authenticationToken isCancelled:(BOOL)isCancelled grantedPermissions:(NSSet<NSString *> * _Nonnull)grantedPermissions declinedPermissions:(NSSet<NSString *> * _Nonnull)declinedPermissions OBJC_DESIGNATED_INITIALIZER; |
|
816 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
817 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
818 |
@end |
|
819 |
|
|
820 |
|
|
821 |
/// The <code>LoginTooltipViewDelegate</code> protocol defines the methods used to receive event |
|
822 |
/// notifications from <code>FBLoginTooltipView</code> objects. |
|
823 |
SWIFT_PROTOCOL_NAMED("LoginTooltipViewDelegate") |
|
824 |
@protocol FBSDKLoginTooltipViewDelegate |
|
825 |
@optional |
|
826 |
/// Asks the delegate if the tooltip view should appear |
|
827 |
/// @param view The tooltip view. |
|
828 |
/// @param appIsEligible The value fetched from the server identifying if the app |
|
829 |
/// is eligible for the new login experience. |
|
830 |
/// Use this method to customize display behavior. |
|
831 |
- (BOOL)loginTooltipView:(FBSDKLoginTooltipView * _Nonnull)view shouldAppear:(BOOL)appIsEligible SWIFT_WARN_UNUSED_RESULT; |
|
832 |
/// Tells the delegate the tooltip view will appear, specifically after it’s been |
|
833 |
/// added to the super view but before the fade in animation. |
|
834 |
/// @param view The tooltip view. |
|
835 |
- (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
836 |
/// Tells the delegate the tooltip view will not appear (i.e., was not |
|
837 |
/// added to the super view). |
|
838 |
/// @param view The tooltip view. |
|
839 |
- (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
840 |
@end |
|
841 |
|
|
842 |
/// <code>enabled</code> and <code>limited</code> see: https://developers.facebook.com/docs/facebook-login/ios/limited-login/ |
|
843 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginTracking, "LoginTracking", open) { |
|
844 |
FBSDKLoginTrackingEnabled = 0, |
|
845 |
FBSDKLoginTrackingLimited = 1, |
|
846 |
}; |
|
847 |
|
|
848 |
|
|
849 |
@class FBSDKProfile; |
|
850 |
|
|
851 |
/// Internal Type exposed to facilitate transition to Swift. |
|
852 |
/// API Subject to change or removal without warning. Do not use. |
|
853 |
/// <ul> |
|
854 |
/// <li> |
|
855 |
/// Warning INTERNAL: DO NOT USE |
|
856 |
/// </li> |
|
857 |
/// </ul> |
|
858 |
/// Structured interface for accessing the parameters used to complete a log in request. |
|
859 |
/// If <code>authenticationTokenString</code> is non-<code>nil</code>, the authentication succeeded. If <code>error</code> is |
|
860 |
/// non-<code>nil</code> the request failed. If both are <code>nil</code>, the request was cancelled. |
|
861 |
SWIFT_CLASS_NAMED("_LoginCompletionParameters") |
|
862 |
@interface FBSDKLoginCompletionParameters : NSObject |
|
863 |
@property (nonatomic, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
864 |
@property (nonatomic, strong) FBSDKProfile * _Nullable profile; |
|
865 |
@property (nonatomic, copy) NSString * _Nullable accessTokenString; |
|
866 |
@property (nonatomic, copy) NSString * _Nullable nonceString; |
|
867 |
@property (nonatomic, copy) NSString * _Nullable authenticationTokenString; |
|
868 |
@property (nonatomic, copy) NSString * _Nullable code; |
|
869 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable permissions; |
|
870 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable declinedPermissions; |
|
871 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable expiredPermissions; |
|
872 |
@property (nonatomic, copy) NSString * _Nullable appID; |
|
873 |
@property (nonatomic, copy) NSString * _Nullable userID; |
|
874 |
@property (nonatomic) NSError * _Nullable error; |
|
875 |
@property (nonatomic, copy) NSDate * _Nullable expirationDate; |
|
876 |
@property (nonatomic, copy) NSDate * _Nullable dataAccessExpirationDate; |
|
877 |
@property (nonatomic, copy) NSString * _Nullable challenge; |
|
878 |
@property (nonatomic, copy) NSString * _Nullable graphDomain; |
|
879 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
|
880 |
@end |
|
881 |
|
|
882 |
#endif |
|
883 |
#if defined(__cplusplus) |
|
884 |
#endif |
2e29a3
|
885 |
#if __has_attribute(external_source_symbol) |
L |
886 |
# pragma clang attribute pop |
|
887 |
#endif |
|
888 |
#pragma clang diagnostic pop |
|
889 |
#endif |
|
890 |
|
|
891 |
#elif defined(__x86_64__) && __x86_64__ |
e0ec42
|
892 |
// Generated by Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) |
2e29a3
|
893 |
#ifndef FBSDKLOGINKIT_SWIFT_H |
L |
894 |
#define FBSDKLOGINKIT_SWIFT_H |
|
895 |
#pragma clang diagnostic push |
|
896 |
#pragma clang diagnostic ignored "-Wgcc-compat" |
|
897 |
|
|
898 |
#if !defined(__has_include) |
|
899 |
# define __has_include(x) 0 |
|
900 |
#endif |
|
901 |
#if !defined(__has_attribute) |
|
902 |
# define __has_attribute(x) 0 |
|
903 |
#endif |
|
904 |
#if !defined(__has_feature) |
|
905 |
# define __has_feature(x) 0 |
|
906 |
#endif |
|
907 |
#if !defined(__has_warning) |
|
908 |
# define __has_warning(x) 0 |
|
909 |
#endif |
|
910 |
|
|
911 |
#if __has_include(<swift/objc-prologue.h>) |
|
912 |
# include <swift/objc-prologue.h> |
|
913 |
#endif |
|
914 |
|
e0ec42
|
915 |
#pragma clang diagnostic ignored "-Wduplicate-method-match" |
2e29a3
|
916 |
#pragma clang diagnostic ignored "-Wauto-import" |
e0ec42
|
917 |
#if defined(__OBJC__) |
2e29a3
|
918 |
#include <Foundation/Foundation.h> |
e0ec42
|
919 |
#endif |
L |
920 |
#if defined(__cplusplus) |
|
921 |
#include <cstdint> |
|
922 |
#include <cstddef> |
|
923 |
#include <cstdbool> |
|
924 |
#else |
2e29a3
|
925 |
#include <stdint.h> |
L |
926 |
#include <stddef.h> |
|
927 |
#include <stdbool.h> |
e0ec42
|
928 |
#endif |
2e29a3
|
929 |
|
L |
930 |
#if !defined(SWIFT_TYPEDEFS) |
|
931 |
# define SWIFT_TYPEDEFS 1 |
|
932 |
# if __has_include(<uchar.h>) |
|
933 |
# include <uchar.h> |
|
934 |
# elif !defined(__cplusplus) |
|
935 |
typedef uint_least16_t char16_t; |
|
936 |
typedef uint_least32_t char32_t; |
|
937 |
# endif |
|
938 |
typedef float swift_float2 __attribute__((__ext_vector_type__(2))); |
|
939 |
typedef float swift_float3 __attribute__((__ext_vector_type__(3))); |
|
940 |
typedef float swift_float4 __attribute__((__ext_vector_type__(4))); |
|
941 |
typedef double swift_double2 __attribute__((__ext_vector_type__(2))); |
|
942 |
typedef double swift_double3 __attribute__((__ext_vector_type__(3))); |
|
943 |
typedef double swift_double4 __attribute__((__ext_vector_type__(4))); |
|
944 |
typedef int swift_int2 __attribute__((__ext_vector_type__(2))); |
|
945 |
typedef int swift_int3 __attribute__((__ext_vector_type__(3))); |
|
946 |
typedef int swift_int4 __attribute__((__ext_vector_type__(4))); |
|
947 |
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); |
|
948 |
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); |
|
949 |
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); |
|
950 |
#endif |
|
951 |
|
|
952 |
#if !defined(SWIFT_PASTE) |
|
953 |
# define SWIFT_PASTE_HELPER(x, y) x##y |
|
954 |
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) |
|
955 |
#endif |
|
956 |
#if !defined(SWIFT_METATYPE) |
|
957 |
# define SWIFT_METATYPE(X) Class |
|
958 |
#endif |
|
959 |
#if !defined(SWIFT_CLASS_PROPERTY) |
|
960 |
# if __has_feature(objc_class_property) |
|
961 |
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ |
|
962 |
# else |
|
963 |
# define SWIFT_CLASS_PROPERTY(...) |
|
964 |
# endif |
|
965 |
#endif |
|
966 |
|
|
967 |
#if __has_attribute(objc_runtime_name) |
|
968 |
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) |
|
969 |
#else |
|
970 |
# define SWIFT_RUNTIME_NAME(X) |
|
971 |
#endif |
|
972 |
#if __has_attribute(swift_name) |
|
973 |
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) |
|
974 |
#else |
|
975 |
# define SWIFT_COMPILE_NAME(X) |
|
976 |
#endif |
|
977 |
#if __has_attribute(objc_method_family) |
|
978 |
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) |
|
979 |
#else |
|
980 |
# define SWIFT_METHOD_FAMILY(X) |
|
981 |
#endif |
|
982 |
#if __has_attribute(noescape) |
|
983 |
# define SWIFT_NOESCAPE __attribute__((noescape)) |
|
984 |
#else |
|
985 |
# define SWIFT_NOESCAPE |
|
986 |
#endif |
|
987 |
#if __has_attribute(ns_consumed) |
|
988 |
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) |
|
989 |
#else |
|
990 |
# define SWIFT_RELEASES_ARGUMENT |
|
991 |
#endif |
|
992 |
#if __has_attribute(warn_unused_result) |
|
993 |
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
|
994 |
#else |
|
995 |
# define SWIFT_WARN_UNUSED_RESULT |
|
996 |
#endif |
|
997 |
#if __has_attribute(noreturn) |
|
998 |
# define SWIFT_NORETURN __attribute__((noreturn)) |
|
999 |
#else |
|
1000 |
# define SWIFT_NORETURN |
|
1001 |
#endif |
|
1002 |
#if !defined(SWIFT_CLASS_EXTRA) |
|
1003 |
# define SWIFT_CLASS_EXTRA |
|
1004 |
#endif |
|
1005 |
#if !defined(SWIFT_PROTOCOL_EXTRA) |
|
1006 |
# define SWIFT_PROTOCOL_EXTRA |
|
1007 |
#endif |
|
1008 |
#if !defined(SWIFT_ENUM_EXTRA) |
|
1009 |
# define SWIFT_ENUM_EXTRA |
|
1010 |
#endif |
|
1011 |
#if !defined(SWIFT_CLASS) |
|
1012 |
# if __has_attribute(objc_subclassing_restricted) |
|
1013 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA |
|
1014 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
1015 |
# else |
|
1016 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
1017 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
1018 |
# endif |
|
1019 |
#endif |
|
1020 |
#if !defined(SWIFT_RESILIENT_CLASS) |
|
1021 |
# if __has_attribute(objc_class_stub) |
|
1022 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) |
|
1023 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
1024 |
# else |
|
1025 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) |
|
1026 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
1027 |
# endif |
|
1028 |
#endif |
|
1029 |
|
|
1030 |
#if !defined(SWIFT_PROTOCOL) |
|
1031 |
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
1032 |
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
1033 |
#endif |
|
1034 |
|
|
1035 |
#if !defined(SWIFT_EXTENSION) |
|
1036 |
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) |
|
1037 |
#endif |
|
1038 |
|
|
1039 |
#if !defined(OBJC_DESIGNATED_INITIALIZER) |
|
1040 |
# if __has_attribute(objc_designated_initializer) |
|
1041 |
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) |
|
1042 |
# else |
|
1043 |
# define OBJC_DESIGNATED_INITIALIZER |
|
1044 |
# endif |
|
1045 |
#endif |
|
1046 |
#if !defined(SWIFT_ENUM_ATTR) |
|
1047 |
# if defined(__has_attribute) && __has_attribute(enum_extensibility) |
|
1048 |
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) |
|
1049 |
# else |
|
1050 |
# define SWIFT_ENUM_ATTR(_extensibility) |
|
1051 |
# endif |
|
1052 |
#endif |
|
1053 |
#if !defined(SWIFT_ENUM) |
|
1054 |
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type |
|
1055 |
# if __has_feature(generalized_swift_name) |
|
1056 |
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type |
|
1057 |
# else |
|
1058 |
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) |
|
1059 |
# endif |
|
1060 |
#endif |
|
1061 |
#if !defined(SWIFT_UNAVAILABLE) |
|
1062 |
# define SWIFT_UNAVAILABLE __attribute__((unavailable)) |
|
1063 |
#endif |
|
1064 |
#if !defined(SWIFT_UNAVAILABLE_MSG) |
|
1065 |
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) |
|
1066 |
#endif |
|
1067 |
#if !defined(SWIFT_AVAILABILITY) |
|
1068 |
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) |
|
1069 |
#endif |
|
1070 |
#if !defined(SWIFT_WEAK_IMPORT) |
|
1071 |
# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) |
|
1072 |
#endif |
|
1073 |
#if !defined(SWIFT_DEPRECATED) |
|
1074 |
# define SWIFT_DEPRECATED __attribute__((deprecated)) |
|
1075 |
#endif |
|
1076 |
#if !defined(SWIFT_DEPRECATED_MSG) |
|
1077 |
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) |
|
1078 |
#endif |
|
1079 |
#if __has_feature(attribute_diagnose_if_objc) |
|
1080 |
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) |
|
1081 |
#else |
|
1082 |
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) |
|
1083 |
#endif |
e0ec42
|
1084 |
#if defined(__OBJC__) |
2e29a3
|
1085 |
#if !defined(IBSegueAction) |
L |
1086 |
# define IBSegueAction |
|
1087 |
#endif |
e0ec42
|
1088 |
#endif |
L |
1089 |
#if !defined(SWIFT_EXTERN) |
|
1090 |
# if defined(__cplusplus) |
|
1091 |
# define SWIFT_EXTERN extern "C" |
|
1092 |
# else |
|
1093 |
# define SWIFT_EXTERN extern |
|
1094 |
# endif |
|
1095 |
#endif |
|
1096 |
#if !defined(SWIFT_CALL) |
|
1097 |
# define SWIFT_CALL __attribute__((swiftcall)) |
|
1098 |
#endif |
|
1099 |
#if defined(__cplusplus) |
|
1100 |
#if !defined(SWIFT_NOEXCEPT) |
|
1101 |
# define SWIFT_NOEXCEPT noexcept |
|
1102 |
#endif |
|
1103 |
#else |
|
1104 |
#if !defined(SWIFT_NOEXCEPT) |
|
1105 |
# define SWIFT_NOEXCEPT |
|
1106 |
#endif |
|
1107 |
#endif |
|
1108 |
#if defined(__cplusplus) |
|
1109 |
#if !defined(SWIFT_CXX_INT_DEFINED) |
|
1110 |
#define SWIFT_CXX_INT_DEFINED |
|
1111 |
namespace swift { |
|
1112 |
using Int = ptrdiff_t; |
|
1113 |
using UInt = size_t; |
|
1114 |
} |
|
1115 |
#endif |
|
1116 |
#endif |
|
1117 |
#if defined(__OBJC__) |
2e29a3
|
1118 |
#if __has_feature(modules) |
L |
1119 |
#if __has_warning("-Watimport-in-framework-header") |
|
1120 |
#pragma clang diagnostic ignored "-Watimport-in-framework-header" |
|
1121 |
#endif |
e0ec42
|
1122 |
@import CoreFoundation; |
L |
1123 |
@import FBSDKCoreKit; |
|
1124 |
@import Foundation; |
|
1125 |
@import ObjectiveC; |
|
1126 |
@import UIKit; |
2e29a3
|
1127 |
#endif |
L |
1128 |
|
e0ec42
|
1129 |
#import <FBSDKLoginKit/FBSDKLoginKit.h> |
L |
1130 |
|
|
1131 |
#endif |
2e29a3
|
1132 |
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" |
L |
1133 |
#pragma clang diagnostic ignored "-Wduplicate-method-arg" |
|
1134 |
#if __has_warning("-Wpragma-clang-attribute") |
|
1135 |
# pragma clang diagnostic ignored "-Wpragma-clang-attribute" |
|
1136 |
#endif |
|
1137 |
#pragma clang diagnostic ignored "-Wunknown-pragmas" |
|
1138 |
#pragma clang diagnostic ignored "-Wnullability" |
e0ec42
|
1139 |
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
2e29a3
|
1140 |
|
L |
1141 |
#if __has_attribute(external_source_symbol) |
|
1142 |
# pragma push_macro("any") |
|
1143 |
# undef any |
|
1144 |
# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="FBSDKLoginKit",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol)) |
|
1145 |
# pragma pop_macro("any") |
|
1146 |
#endif |
|
1147 |
|
e0ec42
|
1148 |
#if defined(__OBJC__) |
L |
1149 |
|
|
1150 |
@class NSString; |
|
1151 |
|
|
1152 |
/// Represents a code verifier used in the PKCE (Proof Key for Code Exchange) |
|
1153 |
/// process. This is a cryptographically random string using the characters |
|
1154 |
/// A-Z, a-z, 0-9, and the punctuation characters -._~ (hyphen, period, |
|
1155 |
/// underscore, and tilde), between 43 and 128 characters long. |
|
1156 |
SWIFT_CLASS_NAMED("CodeVerifier") |
|
1157 |
@interface FBSDKCodeVerifier : NSObject |
|
1158 |
/// The string value of the code verifier |
|
1159 |
@property (nonatomic, readonly, copy) NSString * _Nonnull value; |
|
1160 |
/// The SHA256 hashed challenge of the code verifier |
|
1161 |
@property (nonatomic, readonly, copy) NSString * _Nonnull challenge; |
|
1162 |
/// Attempts to initialize a new code verifier instance with the given string. |
|
1163 |
/// Creation will fail and return nil if the string is invalid. |
|
1164 |
/// @param string the code verifier string |
|
1165 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string; |
|
1166 |
/// Initializes a new code verifier instance with a random string value |
|
1167 |
- (nonnull instancetype)init; |
|
1168 |
@end |
|
1169 |
|
|
1170 |
/// Passed to openURL to indicate which default audience to use for sessions that post data to Facebook. |
|
1171 |
/// Certain operations such as publishing a status or publishing a photo require an audience. When the user |
|
1172 |
/// grants an application permission to perform a publish operation, a default audience is selected as the |
|
1173 |
/// publication ceiling for the application. This enumerated value allows the application to select which |
|
1174 |
/// audience to ask the user to grant publish permission for. |
|
1175 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKDefaultAudience, "DefaultAudience", open) { |
|
1176 |
/// Indicates that the user’s friends are able to see posts made by the application |
|
1177 |
FBSDKDefaultAudienceFriends = 0, |
|
1178 |
/// Indicates that only the user is able to see posts made by the application |
|
1179 |
FBSDKDefaultAudienceOnlyMe = 1, |
|
1180 |
/// Indicates that all Facebook users are able to see posts made by the application |
|
1181 |
FBSDKDefaultAudienceEveryone = 2, |
|
1182 |
}; |
|
1183 |
|
|
1184 |
@class NSURL; |
|
1185 |
@class NSDate; |
|
1186 |
|
|
1187 |
/// Describes the initial response when starting the device login flow. |
|
1188 |
/// This is used by <code>DeviceLoginManager</code>. |
|
1189 |
SWIFT_CLASS_NAMED("DeviceLoginCodeInfo") |
|
1190 |
@interface FBSDKDeviceLoginCodeInfo : NSObject |
|
1191 |
/// The unique id for this login flow. |
|
1192 |
@property (nonatomic, readonly, copy) NSString * _Nonnull identifier; |
|
1193 |
/// The short “user_code” that should be presented to the user. |
|
1194 |
@property (nonatomic, readonly, copy) NSString * _Nonnull loginCode; |
|
1195 |
/// The verification URL. |
|
1196 |
@property (nonatomic, readonly, copy) NSURL * _Nonnull verificationURL; |
|
1197 |
/// The expiration date. |
|
1198 |
@property (nonatomic, readonly, copy) NSDate * _Nonnull expirationDate; |
|
1199 |
/// The polling interval |
|
1200 |
@property (nonatomic, readonly) NSUInteger pollingInterval; |
|
1201 |
- (nonnull instancetype)initWithIdentifier:(NSString * _Nonnull)identifier loginCode:(NSString * _Nonnull)loginCode verificationURL:(NSURL * _Nonnull)verificationURL expirationDate:(NSDate * _Nonnull)expirationDate pollingInterval:(NSUInteger)pollingInterval OBJC_DESIGNATED_INITIALIZER; |
|
1202 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1203 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1204 |
@end |
|
1205 |
|
|
1206 |
/// Custom error codes for device login errors in the login error domain |
|
1207 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKDeviceLoginError, "DeviceLoginErrorCode", open) { |
|
1208 |
/// Your device is polling too frequently. |
|
1209 |
FBSDKDeviceLoginErrorExcessivePolling = 1349172, |
|
1210 |
/// User has declined to authorize your application. |
|
1211 |
FBSDKDeviceLoginErrorAuthorizationDeclined = 1349173, |
|
1212 |
/// User has not yet authorized your application. Continue polling. |
|
1213 |
FBSDKDeviceLoginErrorAuthorizationPending = 1349174, |
|
1214 |
/// The code you entered has expired. |
|
1215 |
FBSDKDeviceLoginErrorCodeExpired = 1349152, |
|
1216 |
}; |
|
1217 |
|
|
1218 |
@protocol FBSDKDeviceLoginManagerDelegate; |
|
1219 |
|
|
1220 |
/// Use this class to perform a device login flow. |
|
1221 |
/// The device login flow starts by requesting a code from the device login API. |
|
1222 |
/// This class informs the delegate when this code is received. You should then present the |
|
1223 |
/// code to the user to enter. In the meantime, this class polls the device login API |
|
1224 |
/// periodically and informs the delegate of the results. |
|
1225 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/for-devices">Facebook Device Login</a>. |
|
1226 |
SWIFT_CLASS_NAMED("DeviceLoginManager") |
|
1227 |
@interface FBSDKDeviceLoginManager : NSObject |
|
1228 |
/// The device login manager delegate. |
|
1229 |
@property (nonatomic, weak) id <FBSDKDeviceLoginManagerDelegate> _Nullable delegate; |
|
1230 |
/// The requested permissions. |
|
1231 |
@property (nonatomic, readonly, copy) NSArray<NSString *> * _Nonnull permissions; |
|
1232 |
/// The optional URL to redirect the user to after they complete the login. |
|
1233 |
/// The URL must be configured in your App Settings -> Advanced -> OAuth Redirect URIs |
|
1234 |
@property (nonatomic, copy) NSURL * _Nullable redirectURL; |
|
1235 |
/// Initializes a new instance. |
|
1236 |
/// @param permissions The permissions to request. |
|
1237 |
/// @param enableSmartLogin Whether to enable smart login. |
|
1238 |
- (nonnull instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions enableSmartLogin:(BOOL)enableSmartLogin OBJC_DESIGNATED_INITIALIZER; |
|
1239 |
/// Starts the device login flow |
|
1240 |
/// This instance will retain self until the flow is finished or cancelled. |
|
1241 |
- (void)start; |
|
1242 |
/// Attempts to cancel the device login flow. |
|
1243 |
- (void)cancel; |
|
1244 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1245 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1246 |
@end |
|
1247 |
|
|
1248 |
@class NSNetService; |
|
1249 |
@class NSNumber; |
|
1250 |
|
|
1251 |
@interface FBSDKDeviceLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <NSNetServiceDelegate> |
|
1252 |
- (void)netService:(NSNetService * _Nonnull)service didNotPublish:(NSDictionary<NSString *, NSNumber *> * _Nonnull)errorValues; |
|
1253 |
@end |
|
1254 |
|
|
1255 |
|
|
1256 |
@class FBSDKDeviceLoginManagerResult; |
|
1257 |
|
|
1258 |
/// A delegate for <code>DeviceLoginManager</code>. |
|
1259 |
SWIFT_PROTOCOL_NAMED("DeviceLoginManagerDelegate") |
|
1260 |
@protocol FBSDKDeviceLoginManagerDelegate |
|
1261 |
/// Indicates the device login flow has started. You should parse <code>codeInfo</code> to present the code to the user to enter. |
|
1262 |
/// @param loginManager the login manager instance. |
|
1263 |
/// @param codeInfo the code info data. |
|
1264 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager startedWithCodeInfo:(FBSDKDeviceLoginCodeInfo * _Nonnull)codeInfo; |
|
1265 |
/// Indicates the device login flow has finished. |
|
1266 |
/// @param loginManager the login manager instance. |
|
1267 |
/// @param result the results of the login flow. |
|
1268 |
/// @param error the error, if available. |
|
1269 |
/// The flow can be finished if the user completed the flow, cancelled, or if the code has expired. |
|
1270 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager completedWithResult:(FBSDKDeviceLoginManagerResult * _Nullable)result error:(NSError * _Nullable)error; |
|
1271 |
@end |
|
1272 |
|
|
1273 |
@class FBSDKAccessToken; |
|
1274 |
|
|
1275 |
/// Represents the results of the a device login flow. This is used by <code>DeviceLoginManager</code> |
|
1276 |
SWIFT_CLASS_NAMED("DeviceLoginManagerResult") |
|
1277 |
@interface FBSDKDeviceLoginManagerResult : NSObject |
|
1278 |
/// The token |
|
1279 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable accessToken; |
|
1280 |
/// Indicates if the login was cancelled by the user, or if the device login code has expired. |
|
1281 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
1282 |
/// Internal method exposed to facilitate transition to Swift. |
|
1283 |
/// API Subject to change or removal without warning. Do not use. |
|
1284 |
/// @warning INTERNAL - DO NOT USE |
|
1285 |
- (nonnull instancetype)initWithToken:(FBSDKAccessToken * _Nullable)token isCancelled:(BOOL)cancelled OBJC_DESIGNATED_INITIALIZER; |
|
1286 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1287 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1288 |
@end |
|
1289 |
|
|
1290 |
@protocol FBSDKLoginButtonDelegate; |
|
1291 |
enum FBSDKLoginButtonTooltipBehavior : NSUInteger; |
|
1292 |
enum FBSDKTooltipColorStyle : NSUInteger; |
|
1293 |
enum FBSDKLoginTracking : NSUInteger; |
|
1294 |
@class NSCoder; |
|
1295 |
|
|
1296 |
/// A button that initiates a log in or log out flow upon tapping. |
|
1297 |
/// <code>LoginButton</code> works with <code>AccessToken.current</code> to determine what to display, |
|
1298 |
/// and automatically starts authentication when tapped (i.e., you do not need to manually subscribe action targets). |
|
1299 |
/// Like <code>LoginManager</code>, you should make sure your app delegate is connected to <code>ApplicationDelegate</code> |
|
1300 |
/// in order for the button’s delegate to receive messages. |
|
1301 |
/// <code>LoginButton</code> has a fixed height of 30 pixels, but you may change the width. |
|
1302 |
/// Initializing the button with <code>nil</code> frame will size the button to its minimum frame. |
|
1303 |
SWIFT_CLASS_NAMED("FBLoginButton") |
|
1304 |
@interface FBSDKLoginButton : FBSDKButton |
|
1305 |
/// The default audience to use, if publish permissions are requested at login time. |
|
1306 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
1307 |
/// Gets or sets the delegate. |
|
1308 |
@property (nonatomic, weak) IBOutlet id <FBSDKLoginButtonDelegate> _Nullable delegate; |
|
1309 |
/// The permissions to request. |
|
1310 |
/// To provide the best experience, you should minimize the number of permissions you request, and only ask for them when needed. |
|
1311 |
/// For example, do not ask for “user_location” until you the information is actually used by the app. |
|
1312 |
/// Note this is converted to NSSet and is only |
|
1313 |
/// an NSArray for the convenience of literal syntax. |
|
1314 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/permissions/">the permissions guide</a> for more details. |
|
1315 |
@property (nonatomic, copy) NSArray<NSString *> * _Nonnull permissions; |
|
1316 |
/// Gets or sets the desired tooltip behavior. |
|
1317 |
@property (nonatomic) enum FBSDKLoginButtonTooltipBehavior tooltipBehavior; |
|
1318 |
/// Gets or sets the desired tooltip color style. |
|
1319 |
@property (nonatomic) enum FBSDKTooltipColorStyle tooltipColorStyle; |
|
1320 |
/// Gets or sets the desired tracking preference to use for login attempts. Defaults to <code>.enabled</code> |
|
1321 |
@property (nonatomic) enum FBSDKLoginTracking loginTracking; |
|
1322 |
/// Gets or sets an optional nonce to use for login attempts. A valid nonce must be a non-empty string without whitespace. |
|
1323 |
/// An invalid nonce will not be set. Instead, default unique nonces will be used for login attempts. |
|
1324 |
@property (nonatomic, copy) NSString * _Nullable nonce; |
|
1325 |
/// Gets or sets an optional page id to use for login attempts. |
|
1326 |
@property (nonatomic, copy) NSString * _Nullable messengerPageId; |
|
1327 |
/// Gets or sets the login authorization type to use in the login request. Defaults to <code>rerequest</code>. Use <code>nil</code> to avoid |
|
1328 |
/// requesting permissions that were previously denied. |
|
1329 |
@property (nonatomic) FBSDKLoginAuthType _Nullable authType; |
|
1330 |
/// The code verifier used in the PKCE process. |
|
1331 |
/// If not provided, a code verifier will be randomly generated. |
|
1332 |
@property (nonatomic, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
1333 |
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; |
|
1334 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE; |
|
1335 |
- (void)didMoveToWindow; |
|
1336 |
- (CGRect)imageRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
1337 |
- (CGRect)titleRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
1338 |
- (void)layoutSubviews; |
|
1339 |
- (CGSize)sizeThatFits:(CGSize)size SWIFT_WARN_UNUSED_RESULT; |
|
1340 |
@end |
|
1341 |
|
|
1342 |
/// Indicates the desired login tooltip behavior. |
|
1343 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginButtonTooltipBehavior, "TooltipBehavior", open) { |
|
1344 |
/// The default behavior. The tooltip will only be displayed if |
|
1345 |
/// the app is eligible (determined by possible server round trip) |
|
1346 |
FBSDKLoginButtonTooltipBehaviorAutomatic = 0, |
|
1347 |
/// Force display of the tooltip (typically for UI testing) |
|
1348 |
FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, |
|
1349 |
/// Force disable. In this case you can still exert more refined |
|
1350 |
/// control by manually constructing a <code>FBSDKLoginTooltipView</code> instance. |
|
1351 |
FBSDKLoginButtonTooltipBehaviorDisable = 2, |
|
1352 |
}; |
|
1353 |
|
|
1354 |
enum FBSDKTooltipViewArrowDirection : NSUInteger; |
|
1355 |
|
|
1356 |
/// Tooltip bubble with text in it used to display tips for UI elements, |
|
1357 |
/// with a pointed arrow (to refer to the UI element). |
|
1358 |
/// The tooltip fades in and will automatically fade out. See <code>displayDuration</code>. |
|
1359 |
SWIFT_CLASS_NAMED("FBTooltipView") |
|
1360 |
@interface FBSDKTooltipView : UIView |
|
1361 |
/// Gets or sets the amount of time in seconds the tooltip should be displayed. |
|
1362 |
/// Set this to zero to make the display permanent until explicitly dismissed. |
|
1363 |
/// Defaults to six seconds. |
|
1364 |
@property (nonatomic) NSTimeInterval displayDuration; |
|
1365 |
/// Gets or sets the color style after initialization. |
|
1366 |
/// Defaults to value passed to -initWithTagline:message:colorStyle:. |
|
1367 |
@property (nonatomic) enum FBSDKTooltipColorStyle colorStyle; |
|
1368 |
/// Gets or sets the message. |
|
1369 |
@property (nonatomic, copy) NSString * _Nullable message; |
|
1370 |
/// Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
|
1371 |
@property (nonatomic, copy) NSString * _Nullable tagline; |
|
1372 |
/// Convenience constructor |
|
1373 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1374 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1375 |
/// Designated initializer. |
|
1376 |
/// If you need to show a tooltip for login, consider using the <code>FBSDKLoginTooltipView</code> view. |
|
1377 |
/// See FBSDKLoginTooltipView |
|
1378 |
/// \param tagline First part of the label, that will be highlighted with different color. Can be nil. |
|
1379 |
/// |
|
1380 |
/// \param message Main message to display. |
|
1381 |
/// |
|
1382 |
/// \param colorStyle Color style to use for tooltip. |
|
1383 |
/// |
|
1384 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
1385 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; |
|
1386 |
/// Show tooltip at the top or at the bottom of given view. |
|
1387 |
/// Tooltip will be added to anchorView.window.rootViewController.view |
|
1388 |
/// Use this method to present the tooltip with automatic positioning or |
|
1389 |
/// use -presentInView:withArrowPosition:direction: for manual positioning |
|
1390 |
/// If anchorView is nil or has no window - this method does nothing. |
|
1391 |
/// \param anchorView view to show at, must be already added to window view hierarchy, in order to decide |
|
1392 |
/// where tooltip will be shown. (If there’s not enough space at the top of the anchorView in window bounds - |
|
1393 |
/// tooltip will be shown at the bottom of it) |
|
1394 |
/// |
|
1395 |
- (void)presentFromView:(UIView * _Nonnull)anchorView; |
|
1396 |
/// Adds tooltip to given view, with given position and arrow direction. |
|
1397 |
/// \param view View to be used as superview. |
|
1398 |
/// |
|
1399 |
/// \param arrowPosition Point in view’s cordinates, where arrow will be pointing |
|
1400 |
/// |
|
1401 |
/// \param direction whenever arrow should be pointing up (message bubble is below the arrow) or down (message bubble is above the arrow). |
|
1402 |
/// |
|
1403 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
1404 |
/// Remove tooltip manually. |
|
1405 |
/// Calling this method isn’t necessary - tooltip will dismiss itself automatically after the <code>displayDuration</code>. |
|
1406 |
- (void)dismiss; |
|
1407 |
- (void)drawRect:(CGRect)rect; |
|
1408 |
- (void)layoutSubviews; |
|
1409 |
- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; |
|
1410 |
@end |
|
1411 |
|
|
1412 |
/// FBSDKTooltipViewArrowDirection enum |
|
1413 |
/// Passed on construction to determine arrow orientation. |
|
1414 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipViewArrowDirection, "ArrowDirection", closed) { |
|
1415 |
FBSDKTooltipViewArrowDirectionDown = 0, |
|
1416 |
FBSDKTooltipViewArrowDirectionUp = 1, |
|
1417 |
}; |
|
1418 |
|
|
1419 |
/// FBSDKTooltipColorStyle enum |
|
1420 |
/// Passed on construction to determine color styling. |
|
1421 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipColorStyle, "ColorStyle", closed) { |
|
1422 |
FBSDKTooltipColorStyleFriendlyBlue = 0, |
|
1423 |
FBSDKTooltipColorStyleNeutralGray = 1, |
|
1424 |
}; |
|
1425 |
|
|
1426 |
@protocol FBSDKLoginTooltipViewDelegate; |
|
1427 |
|
|
1428 |
/// Represents a tooltip to be displayed next to a Facebook login button |
|
1429 |
/// to highlight features for new users. |
|
1430 |
/// The <code>FBSDKLoginButton</code> may display this view automatically. If you do |
|
1431 |
/// not use the <code>FBSDKLoginButton</code>, you can manually call one of the <code>present*</code> methods |
|
1432 |
/// as appropriate and customize behavior via <code>FBSDKLoginTooltipViewDelegate</code> delegate. |
|
1433 |
/// By default, the <code>FBSDKLoginTooltipView</code> is not added to the superview until it is |
|
1434 |
/// determined the app has migrated to the new login experience. You can override this |
|
1435 |
/// (e.g., to test the UI layout) by implementing the delegate or setting <code>forceDisplay</code> to YES. |
|
1436 |
SWIFT_CLASS_NAMED("FBLoginTooltipView") |
|
1437 |
@interface FBSDKLoginTooltipView : FBSDKTooltipView |
|
1438 |
/// the delegate |
|
1439 |
@property (nonatomic, weak) id <FBSDKLoginTooltipViewDelegate> _Nullable delegate; |
|
1440 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
1441 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
1442 |
@property (nonatomic) BOOL forceDisplay; |
|
1443 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
1444 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
1445 |
@property (nonatomic) BOOL shouldForceDisplay; |
|
1446 |
/// Create tooltip |
|
1447 |
- (nonnull instancetype)init; |
|
1448 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
1449 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
1450 |
@end |
|
1451 |
|
|
1452 |
|
|
1453 |
/// Internal Type exposed to facilitate transition to Swift. |
|
1454 |
/// API Subject to change or removal without warning. Do not use. |
|
1455 |
/// <ul> |
|
1456 |
/// <li> |
|
1457 |
/// Warning INTERNAL: DO NOT USE |
|
1458 |
/// </li> |
|
1459 |
/// </ul> |
|
1460 |
SWIFT_CLASS_NAMED("FBPermission") |
|
1461 |
@interface FBSDKPermission : NSObject |
|
1462 |
@property (nonatomic, readonly, copy) NSString * _Nonnull description; |
|
1463 |
@property (nonatomic, readonly) NSUInteger hash; |
|
1464 |
/// Attempts to initialize a new permission with the given string. |
|
1465 |
/// Creation will fail and return nil if the string is invalid. |
|
1466 |
/// \param string The raw permission string |
|
1467 |
/// |
|
1468 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER; |
|
1469 |
/// Returns a set of <code>FBPermission</code> from a set of raw permissions strings. |
|
1470 |
/// Will return nil if any of the input permissions is invalid. |
|
1471 |
+ (NSSet<FBSDKPermission *> * _Nullable)permissionsFromRawPermissions:(NSSet<NSString *> * _Nonnull)rawPermissions SWIFT_WARN_UNUSED_RESULT; |
|
1472 |
/// Returns a set of string permissions from a set of <code>FBPermission</code> by |
|
1473 |
/// extracting the “value” property for each element. |
|
1474 |
+ (NSSet<NSString *> * _Nonnull)rawPermissionsFromPermissions:(NSSet<FBSDKPermission *> * _Nonnull)permissions SWIFT_WARN_UNUSED_RESULT; |
|
1475 |
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; |
|
1476 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1477 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1478 |
@end |
2e29a3
|
1479 |
|
L |
1480 |
|
|
1481 |
|
e0ec42
|
1482 |
|
L |
1483 |
@class FBSDKLoginManagerLoginResult; |
|
1484 |
|
|
1485 |
/// A delegate for <code>FBSDKLoginButton</code> |
|
1486 |
SWIFT_PROTOCOL_NAMED("LoginButtonDelegate") |
|
1487 |
@protocol FBSDKLoginButtonDelegate <NSObject> |
|
1488 |
/// Sent to the delegate when the button was used to login. |
|
1489 |
/// @param loginButton The button being used to log in |
|
1490 |
/// @param result The results of the login |
|
1491 |
/// @param error The error (if any) from the login |
|
1492 |
- (void)loginButton:(FBSDKLoginButton * _Nonnull)loginButton didCompleteWithResult:(FBSDKLoginManagerLoginResult * _Nullable)result error:(NSError * _Nullable)error; |
|
1493 |
/// Sent to the delegate when the button was used to logout. |
|
1494 |
/// @param loginButton The button being used to log out. |
|
1495 |
- (void)loginButtonDidLogOut:(FBSDKLoginButton * _Nonnull)loginButton; |
|
1496 |
@optional |
|
1497 |
/// Sent to the delegate when the button is about to login. |
|
1498 |
/// @param loginButton The button being used to log in |
|
1499 |
/// @return <code>true</code> if the login should be allowed to proceed, <code>false</code> otherwise |
|
1500 |
- (BOOL)loginButtonWillLogin:(FBSDKLoginButton * _Nonnull)loginButton SWIFT_WARN_UNUSED_RESULT; |
|
1501 |
@end |
|
1502 |
|
|
1503 |
|
|
1504 |
/// A configuration to use for modifying the behavior of a login attempt. |
|
1505 |
SWIFT_CLASS_NAMED("LoginConfiguration") |
|
1506 |
@interface FBSDKLoginConfiguration : NSObject |
|
1507 |
/// The nonce that the configuration was created with. |
|
1508 |
/// A unique nonce will be used if none is provided to the initializer. |
|
1509 |
@property (nonatomic, readonly, copy) NSString * _Nonnull nonce; |
|
1510 |
/// The tracking preference. Defaults to <code>.enabled</code>. |
|
1511 |
@property (nonatomic, readonly) enum FBSDKLoginTracking tracking; |
|
1512 |
/// The requested permissions for the login attempt. Defaults to an empty set. |
|
1513 |
@property (nonatomic, readonly, copy) NSSet<FBSDKPermission *> * _Nonnull requestedPermissions; |
|
1514 |
/// The Messenger Page Id associated with this login request. |
|
1515 |
@property (nonatomic, readonly, copy) NSString * _Nullable messengerPageId; |
|
1516 |
/// The auth type associated with this login request. |
|
1517 |
@property (nonatomic, readonly) FBSDKLoginAuthType _Nullable authType; |
|
1518 |
/// The code verifier used in the PKCE process. |
|
1519 |
/// If not provided, a code verifier will be randomly generated. |
|
1520 |
@property (nonatomic, readonly, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
1521 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1522 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1523 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1524 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
1525 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
1526 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
1527 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId; |
|
1528 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1529 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1530 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1531 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
1532 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
1533 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
1534 |
/// @param authType auth_type param to use for login. |
|
1535 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
1536 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1537 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1538 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1539 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
1540 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
1541 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce; |
|
1542 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1543 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1544 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1545 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
1546 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId; |
|
1547 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1548 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1549 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1550 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
1551 |
/// @param authType auth_type param to use for login. |
|
1552 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
1553 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1554 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1555 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1556 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
1557 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
1558 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
1559 |
/// @param authType auth_type param to use for login. |
|
1560 |
/// @param codeVerifier The code verifier used in the PKCE process. |
|
1561 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType codeVerifier:(FBSDKCodeVerifier * _Nonnull)codeVerifier OBJC_DESIGNATED_INITIALIZER; |
|
1562 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1563 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
1564 |
/// @param tracking the tracking preference to use for a login attempt. |
|
1565 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking; |
|
1566 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
1567 |
/// @param tracking the login tracking preference to use for a login attempt. |
|
1568 |
- (nullable instancetype)initWithTracking:(enum FBSDKLoginTracking)tracking; |
|
1569 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1570 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1571 |
@end |
|
1572 |
|
|
1573 |
/// Custom error codes for login errors in the login error domain |
|
1574 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKLoginError, "LoginErrorCode", open) { |
|
1575 |
/// Reserved |
|
1576 |
FBSDKLoginErrorReserved = 300, |
|
1577 |
/// The error code for unknown errors |
|
1578 |
FBSDKLoginErrorUnknown = 301, |
|
1579 |
/// The user’s password has changed and must log in again |
|
1580 |
FBSDKLoginErrorPasswordChanged = 302, |
|
1581 |
/// The user must log in to their account on www.facebook.com to restore access |
|
1582 |
FBSDKLoginErrorUserCheckpointed = 303, |
|
1583 |
/// Indicates a failure to request new permissions because the user has changed |
|
1584 |
FBSDKLoginErrorUserMismatch = 304, |
|
1585 |
/// The user must confirm their account with Facebook before logging in |
|
1586 |
FBSDKLoginErrorUnconfirmedUser = 305, |
|
1587 |
/// The Accounts framework failed without returning an error, indicating the app’s slider in the |
|
1588 |
/// iOS Facebook Settings (device Settings -> Facebook -> App Name) has been disabled. |
|
1589 |
FBSDKLoginErrorSystemAccountAppDisabled = 306, |
|
1590 |
/// An error occurred related to Facebook system Account store |
|
1591 |
FBSDKLoginErrorSystemAccountUnavailable = 307, |
|
1592 |
/// The login response was missing a valid challenge string |
|
1593 |
FBSDKLoginErrorBadChallengeString = 308, |
|
1594 |
/// The ID token returned in login response was invalid |
|
1595 |
FBSDKLoginErrorInvalidIDToken = 309, |
|
1596 |
/// A current access token was required and not provided |
|
1597 |
FBSDKLoginErrorMissingAccessToken = 310, |
|
1598 |
}; |
|
1599 |
|
|
1600 |
@class UIViewController; |
|
1601 |
|
|
1602 |
/// Provides methods for logging the user in and out. |
|
1603 |
/// It works directly with <code>AccessToken</code> (for data access) and <code>AuthenticationToken</code> (for authentication); |
|
1604 |
/// it sets the “current” tokens upon successful authorizations (or sets to <code>nil</code> in case of <code>logOut</code>). |
|
1605 |
/// You should check <code>AccessToken.current</code> before calling a login method to see if there is |
|
1606 |
/// a cached token available (typically in a <code>viewDidLoad</code> implementation). |
|
1607 |
/// @warning If you are managing your own tokens outside of <code>AccessToken</code>, you will need to set |
|
1608 |
/// <code>AccessToken.current</code> before calling a login method to authorize further permissions on your tokens. |
|
1609 |
SWIFT_CLASS_NAMED("LoginManager") |
|
1610 |
@interface FBSDKLoginManager : NSObject |
|
1611 |
/// The default audience. You should set this if you intend to ask for publish permissions. |
|
1612 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
1613 |
/// Initialize an instance of <code>LoginManager.</code> |
|
1614 |
/// \param defaultAudience Optional default audience to use. Default: <code>.friends</code>. |
|
1615 |
/// |
|
1616 |
- (nonnull instancetype)initWithDefaultAudience:(enum FBSDKDefaultAudience)defaultAudience; |
|
1617 |
/// Logs the user in or authorizes additional permissions. |
|
1618 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
1619 |
/// controller will be automatically determined and used. |
|
1620 |
/// @param configuration the login configuration to use. |
|
1621 |
/// @param completion the login completion handler. |
|
1622 |
/// Use this method when asking for permissions. You should only ask for permissions when they |
|
1623 |
/// are needed and the value should be explained to the user. You can inspect the |
|
1624 |
/// <code>FBSDKLoginManagerLoginResultBlock</code>’s <code>result.declinedPermissions</code> to provide more information |
|
1625 |
/// to the user if they decline permissions. |
|
1626 |
/// To reduce unnecessary login attempts, you should typically check if <code>AccessToken.current</code> |
|
1627 |
/// already contains the permissions you need. If it does, you probably do not need to call this method. |
|
1628 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
1629 |
/// called on a previous login attempt will result in an error. |
|
1630 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
1631 |
- (void)logInFromViewController:(UIViewController * _Nullable)viewController configuration:(FBSDKLoginConfiguration * _Nullable)configuration completion:(FBSDKLoginManagerLoginResultBlock _Nonnull)completion; |
|
1632 |
/// Logs the user in or authorizes additional permissions. |
|
1633 |
/// @param permissions the optional array of permissions. Note this is converted to NSSet and is only |
|
1634 |
/// an NSArray for the convenience of literal syntax. |
|
1635 |
/// @param viewController the view controller to present from. If nil, the topmost view controller will be |
|
1636 |
/// automatically determined as best as possible. |
|
1637 |
/// @param handler the callback. |
|
1638 |
/// Use this method when asking for read permissions. You should only ask for permissions when they |
|
1639 |
/// are needed and explain the value to the user. You can inspect the <code>FBSDKLoginManagerLoginResultBlock</code>’s |
|
1640 |
/// <code>result.declinedPermissions</code> to provide more information to the user if they decline permissions. |
|
1641 |
/// You typically should check if <code>AccessToken.current</code> already contains the permissions you need before |
|
1642 |
/// asking to reduce unnecessary login attempts. For example, you could perform that check in <code>viewDidLoad</code>. |
|
1643 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
1644 |
/// called on a previous login attempt will result in an error. |
|
1645 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
1646 |
- (void)logInWithPermissions:(NSArray<NSString *> * _Nonnull)permissions fromViewController:(UIViewController * _Nullable)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nullable)handler; |
|
1647 |
/// Requests user’s permission to reathorize application’s data access, after it has expired due to inactivity. |
|
1648 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
1649 |
/// controller will be automatically determined and used. |
|
1650 |
/// @param handler the callback. |
|
1651 |
/// Use this method when you need to reathorize your app’s access to user data via the Graph API. |
|
1652 |
/// You should only call this after access has expired. |
|
1653 |
/// You should provide as much context to the user as possible as to why you need to reauthorize the access, the |
|
1654 |
/// scope of access being reathorized, and what added value your app provides when the access is reathorized. |
|
1655 |
/// You can inspect the <code>result.declinedPermissions</code> to determine if you should provide more information to the |
|
1656 |
/// user based on any declined permissions. |
|
1657 |
/// @warning This method will reauthorize using a <code>LoginConfiguration</code> with <code>FBSDKLoginTracking</code> set to <code>.enabled</code>. |
|
1658 |
/// @warning This method will present UI the user. You typically should call this if <code>AccessToken.isDataAccessExpired</code> |
|
1659 |
/// is true. |
|
1660 |
- (void)reauthorizeDataAccess:(UIViewController * _Nonnull)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nonnull)handler; |
|
1661 |
/// Logs the user out |
|
1662 |
/// This nils out the singleton instances of <code>AccessToken</code>, <code>AuthenticationToken</code> and <code>Profle</code>. |
|
1663 |
/// @note This is only a client side logout. It will not log the user out of their Facebook account. |
|
1664 |
- (void)logOut; |
|
1665 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
|
1666 |
@end |
|
1667 |
|
|
1668 |
|
|
1669 |
|
|
1670 |
@class UIApplication; |
|
1671 |
|
|
1672 |
@interface FBSDKLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <FBSDKURLOpening> |
|
1673 |
+ (FBSDKLoginManager * _Nonnull)makeOpener SWIFT_WARN_UNUSED_RESULT; |
|
1674 |
- (BOOL)application:(UIApplication * _Nullable)application openURL:(NSURL * _Nullable)url sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
1675 |
- (BOOL)canOpenURL:(NSURL * _Nonnull)url forApplication:(UIApplication * _Nullable)application sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
1676 |
- (void)applicationDidBecomeActive:(UIApplication * _Nonnull)application; |
|
1677 |
- (BOOL)isAuthenticationURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
1678 |
- (BOOL)shouldStopPropagationOfURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
1679 |
@end |
|
1680 |
|
|
1681 |
@class FBSDKAuthenticationToken; |
|
1682 |
|
|
1683 |
/// Describes the result of a login attempt. |
|
1684 |
SWIFT_CLASS_NAMED("LoginManagerLoginResult") |
|
1685 |
@interface FBSDKLoginManagerLoginResult : NSObject |
|
1686 |
/// The access token |
|
1687 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable token; |
|
1688 |
/// The authentication token |
|
1689 |
@property (nonatomic, readonly, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
1690 |
/// Whether the login was cancelled by the user |
|
1691 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
1692 |
/// The set of permissions granted by the user in the associated request. |
|
1693 |
/// Inspect the token’s permissions set for a complete list. |
|
1694 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull grantedPermissions; |
|
1695 |
/// The set of permissions declined by the user in the associated request. |
|
1696 |
/// Inspect the token’s permissions set for a complete list. |
|
1697 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull declinedPermissions; |
|
1698 |
/// Creates a new result |
|
1699 |
/// @param token The access token |
|
1700 |
/// @param authenticationToken The authentication token |
|
1701 |
/// @param isCancelled whether The login was cancelled by the user |
|
1702 |
/// @param grantedPermissions The set of granted permissions |
|
1703 |
/// @param declinedPermissions The set of declined permissions |
|
1704 |
- (nonnull instancetype)initWithToken:(FBSDKAccessToken * _Nullable)token authenticationToken:(FBSDKAuthenticationToken * _Nullable)authenticationToken isCancelled:(BOOL)isCancelled grantedPermissions:(NSSet<NSString *> * _Nonnull)grantedPermissions declinedPermissions:(NSSet<NSString *> * _Nonnull)declinedPermissions OBJC_DESIGNATED_INITIALIZER; |
|
1705 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
1706 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
1707 |
@end |
|
1708 |
|
|
1709 |
|
|
1710 |
/// The <code>LoginTooltipViewDelegate</code> protocol defines the methods used to receive event |
|
1711 |
/// notifications from <code>FBLoginTooltipView</code> objects. |
|
1712 |
SWIFT_PROTOCOL_NAMED("LoginTooltipViewDelegate") |
|
1713 |
@protocol FBSDKLoginTooltipViewDelegate |
|
1714 |
@optional |
|
1715 |
/// Asks the delegate if the tooltip view should appear |
|
1716 |
/// @param view The tooltip view. |
|
1717 |
/// @param appIsEligible The value fetched from the server identifying if the app |
|
1718 |
/// is eligible for the new login experience. |
|
1719 |
/// Use this method to customize display behavior. |
|
1720 |
- (BOOL)loginTooltipView:(FBSDKLoginTooltipView * _Nonnull)view shouldAppear:(BOOL)appIsEligible SWIFT_WARN_UNUSED_RESULT; |
|
1721 |
/// Tells the delegate the tooltip view will appear, specifically after it’s been |
|
1722 |
/// added to the super view but before the fade in animation. |
|
1723 |
/// @param view The tooltip view. |
|
1724 |
- (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
1725 |
/// Tells the delegate the tooltip view will not appear (i.e., was not |
|
1726 |
/// added to the super view). |
|
1727 |
/// @param view The tooltip view. |
|
1728 |
- (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
1729 |
@end |
|
1730 |
|
|
1731 |
/// <code>enabled</code> and <code>limited</code> see: https://developers.facebook.com/docs/facebook-login/ios/limited-login/ |
|
1732 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginTracking, "LoginTracking", open) { |
|
1733 |
FBSDKLoginTrackingEnabled = 0, |
|
1734 |
FBSDKLoginTrackingLimited = 1, |
|
1735 |
}; |
|
1736 |
|
|
1737 |
|
|
1738 |
@class FBSDKProfile; |
|
1739 |
|
|
1740 |
/// Internal Type exposed to facilitate transition to Swift. |
|
1741 |
/// API Subject to change or removal without warning. Do not use. |
|
1742 |
/// <ul> |
|
1743 |
/// <li> |
|
1744 |
/// Warning INTERNAL: DO NOT USE |
|
1745 |
/// </li> |
|
1746 |
/// </ul> |
|
1747 |
/// Structured interface for accessing the parameters used to complete a log in request. |
|
1748 |
/// If <code>authenticationTokenString</code> is non-<code>nil</code>, the authentication succeeded. If <code>error</code> is |
|
1749 |
/// non-<code>nil</code> the request failed. If both are <code>nil</code>, the request was cancelled. |
|
1750 |
SWIFT_CLASS_NAMED("_LoginCompletionParameters") |
|
1751 |
@interface FBSDKLoginCompletionParameters : NSObject |
|
1752 |
@property (nonatomic, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
1753 |
@property (nonatomic, strong) FBSDKProfile * _Nullable profile; |
|
1754 |
@property (nonatomic, copy) NSString * _Nullable accessTokenString; |
|
1755 |
@property (nonatomic, copy) NSString * _Nullable nonceString; |
|
1756 |
@property (nonatomic, copy) NSString * _Nullable authenticationTokenString; |
|
1757 |
@property (nonatomic, copy) NSString * _Nullable code; |
|
1758 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable permissions; |
|
1759 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable declinedPermissions; |
|
1760 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable expiredPermissions; |
|
1761 |
@property (nonatomic, copy) NSString * _Nullable appID; |
|
1762 |
@property (nonatomic, copy) NSString * _Nullable userID; |
|
1763 |
@property (nonatomic) NSError * _Nullable error; |
|
1764 |
@property (nonatomic, copy) NSDate * _Nullable expirationDate; |
|
1765 |
@property (nonatomic, copy) NSDate * _Nullable dataAccessExpirationDate; |
|
1766 |
@property (nonatomic, copy) NSString * _Nullable challenge; |
|
1767 |
@property (nonatomic, copy) NSString * _Nullable graphDomain; |
|
1768 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
|
1769 |
@end |
|
1770 |
|
|
1771 |
#endif |
|
1772 |
#if defined(__cplusplus) |
|
1773 |
#endif |
2e29a3
|
1774 |
#if __has_attribute(external_source_symbol) |
L |
1775 |
# pragma clang attribute pop |
|
1776 |
#endif |
|
1777 |
#pragma clang diagnostic pop |
|
1778 |
#endif |
|
1779 |
|
e0ec42
|
1780 |
#else |
L |
1781 |
#error unsupported Swift architecture |
2e29a3
|
1782 |
#endif |