commit | author | age
|
e0ec42
|
1 |
#if 0 |
L |
2 |
#elif defined(__arm64__) && __arm64__ |
97fc0a
|
3 |
// Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5) |
e0ec42
|
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 |
|
|
26 |
#pragma clang diagnostic ignored "-Wauto-import" |
|
27 |
#if defined(__OBJC__) |
|
28 |
#include <Foundation/Foundation.h> |
|
29 |
#endif |
|
30 |
#if defined(__cplusplus) |
|
31 |
#include <cstdint> |
|
32 |
#include <cstddef> |
|
33 |
#include <cstdbool> |
97fc0a
|
34 |
#include <cstring> |
L |
35 |
#include <stdlib.h> |
|
36 |
#include <new> |
|
37 |
#include <type_traits> |
e0ec42
|
38 |
#else |
L |
39 |
#include <stdint.h> |
|
40 |
#include <stddef.h> |
|
41 |
#include <stdbool.h> |
97fc0a
|
42 |
#include <string.h> |
L |
43 |
#endif |
|
44 |
#if defined(__cplusplus) |
|
45 |
#if defined(__arm64e__) && __has_include(<ptrauth.h>) |
|
46 |
# include <ptrauth.h> |
|
47 |
#else |
|
48 |
#pragma clang diagnostic push |
|
49 |
#pragma clang diagnostic ignored "-Wreserved-macro-identifier" |
|
50 |
# ifndef __ptrauth_swift_value_witness_function_pointer |
|
51 |
# define __ptrauth_swift_value_witness_function_pointer(x) |
|
52 |
# endif |
|
53 |
# ifndef __ptrauth_swift_class_method_pointer |
|
54 |
# define __ptrauth_swift_class_method_pointer(x) |
|
55 |
# endif |
|
56 |
#pragma clang diagnostic pop |
|
57 |
#endif |
e0ec42
|
58 |
#endif |
L |
59 |
|
|
60 |
#if !defined(SWIFT_TYPEDEFS) |
|
61 |
# define SWIFT_TYPEDEFS 1 |
|
62 |
# if __has_include(<uchar.h>) |
|
63 |
# include <uchar.h> |
|
64 |
# elif !defined(__cplusplus) |
|
65 |
typedef uint_least16_t char16_t; |
|
66 |
typedef uint_least32_t char32_t; |
|
67 |
# endif |
|
68 |
typedef float swift_float2 __attribute__((__ext_vector_type__(2))); |
|
69 |
typedef float swift_float3 __attribute__((__ext_vector_type__(3))); |
|
70 |
typedef float swift_float4 __attribute__((__ext_vector_type__(4))); |
|
71 |
typedef double swift_double2 __attribute__((__ext_vector_type__(2))); |
|
72 |
typedef double swift_double3 __attribute__((__ext_vector_type__(3))); |
|
73 |
typedef double swift_double4 __attribute__((__ext_vector_type__(4))); |
|
74 |
typedef int swift_int2 __attribute__((__ext_vector_type__(2))); |
|
75 |
typedef int swift_int3 __attribute__((__ext_vector_type__(3))); |
|
76 |
typedef int swift_int4 __attribute__((__ext_vector_type__(4))); |
|
77 |
typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); |
|
78 |
typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); |
|
79 |
typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); |
|
80 |
#endif |
|
81 |
|
|
82 |
#if !defined(SWIFT_PASTE) |
|
83 |
# define SWIFT_PASTE_HELPER(x, y) x##y |
|
84 |
# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) |
|
85 |
#endif |
|
86 |
#if !defined(SWIFT_METATYPE) |
|
87 |
# define SWIFT_METATYPE(X) Class |
|
88 |
#endif |
|
89 |
#if !defined(SWIFT_CLASS_PROPERTY) |
|
90 |
# if __has_feature(objc_class_property) |
|
91 |
# define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ |
|
92 |
# else |
97fc0a
|
93 |
# define SWIFT_CLASS_PROPERTY(...) |
e0ec42
|
94 |
# endif |
L |
95 |
#endif |
97fc0a
|
96 |
#if !defined(SWIFT_RUNTIME_NAME) |
L |
97 |
# if __has_attribute(objc_runtime_name) |
|
98 |
# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) |
|
99 |
# else |
|
100 |
# define SWIFT_RUNTIME_NAME(X) |
|
101 |
# endif |
e0ec42
|
102 |
#endif |
97fc0a
|
103 |
#if !defined(SWIFT_COMPILE_NAME) |
L |
104 |
# if __has_attribute(swift_name) |
|
105 |
# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) |
|
106 |
# else |
|
107 |
# define SWIFT_COMPILE_NAME(X) |
|
108 |
# endif |
e0ec42
|
109 |
#endif |
97fc0a
|
110 |
#if !defined(SWIFT_METHOD_FAMILY) |
L |
111 |
# if __has_attribute(objc_method_family) |
|
112 |
# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) |
|
113 |
# else |
|
114 |
# define SWIFT_METHOD_FAMILY(X) |
|
115 |
# endif |
e0ec42
|
116 |
#endif |
97fc0a
|
117 |
#if !defined(SWIFT_NOESCAPE) |
L |
118 |
# if __has_attribute(noescape) |
|
119 |
# define SWIFT_NOESCAPE __attribute__((noescape)) |
|
120 |
# else |
|
121 |
# define SWIFT_NOESCAPE |
|
122 |
# endif |
e0ec42
|
123 |
#endif |
97fc0a
|
124 |
#if !defined(SWIFT_RELEASES_ARGUMENT) |
L |
125 |
# if __has_attribute(ns_consumed) |
|
126 |
# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed)) |
|
127 |
# else |
|
128 |
# define SWIFT_RELEASES_ARGUMENT |
|
129 |
# endif |
e0ec42
|
130 |
#endif |
97fc0a
|
131 |
#if !defined(SWIFT_WARN_UNUSED_RESULT) |
L |
132 |
# if __has_attribute(warn_unused_result) |
|
133 |
# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) |
|
134 |
# else |
|
135 |
# define SWIFT_WARN_UNUSED_RESULT |
|
136 |
# endif |
e0ec42
|
137 |
#endif |
97fc0a
|
138 |
#if !defined(SWIFT_NORETURN) |
L |
139 |
# if __has_attribute(noreturn) |
|
140 |
# define SWIFT_NORETURN __attribute__((noreturn)) |
|
141 |
# else |
|
142 |
# define SWIFT_NORETURN |
|
143 |
# endif |
e0ec42
|
144 |
#endif |
L |
145 |
#if !defined(SWIFT_CLASS_EXTRA) |
97fc0a
|
146 |
# define SWIFT_CLASS_EXTRA |
e0ec42
|
147 |
#endif |
L |
148 |
#if !defined(SWIFT_PROTOCOL_EXTRA) |
97fc0a
|
149 |
# define SWIFT_PROTOCOL_EXTRA |
e0ec42
|
150 |
#endif |
L |
151 |
#if !defined(SWIFT_ENUM_EXTRA) |
97fc0a
|
152 |
# define SWIFT_ENUM_EXTRA |
e0ec42
|
153 |
#endif |
L |
154 |
#if !defined(SWIFT_CLASS) |
|
155 |
# if __has_attribute(objc_subclassing_restricted) |
|
156 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA |
|
157 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
158 |
# else |
|
159 |
# define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
160 |
# define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA |
|
161 |
# endif |
|
162 |
#endif |
|
163 |
#if !defined(SWIFT_RESILIENT_CLASS) |
|
164 |
# if __has_attribute(objc_class_stub) |
|
165 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub)) |
|
166 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
167 |
# else |
|
168 |
# define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) |
|
169 |
# define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME) |
|
170 |
# endif |
|
171 |
#endif |
|
172 |
#if !defined(SWIFT_PROTOCOL) |
|
173 |
# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
174 |
# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA |
|
175 |
#endif |
|
176 |
#if !defined(SWIFT_EXTENSION) |
|
177 |
# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) |
|
178 |
#endif |
|
179 |
#if !defined(OBJC_DESIGNATED_INITIALIZER) |
|
180 |
# if __has_attribute(objc_designated_initializer) |
|
181 |
# define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) |
|
182 |
# else |
97fc0a
|
183 |
# define OBJC_DESIGNATED_INITIALIZER |
e0ec42
|
184 |
# endif |
L |
185 |
#endif |
|
186 |
#if !defined(SWIFT_ENUM_ATTR) |
97fc0a
|
187 |
# if __has_attribute(enum_extensibility) |
e0ec42
|
188 |
# define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility))) |
L |
189 |
# else |
97fc0a
|
190 |
# define SWIFT_ENUM_ATTR(_extensibility) |
e0ec42
|
191 |
# endif |
L |
192 |
#endif |
|
193 |
#if !defined(SWIFT_ENUM) |
|
194 |
# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type |
|
195 |
# if __has_feature(generalized_swift_name) |
|
196 |
# 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 |
|
197 |
# else |
|
198 |
# define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility) |
|
199 |
# endif |
|
200 |
#endif |
|
201 |
#if !defined(SWIFT_UNAVAILABLE) |
|
202 |
# define SWIFT_UNAVAILABLE __attribute__((unavailable)) |
|
203 |
#endif |
|
204 |
#if !defined(SWIFT_UNAVAILABLE_MSG) |
|
205 |
# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg))) |
|
206 |
#endif |
|
207 |
#if !defined(SWIFT_AVAILABILITY) |
|
208 |
# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__))) |
|
209 |
#endif |
|
210 |
#if !defined(SWIFT_WEAK_IMPORT) |
|
211 |
# define SWIFT_WEAK_IMPORT __attribute__((weak_import)) |
|
212 |
#endif |
|
213 |
#if !defined(SWIFT_DEPRECATED) |
|
214 |
# define SWIFT_DEPRECATED __attribute__((deprecated)) |
|
215 |
#endif |
|
216 |
#if !defined(SWIFT_DEPRECATED_MSG) |
|
217 |
# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__))) |
|
218 |
#endif |
97fc0a
|
219 |
#if !defined(SWIFT_DEPRECATED_OBJC) |
L |
220 |
# if __has_feature(attribute_diagnose_if_objc) |
|
221 |
# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning"))) |
|
222 |
# else |
|
223 |
# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg) |
|
224 |
# endif |
e0ec42
|
225 |
#endif |
L |
226 |
#if defined(__OBJC__) |
|
227 |
#if !defined(IBSegueAction) |
97fc0a
|
228 |
# define IBSegueAction |
e0ec42
|
229 |
#endif |
L |
230 |
#endif |
|
231 |
#if !defined(SWIFT_EXTERN) |
|
232 |
# if defined(__cplusplus) |
|
233 |
# define SWIFT_EXTERN extern "C" |
|
234 |
# else |
|
235 |
# define SWIFT_EXTERN extern |
|
236 |
# endif |
|
237 |
#endif |
|
238 |
#if !defined(SWIFT_CALL) |
|
239 |
# define SWIFT_CALL __attribute__((swiftcall)) |
|
240 |
#endif |
97fc0a
|
241 |
#if !defined(SWIFT_INDIRECT_RESULT) |
L |
242 |
# define SWIFT_INDIRECT_RESULT __attribute__((swift_indirect_result)) |
e0ec42
|
243 |
#endif |
97fc0a
|
244 |
#if !defined(SWIFT_CONTEXT) |
L |
245 |
# define SWIFT_CONTEXT __attribute__((swift_context)) |
|
246 |
#endif |
|
247 |
#if !defined(SWIFT_ERROR_RESULT) |
|
248 |
# define SWIFT_ERROR_RESULT __attribute__((swift_error_result)) |
|
249 |
#endif |
|
250 |
#if defined(__cplusplus) |
|
251 |
# define SWIFT_NOEXCEPT noexcept |
e0ec42
|
252 |
#else |
L |
253 |
# define SWIFT_NOEXCEPT |
|
254 |
#endif |
97fc0a
|
255 |
#if !defined(SWIFT_C_INLINE_THUNK) |
L |
256 |
# if __has_attribute(always_inline) |
|
257 |
# if __has_attribute(nodebug) |
|
258 |
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) __attribute__((nodebug)) |
|
259 |
# else |
|
260 |
# define SWIFT_C_INLINE_THUNK inline __attribute__((always_inline)) |
|
261 |
# endif |
|
262 |
# else |
|
263 |
# define SWIFT_C_INLINE_THUNK inline |
|
264 |
# endif |
e0ec42
|
265 |
#endif |
97fc0a
|
266 |
#if defined(_WIN32) |
L |
267 |
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) |
|
268 |
# define SWIFT_IMPORT_STDLIB_SYMBOL __declspec(dllimport) |
|
269 |
#endif |
|
270 |
#else |
|
271 |
#if !defined(SWIFT_IMPORT_STDLIB_SYMBOL) |
|
272 |
# define SWIFT_IMPORT_STDLIB_SYMBOL |
e0ec42
|
273 |
#endif |
L |
274 |
#endif |
|
275 |
#if defined(__OBJC__) |
97fc0a
|
276 |
#if __has_feature(objc_modules) |
e0ec42
|
277 |
#if __has_warning("-Watimport-in-framework-header") |
L |
278 |
#pragma clang diagnostic ignored "-Watimport-in-framework-header" |
|
279 |
#endif |
|
280 |
@import CoreFoundation; |
|
281 |
@import FBSDKCoreKit; |
|
282 |
@import Foundation; |
|
283 |
@import ObjectiveC; |
|
284 |
@import UIKit; |
|
285 |
#endif |
|
286 |
|
|
287 |
#import <FBSDKLoginKit/FBSDKLoginKit.h> |
|
288 |
|
|
289 |
#endif |
|
290 |
#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" |
|
291 |
#pragma clang diagnostic ignored "-Wduplicate-method-arg" |
|
292 |
#if __has_warning("-Wpragma-clang-attribute") |
|
293 |
# pragma clang diagnostic ignored "-Wpragma-clang-attribute" |
|
294 |
#endif |
|
295 |
#pragma clang diagnostic ignored "-Wunknown-pragmas" |
|
296 |
#pragma clang diagnostic ignored "-Wnullability" |
|
297 |
#pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" |
|
298 |
|
|
299 |
#if __has_attribute(external_source_symbol) |
|
300 |
# pragma push_macro("any") |
|
301 |
# undef any |
|
302 |
# 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)) |
|
303 |
# pragma pop_macro("any") |
|
304 |
#endif |
|
305 |
|
|
306 |
#if defined(__OBJC__) |
|
307 |
|
|
308 |
@class NSString; |
|
309 |
|
|
310 |
/// Represents a code verifier used in the PKCE (Proof Key for Code Exchange) |
|
311 |
/// process. This is a cryptographically random string using the characters |
|
312 |
/// A-Z, a-z, 0-9, and the punctuation characters -._~ (hyphen, period, |
|
313 |
/// underscore, and tilde), between 43 and 128 characters long. |
|
314 |
SWIFT_CLASS_NAMED("CodeVerifier") |
|
315 |
@interface FBSDKCodeVerifier : NSObject |
|
316 |
/// The string value of the code verifier |
|
317 |
@property (nonatomic, readonly, copy) NSString * _Nonnull value; |
|
318 |
/// The SHA256 hashed challenge of the code verifier |
|
319 |
@property (nonatomic, readonly, copy) NSString * _Nonnull challenge; |
|
320 |
/// Attempts to initialize a new code verifier instance with the given string. |
|
321 |
/// Creation will fail and return nil if the string is invalid. |
|
322 |
/// @param string the code verifier string |
|
323 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string; |
|
324 |
/// Initializes a new code verifier instance with a random string value |
|
325 |
- (nonnull instancetype)init; |
|
326 |
@end |
|
327 |
|
|
328 |
/// Passed to openURL to indicate which default audience to use for sessions that post data to Facebook. |
|
329 |
/// Certain operations such as publishing a status or publishing a photo require an audience. When the user |
|
330 |
/// grants an application permission to perform a publish operation, a default audience is selected as the |
|
331 |
/// publication ceiling for the application. This enumerated value allows the application to select which |
|
332 |
/// audience to ask the user to grant publish permission for. |
|
333 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKDefaultAudience, "DefaultAudience", open) { |
|
334 |
/// Indicates that the user’s friends are able to see posts made by the application |
|
335 |
FBSDKDefaultAudienceFriends = 0, |
|
336 |
/// Indicates that only the user is able to see posts made by the application |
|
337 |
FBSDKDefaultAudienceOnlyMe = 1, |
|
338 |
/// Indicates that all Facebook users are able to see posts made by the application |
|
339 |
FBSDKDefaultAudienceEveryone = 2, |
|
340 |
}; |
|
341 |
|
|
342 |
@class NSURL; |
|
343 |
@class NSDate; |
|
344 |
|
|
345 |
/// Describes the initial response when starting the device login flow. |
|
346 |
/// This is used by <code>DeviceLoginManager</code>. |
|
347 |
SWIFT_CLASS_NAMED("DeviceLoginCodeInfo") |
|
348 |
@interface FBSDKDeviceLoginCodeInfo : NSObject |
|
349 |
/// The unique id for this login flow. |
|
350 |
@property (nonatomic, readonly, copy) NSString * _Nonnull identifier; |
|
351 |
/// The short “user_code” that should be presented to the user. |
|
352 |
@property (nonatomic, readonly, copy) NSString * _Nonnull loginCode; |
|
353 |
/// The verification URL. |
|
354 |
@property (nonatomic, readonly, copy) NSURL * _Nonnull verificationURL; |
|
355 |
/// The expiration date. |
|
356 |
@property (nonatomic, readonly, copy) NSDate * _Nonnull expirationDate; |
|
357 |
/// The polling interval |
|
358 |
@property (nonatomic, readonly) NSUInteger pollingInterval; |
|
359 |
- (nonnull instancetype)initWithIdentifier:(NSString * _Nonnull)identifier loginCode:(NSString * _Nonnull)loginCode verificationURL:(NSURL * _Nonnull)verificationURL expirationDate:(NSDate * _Nonnull)expirationDate pollingInterval:(NSUInteger)pollingInterval OBJC_DESIGNATED_INITIALIZER; |
|
360 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
361 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
362 |
@end |
|
363 |
|
|
364 |
/// Custom error codes for device login errors in the login error domain |
|
365 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKDeviceLoginError, "DeviceLoginErrorCode", open) { |
|
366 |
/// Your device is polling too frequently. |
|
367 |
FBSDKDeviceLoginErrorExcessivePolling = 1349172, |
|
368 |
/// User has declined to authorize your application. |
|
369 |
FBSDKDeviceLoginErrorAuthorizationDeclined = 1349173, |
|
370 |
/// User has not yet authorized your application. Continue polling. |
|
371 |
FBSDKDeviceLoginErrorAuthorizationPending = 1349174, |
|
372 |
/// The code you entered has expired. |
|
373 |
FBSDKDeviceLoginErrorCodeExpired = 1349152, |
|
374 |
}; |
|
375 |
|
|
376 |
@protocol FBSDKDeviceLoginManagerDelegate; |
|
377 |
|
|
378 |
/// Use this class to perform a device login flow. |
|
379 |
/// The device login flow starts by requesting a code from the device login API. |
|
380 |
/// This class informs the delegate when this code is received. You should then present the |
|
381 |
/// code to the user to enter. In the meantime, this class polls the device login API |
|
382 |
/// periodically and informs the delegate of the results. |
|
383 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/for-devices">Facebook Device Login</a>. |
|
384 |
SWIFT_CLASS_NAMED("DeviceLoginManager") |
|
385 |
@interface FBSDKDeviceLoginManager : NSObject |
|
386 |
/// The device login manager delegate. |
|
387 |
@property (nonatomic, weak) id <FBSDKDeviceLoginManagerDelegate> _Nullable delegate; |
|
388 |
/// The requested permissions. |
|
389 |
@property (nonatomic, readonly, copy) NSArray<NSString *> * _Nonnull permissions; |
|
390 |
/// The optional URL to redirect the user to after they complete the login. |
|
391 |
/// The URL must be configured in your App Settings -> Advanced -> OAuth Redirect URIs |
|
392 |
@property (nonatomic, copy) NSURL * _Nullable redirectURL; |
|
393 |
/// Initializes a new instance. |
|
394 |
/// @param permissions The permissions to request. |
|
395 |
/// @param enableSmartLogin Whether to enable smart login. |
|
396 |
- (nonnull instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions enableSmartLogin:(BOOL)enableSmartLogin OBJC_DESIGNATED_INITIALIZER; |
|
397 |
/// Starts the device login flow |
|
398 |
/// This instance will retain self until the flow is finished or cancelled. |
|
399 |
- (void)start; |
|
400 |
/// Attempts to cancel the device login flow. |
|
401 |
- (void)cancel; |
|
402 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
403 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
404 |
@end |
|
405 |
|
|
406 |
@class NSNetService; |
|
407 |
@class NSNumber; |
|
408 |
|
|
409 |
@interface FBSDKDeviceLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <NSNetServiceDelegate> |
|
410 |
- (void)netService:(NSNetService * _Nonnull)service didNotPublish:(NSDictionary<NSString *, NSNumber *> * _Nonnull)errorValues; |
|
411 |
@end |
|
412 |
|
|
413 |
|
|
414 |
@class FBSDKDeviceLoginManagerResult; |
|
415 |
|
|
416 |
/// A delegate for <code>DeviceLoginManager</code>. |
|
417 |
SWIFT_PROTOCOL_NAMED("DeviceLoginManagerDelegate") |
|
418 |
@protocol FBSDKDeviceLoginManagerDelegate |
|
419 |
/// Indicates the device login flow has started. You should parse <code>codeInfo</code> to present the code to the user to enter. |
|
420 |
/// @param loginManager the login manager instance. |
|
421 |
/// @param codeInfo the code info data. |
|
422 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager startedWithCodeInfo:(FBSDKDeviceLoginCodeInfo * _Nonnull)codeInfo; |
|
423 |
/// Indicates the device login flow has finished. |
|
424 |
/// @param loginManager the login manager instance. |
|
425 |
/// @param result the results of the login flow. |
|
426 |
/// @param error the error, if available. |
|
427 |
/// The flow can be finished if the user completed the flow, cancelled, or if the code has expired. |
|
428 |
- (void)deviceLoginManager:(FBSDKDeviceLoginManager * _Nonnull)loginManager completedWithResult:(FBSDKDeviceLoginManagerResult * _Nullable)result error:(NSError * _Nullable)error; |
|
429 |
@end |
|
430 |
|
|
431 |
@class FBSDKAccessToken; |
|
432 |
|
|
433 |
/// Represents the results of the a device login flow. This is used by <code>DeviceLoginManager</code> |
|
434 |
SWIFT_CLASS_NAMED("DeviceLoginManagerResult") |
|
435 |
@interface FBSDKDeviceLoginManagerResult : NSObject |
|
436 |
/// The token |
|
437 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable accessToken; |
|
438 |
/// Indicates if the login was cancelled by the user, or if the device login code has expired. |
|
439 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
440 |
/// Internal method exposed to facilitate transition to Swift. |
|
441 |
/// API Subject to change or removal without warning. Do not use. |
|
442 |
/// @warning INTERNAL - DO NOT USE |
|
443 |
- (nonnull instancetype)initWithToken:(FBSDKAccessToken * _Nullable)token isCancelled:(BOOL)cancelled OBJC_DESIGNATED_INITIALIZER; |
|
444 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
445 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
446 |
@end |
|
447 |
|
|
448 |
@protocol FBSDKLoginButtonDelegate; |
|
449 |
enum FBSDKLoginButtonTooltipBehavior : NSUInteger; |
|
450 |
enum FBSDKTooltipColorStyle : NSUInteger; |
|
451 |
enum FBSDKLoginTracking : NSUInteger; |
|
452 |
@class NSCoder; |
|
453 |
|
|
454 |
/// A button that initiates a log in or log out flow upon tapping. |
|
455 |
/// <code>LoginButton</code> works with <code>AccessToken.current</code> to determine what to display, |
|
456 |
/// and automatically starts authentication when tapped (i.e., you do not need to manually subscribe action targets). |
|
457 |
/// Like <code>LoginManager</code>, you should make sure your app delegate is connected to <code>ApplicationDelegate</code> |
|
458 |
/// in order for the button’s delegate to receive messages. |
|
459 |
/// <code>LoginButton</code> has a fixed height of 30 pixels, but you may change the width. |
|
460 |
/// Initializing the button with <code>nil</code> frame will size the button to its minimum frame. |
|
461 |
SWIFT_CLASS_NAMED("FBLoginButton") |
|
462 |
@interface FBSDKLoginButton : FBSDKButton |
|
463 |
/// The default audience to use, if publish permissions are requested at login time. |
|
464 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
465 |
/// Gets or sets the delegate. |
|
466 |
@property (nonatomic, weak) IBOutlet id <FBSDKLoginButtonDelegate> _Nullable delegate; |
|
467 |
/// The permissions to request. |
|
468 |
/// To provide the best experience, you should minimize the number of permissions you request, and only ask for them when needed. |
|
469 |
/// For example, do not ask for “user_location” until you the information is actually used by the app. |
|
470 |
/// Note this is converted to NSSet and is only |
|
471 |
/// an NSArray for the convenience of literal syntax. |
|
472 |
/// See <a href="https://developers.facebook.com/docs/facebook-login/permissions/">the permissions guide</a> for more details. |
|
473 |
@property (nonatomic, copy) NSArray<NSString *> * _Nonnull permissions; |
|
474 |
/// Gets or sets the desired tooltip behavior. |
|
475 |
@property (nonatomic) enum FBSDKLoginButtonTooltipBehavior tooltipBehavior; |
|
476 |
/// Gets or sets the desired tooltip color style. |
|
477 |
@property (nonatomic) enum FBSDKTooltipColorStyle tooltipColorStyle; |
|
478 |
/// Gets or sets the desired tracking preference to use for login attempts. Defaults to <code>.enabled</code> |
|
479 |
@property (nonatomic) enum FBSDKLoginTracking loginTracking; |
|
480 |
/// Gets or sets an optional nonce to use for login attempts. A valid nonce must be a non-empty string without whitespace. |
|
481 |
/// An invalid nonce will not be set. Instead, default unique nonces will be used for login attempts. |
|
482 |
@property (nonatomic, copy) NSString * _Nullable nonce; |
|
483 |
/// Gets or sets an optional page id to use for login attempts. |
|
484 |
@property (nonatomic, copy) NSString * _Nullable messengerPageId; |
|
485 |
/// Gets or sets the login authorization type to use in the login request. Defaults to <code>rerequest</code>. Use <code>nil</code> to avoid |
|
486 |
/// requesting permissions that were previously denied. |
|
487 |
@property (nonatomic) FBSDKLoginAuthType _Nullable authType; |
|
488 |
/// The code verifier used in the PKCE process. |
|
489 |
/// If not provided, a code verifier will be randomly generated. |
|
490 |
@property (nonatomic, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
491 |
- (nonnull instancetype)initWithFrame:(CGRect)frame OBJC_DESIGNATED_INITIALIZER; |
|
492 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE; |
|
493 |
- (void)didMoveToWindow; |
|
494 |
- (CGRect)imageRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
495 |
- (CGRect)titleRectForContentRect:(CGRect)contentRect SWIFT_WARN_UNUSED_RESULT; |
|
496 |
- (void)layoutSubviews; |
|
497 |
- (CGSize)sizeThatFits:(CGSize)size SWIFT_WARN_UNUSED_RESULT; |
|
498 |
@end |
|
499 |
|
|
500 |
/// Indicates the desired login tooltip behavior. |
|
501 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginButtonTooltipBehavior, "TooltipBehavior", open) { |
|
502 |
/// The default behavior. The tooltip will only be displayed if |
|
503 |
/// the app is eligible (determined by possible server round trip) |
|
504 |
FBSDKLoginButtonTooltipBehaviorAutomatic = 0, |
|
505 |
/// Force display of the tooltip (typically for UI testing) |
|
506 |
FBSDKLoginButtonTooltipBehaviorForceDisplay = 1, |
|
507 |
/// Force disable. In this case you can still exert more refined |
|
508 |
/// control by manually constructing a <code>FBSDKLoginTooltipView</code> instance. |
|
509 |
FBSDKLoginButtonTooltipBehaviorDisable = 2, |
|
510 |
}; |
|
511 |
|
|
512 |
enum FBSDKTooltipViewArrowDirection : NSUInteger; |
|
513 |
|
|
514 |
/// Tooltip bubble with text in it used to display tips for UI elements, |
|
515 |
/// with a pointed arrow (to refer to the UI element). |
|
516 |
/// The tooltip fades in and will automatically fade out. See <code>displayDuration</code>. |
|
517 |
SWIFT_CLASS_NAMED("FBTooltipView") |
|
518 |
@interface FBSDKTooltipView : UIView |
|
519 |
/// Gets or sets the amount of time in seconds the tooltip should be displayed. |
|
520 |
/// Set this to zero to make the display permanent until explicitly dismissed. |
|
521 |
/// Defaults to six seconds. |
|
522 |
@property (nonatomic) NSTimeInterval displayDuration; |
|
523 |
/// Gets or sets the color style after initialization. |
|
524 |
/// Defaults to value passed to -initWithTagline:message:colorStyle:. |
|
525 |
@property (nonatomic) enum FBSDKTooltipColorStyle colorStyle; |
|
526 |
/// Gets or sets the message. |
|
527 |
@property (nonatomic, copy) NSString * _Nullable message; |
|
528 |
/// Gets or sets the optional phrase that comprises the first part of the label (and is highlighted differently). |
|
529 |
@property (nonatomic, copy) NSString * _Nullable tagline; |
|
530 |
/// Convenience constructor |
|
531 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
532 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
533 |
/// Designated initializer. |
|
534 |
/// If you need to show a tooltip for login, consider using the <code>FBSDKLoginTooltipView</code> view. |
|
535 |
/// See FBSDKLoginTooltipView |
|
536 |
/// \param tagline First part of the label, that will be highlighted with different color. Can be nil. |
|
537 |
/// |
|
538 |
/// \param message Main message to display. |
|
539 |
/// |
|
540 |
/// \param colorStyle Color style to use for tooltip. |
|
541 |
/// |
|
542 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
543 |
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER SWIFT_UNAVAILABLE; |
|
544 |
/// Show tooltip at the top or at the bottom of given view. |
|
545 |
/// Tooltip will be added to anchorView.window.rootViewController.view |
|
546 |
/// Use this method to present the tooltip with automatic positioning or |
|
547 |
/// use -presentInView:withArrowPosition:direction: for manual positioning |
|
548 |
/// If anchorView is nil or has no window - this method does nothing. |
|
549 |
/// \param anchorView view to show at, must be already added to window view hierarchy, in order to decide |
|
550 |
/// where tooltip will be shown. (If there’s not enough space at the top of the anchorView in window bounds - |
|
551 |
/// tooltip will be shown at the bottom of it) |
|
552 |
/// |
|
553 |
- (void)presentFromView:(UIView * _Nonnull)anchorView; |
|
554 |
/// Adds tooltip to given view, with given position and arrow direction. |
|
555 |
/// \param view View to be used as superview. |
|
556 |
/// |
|
557 |
/// \param arrowPosition Point in view’s cordinates, where arrow will be pointing |
|
558 |
/// |
|
559 |
/// \param direction whenever arrow should be pointing up (message bubble is below the arrow) or down (message bubble is above the arrow). |
|
560 |
/// |
|
561 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
562 |
/// Remove tooltip manually. |
|
563 |
/// Calling this method isn’t necessary - tooltip will dismiss itself automatically after the <code>displayDuration</code>. |
|
564 |
- (void)dismiss; |
|
565 |
- (void)drawRect:(CGRect)rect; |
|
566 |
- (void)layoutSubviews; |
|
567 |
- (nonnull instancetype)initWithFrame:(CGRect)frame SWIFT_UNAVAILABLE; |
|
568 |
@end |
|
569 |
|
|
570 |
/// FBSDKTooltipViewArrowDirection enum |
|
571 |
/// Passed on construction to determine arrow orientation. |
|
572 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipViewArrowDirection, "ArrowDirection", closed) { |
|
573 |
FBSDKTooltipViewArrowDirectionDown = 0, |
|
574 |
FBSDKTooltipViewArrowDirectionUp = 1, |
|
575 |
}; |
|
576 |
|
|
577 |
/// FBSDKTooltipColorStyle enum |
|
578 |
/// Passed on construction to determine color styling. |
|
579 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKTooltipColorStyle, "ColorStyle", closed) { |
|
580 |
FBSDKTooltipColorStyleFriendlyBlue = 0, |
|
581 |
FBSDKTooltipColorStyleNeutralGray = 1, |
|
582 |
}; |
|
583 |
|
|
584 |
@protocol FBSDKLoginTooltipViewDelegate; |
|
585 |
|
|
586 |
/// Represents a tooltip to be displayed next to a Facebook login button |
|
587 |
/// to highlight features for new users. |
|
588 |
/// The <code>FBSDKLoginButton</code> may display this view automatically. If you do |
|
589 |
/// not use the <code>FBSDKLoginButton</code>, you can manually call one of the <code>present*</code> methods |
|
590 |
/// as appropriate and customize behavior via <code>FBSDKLoginTooltipViewDelegate</code> delegate. |
|
591 |
/// By default, the <code>FBSDKLoginTooltipView</code> is not added to the superview until it is |
|
592 |
/// determined the app has migrated to the new login experience. You can override this |
|
593 |
/// (e.g., to test the UI layout) by implementing the delegate or setting <code>forceDisplay</code> to YES. |
|
594 |
SWIFT_CLASS_NAMED("FBLoginTooltipView") |
|
595 |
@interface FBSDKLoginTooltipView : FBSDKTooltipView |
|
596 |
/// the delegate |
|
597 |
@property (nonatomic, weak) id <FBSDKLoginTooltipViewDelegate> _Nullable delegate; |
|
598 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
599 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
600 |
@property (nonatomic) BOOL forceDisplay; |
|
601 |
/// if set to YES, the view will always be displayed and the delegate’s |
|
602 |
/// <code>loginTooltipView:shouldAppear:</code> will NOT be called. |
|
603 |
@property (nonatomic) BOOL shouldForceDisplay; |
|
604 |
/// Create tooltip |
|
605 |
- (nonnull instancetype)init; |
|
606 |
- (nonnull instancetype)initWithTagline:(NSString * _Nullable)tagline message:(NSString * _Nullable)message colorStyle:(enum FBSDKTooltipColorStyle)colorStyle OBJC_DESIGNATED_INITIALIZER; |
|
607 |
- (void)presentInView:(UIView * _Nonnull)view withArrowPosition:(CGPoint)arrowPosition direction:(enum FBSDKTooltipViewArrowDirection)direction; |
|
608 |
@end |
|
609 |
|
|
610 |
|
|
611 |
/// Internal Type exposed to facilitate transition to Swift. |
|
612 |
/// API Subject to change or removal without warning. Do not use. |
|
613 |
/// <ul> |
|
614 |
/// <li> |
|
615 |
/// Warning INTERNAL: DO NOT USE |
|
616 |
/// </li> |
|
617 |
/// </ul> |
|
618 |
SWIFT_CLASS_NAMED("FBPermission") |
|
619 |
@interface FBSDKPermission : NSObject |
|
620 |
@property (nonatomic, readonly, copy) NSString * _Nonnull description; |
|
621 |
@property (nonatomic, readonly) NSUInteger hash; |
|
622 |
/// Attempts to initialize a new permission with the given string. |
|
623 |
/// Creation will fail and return nil if the string is invalid. |
|
624 |
/// \param string The raw permission string |
|
625 |
/// |
|
626 |
- (nullable instancetype)initWithString:(NSString * _Nonnull)string OBJC_DESIGNATED_INITIALIZER; |
|
627 |
/// Returns a set of <code>FBPermission</code> from a set of raw permissions strings. |
|
628 |
/// Will return nil if any of the input permissions is invalid. |
|
629 |
+ (NSSet<FBSDKPermission *> * _Nullable)permissionsFromRawPermissions:(NSSet<NSString *> * _Nonnull)rawPermissions SWIFT_WARN_UNUSED_RESULT; |
|
630 |
/// Returns a set of string permissions from a set of <code>FBPermission</code> by |
|
631 |
/// extracting the “value” property for each element. |
|
632 |
+ (NSSet<NSString *> * _Nonnull)rawPermissionsFromPermissions:(NSSet<FBSDKPermission *> * _Nonnull)permissions SWIFT_WARN_UNUSED_RESULT; |
|
633 |
- (BOOL)isEqual:(id _Nullable)object SWIFT_WARN_UNUSED_RESULT; |
|
634 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
635 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
636 |
@end |
|
637 |
|
|
638 |
|
|
639 |
|
|
640 |
|
|
641 |
@class FBSDKLoginManagerLoginResult; |
|
642 |
|
|
643 |
/// A delegate for <code>FBSDKLoginButton</code> |
|
644 |
SWIFT_PROTOCOL_NAMED("LoginButtonDelegate") |
|
645 |
@protocol FBSDKLoginButtonDelegate <NSObject> |
|
646 |
/// Sent to the delegate when the button was used to login. |
|
647 |
/// @param loginButton The button being used to log in |
|
648 |
/// @param result The results of the login |
|
649 |
/// @param error The error (if any) from the login |
|
650 |
- (void)loginButton:(FBSDKLoginButton * _Nonnull)loginButton didCompleteWithResult:(FBSDKLoginManagerLoginResult * _Nullable)result error:(NSError * _Nullable)error; |
|
651 |
/// Sent to the delegate when the button was used to logout. |
|
652 |
/// @param loginButton The button being used to log out. |
|
653 |
- (void)loginButtonDidLogOut:(FBSDKLoginButton * _Nonnull)loginButton; |
|
654 |
@optional |
|
655 |
/// Sent to the delegate when the button is about to login. |
|
656 |
/// @param loginButton The button being used to log in |
|
657 |
/// @return <code>true</code> if the login should be allowed to proceed, <code>false</code> otherwise |
|
658 |
- (BOOL)loginButtonWillLogin:(FBSDKLoginButton * _Nonnull)loginButton SWIFT_WARN_UNUSED_RESULT; |
|
659 |
@end |
|
660 |
|
|
661 |
|
|
662 |
/// A configuration to use for modifying the behavior of a login attempt. |
|
663 |
SWIFT_CLASS_NAMED("LoginConfiguration") |
|
664 |
@interface FBSDKLoginConfiguration : NSObject |
|
665 |
/// The nonce that the configuration was created with. |
|
666 |
/// A unique nonce will be used if none is provided to the initializer. |
|
667 |
@property (nonatomic, readonly, copy) NSString * _Nonnull nonce; |
|
668 |
/// The tracking preference. Defaults to <code>.enabled</code>. |
|
669 |
@property (nonatomic, readonly) enum FBSDKLoginTracking tracking; |
|
670 |
/// The requested permissions for the login attempt. Defaults to an empty set. |
|
671 |
@property (nonatomic, readonly, copy) NSSet<FBSDKPermission *> * _Nonnull requestedPermissions; |
|
672 |
/// The Messenger Page Id associated with this login request. |
|
673 |
@property (nonatomic, readonly, copy) NSString * _Nullable messengerPageId; |
|
674 |
/// The auth type associated with this login request. |
|
675 |
@property (nonatomic, readonly) FBSDKLoginAuthType _Nullable authType; |
|
676 |
/// The code verifier used in the PKCE process. |
|
677 |
/// If not provided, a code verifier will be randomly generated. |
|
678 |
@property (nonatomic, readonly, strong) FBSDKCodeVerifier * _Nonnull codeVerifier; |
|
679 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
680 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
681 |
/// @param tracking the tracking preference to use for a login attempt. |
|
682 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
683 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
684 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
685 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId; |
|
686 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
687 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
688 |
/// @param tracking the tracking preference to use for a login attempt. |
|
689 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
690 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
691 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
692 |
/// @param authType auth_type param to use for login. |
|
693 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
694 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
695 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
696 |
/// @param tracking the tracking preference to use for a login attempt. |
|
697 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
698 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
699 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking nonce:(NSString * _Nonnull)nonce; |
|
700 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
701 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
702 |
/// @param tracking the tracking preference to use for a login attempt. |
|
703 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
704 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId; |
|
705 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
706 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
707 |
/// @param tracking the tracking preference to use for a login attempt. |
|
708 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
709 |
/// @param authType auth_type param to use for login. |
|
710 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking messengerPageId:(NSString * _Nullable)messengerPageId authType:(FBSDKLoginAuthType _Nullable)authType; |
|
711 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
712 |
/// @param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
713 |
/// @param tracking the tracking preference to use for a login attempt. |
|
714 |
/// @param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
715 |
/// Creation of the configuration will fail if the nonce is invalid. |
|
716 |
/// @param messengerPageId the associated page id to use for a login attempt. |
|
717 |
/// @param authType auth_type param to use for login. |
|
718 |
/// @param codeVerifier The code verifier used in the PKCE process. |
|
719 |
- (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; |
|
720 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
721 |
/// @param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
722 |
/// @param tracking the tracking preference to use for a login attempt. |
|
723 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> * _Nonnull)permissions tracking:(enum FBSDKLoginTracking)tracking; |
|
724 |
/// Attempts to initialize a new configuration with the expected parameters. |
|
725 |
/// @param tracking the login tracking preference to use for a login attempt. |
|
726 |
- (nullable instancetype)initWithTracking:(enum FBSDKLoginTracking)tracking; |
|
727 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
728 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
729 |
@end |
|
730 |
|
|
731 |
/// Custom error codes for login errors in the login error domain |
|
732 |
typedef SWIFT_ENUM_NAMED(NSInteger, FBSDKLoginError, "LoginErrorCode", open) { |
|
733 |
/// Reserved |
|
734 |
FBSDKLoginErrorReserved = 300, |
|
735 |
/// The error code for unknown errors |
|
736 |
FBSDKLoginErrorUnknown = 301, |
|
737 |
/// The user’s password has changed and must log in again |
|
738 |
FBSDKLoginErrorPasswordChanged = 302, |
|
739 |
/// The user must log in to their account on www.facebook.com to restore access |
|
740 |
FBSDKLoginErrorUserCheckpointed = 303, |
|
741 |
/// Indicates a failure to request new permissions because the user has changed |
|
742 |
FBSDKLoginErrorUserMismatch = 304, |
|
743 |
/// The user must confirm their account with Facebook before logging in |
|
744 |
FBSDKLoginErrorUnconfirmedUser = 305, |
|
745 |
/// The Accounts framework failed without returning an error, indicating the app’s slider in the |
|
746 |
/// iOS Facebook Settings (device Settings -> Facebook -> App Name) has been disabled. |
|
747 |
FBSDKLoginErrorSystemAccountAppDisabled = 306, |
|
748 |
/// An error occurred related to Facebook system Account store |
|
749 |
FBSDKLoginErrorSystemAccountUnavailable = 307, |
|
750 |
/// The login response was missing a valid challenge string |
|
751 |
FBSDKLoginErrorBadChallengeString = 308, |
|
752 |
/// The ID token returned in login response was invalid |
|
753 |
FBSDKLoginErrorInvalidIDToken = 309, |
|
754 |
/// A current access token was required and not provided |
|
755 |
FBSDKLoginErrorMissingAccessToken = 310, |
|
756 |
}; |
|
757 |
|
|
758 |
@class UIViewController; |
|
759 |
|
|
760 |
/// Provides methods for logging the user in and out. |
|
761 |
/// It works directly with <code>AccessToken</code> (for data access) and <code>AuthenticationToken</code> (for authentication); |
|
762 |
/// it sets the “current” tokens upon successful authorizations (or sets to <code>nil</code> in case of <code>logOut</code>). |
|
763 |
/// You should check <code>AccessToken.current</code> before calling a login method to see if there is |
|
764 |
/// a cached token available (typically in a <code>viewDidLoad</code> implementation). |
|
765 |
/// @warning If you are managing your own tokens outside of <code>AccessToken</code>, you will need to set |
|
766 |
/// <code>AccessToken.current</code> before calling a login method to authorize further permissions on your tokens. |
|
767 |
SWIFT_CLASS_NAMED("LoginManager") |
|
768 |
@interface FBSDKLoginManager : NSObject |
|
769 |
/// The default audience. You should set this if you intend to ask for publish permissions. |
|
770 |
@property (nonatomic) enum FBSDKDefaultAudience defaultAudience; |
|
771 |
/// Initialize an instance of <code>LoginManager.</code> |
|
772 |
/// \param defaultAudience Optional default audience to use. Default: <code>.friends</code>. |
|
773 |
/// |
|
774 |
- (nonnull instancetype)initWithDefaultAudience:(enum FBSDKDefaultAudience)defaultAudience; |
|
775 |
/// Logs the user in or authorizes additional permissions. |
|
776 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
777 |
/// controller will be automatically determined and used. |
|
778 |
/// @param configuration the login configuration to use. |
|
779 |
/// @param completion the login completion handler. |
|
780 |
/// Use this method when asking for permissions. You should only ask for permissions when they |
|
781 |
/// are needed and the value should be explained to the user. You can inspect the |
|
782 |
/// <code>FBSDKLoginManagerLoginResultBlock</code>’s <code>result.declinedPermissions</code> to provide more information |
|
783 |
/// to the user if they decline permissions. |
|
784 |
/// To reduce unnecessary login attempts, you should typically check if <code>AccessToken.current</code> |
|
785 |
/// already contains the permissions you need. If it does, you probably do not need to call this method. |
|
786 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
787 |
/// called on a previous login attempt will result in an error. |
|
788 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
789 |
- (void)logInFromViewController:(UIViewController * _Nullable)viewController configuration:(FBSDKLoginConfiguration * _Nullable)configuration completion:(FBSDKLoginManagerLoginResultBlock _Nonnull)completion; |
|
790 |
/// Logs the user in or authorizes additional permissions. |
|
791 |
/// @param permissions the optional array of permissions. Note this is converted to NSSet and is only |
|
792 |
/// an NSArray for the convenience of literal syntax. |
|
793 |
/// @param viewController the view controller to present from. If nil, the topmost view controller will be |
|
794 |
/// automatically determined as best as possible. |
|
795 |
/// @param handler the callback. |
|
796 |
/// Use this method when asking for read permissions. You should only ask for permissions when they |
|
797 |
/// are needed and explain the value to the user. You can inspect the <code>FBSDKLoginManagerLoginResultBlock</code>’s |
|
798 |
/// <code>result.declinedPermissions</code> to provide more information to the user if they decline permissions. |
|
799 |
/// You typically should check if <code>AccessToken.current</code> already contains the permissions you need before |
|
800 |
/// asking to reduce unnecessary login attempts. For example, you could perform that check in <code>viewDidLoad</code>. |
|
801 |
/// @warning You can only perform one login call at a time. Calling a login method before the completion handler is |
|
802 |
/// called on a previous login attempt will result in an error. |
|
803 |
/// @warning This method will present a UI to the user and thus should be called on the main thread. |
|
804 |
- (void)logInWithPermissions:(NSArray<NSString *> * _Nonnull)permissions fromViewController:(UIViewController * _Nullable)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nullable)handler; |
|
805 |
/// Requests user’s permission to reathorize application’s data access, after it has expired due to inactivity. |
|
806 |
/// @param viewController the view controller from which to present the login UI. If nil, the topmost view |
|
807 |
/// controller will be automatically determined and used. |
|
808 |
/// @param handler the callback. |
|
809 |
/// Use this method when you need to reathorize your app’s access to user data via the Graph API. |
|
810 |
/// You should only call this after access has expired. |
|
811 |
/// You should provide as much context to the user as possible as to why you need to reauthorize the access, the |
|
812 |
/// scope of access being reathorized, and what added value your app provides when the access is reathorized. |
|
813 |
/// You can inspect the <code>result.declinedPermissions</code> to determine if you should provide more information to the |
|
814 |
/// user based on any declined permissions. |
|
815 |
/// @warning This method will reauthorize using a <code>LoginConfiguration</code> with <code>FBSDKLoginTracking</code> set to <code>.enabled</code>. |
|
816 |
/// @warning This method will present UI the user. You typically should call this if <code>AccessToken.isDataAccessExpired</code> |
|
817 |
/// is true. |
|
818 |
- (void)reauthorizeDataAccess:(UIViewController * _Nonnull)viewController handler:(FBSDKLoginManagerLoginResultBlock _Nonnull)handler; |
|
819 |
/// Logs the user out |
|
820 |
/// This nils out the singleton instances of <code>AccessToken</code>, <code>AuthenticationToken</code> and <code>Profle</code>. |
|
821 |
/// @note This is only a client side logout. It will not log the user out of their Facebook account. |
|
822 |
- (void)logOut; |
|
823 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
|
824 |
@end |
|
825 |
|
|
826 |
|
|
827 |
|
|
828 |
@class UIApplication; |
|
829 |
|
|
830 |
@interface FBSDKLoginManager (SWIFT_EXTENSION(FBSDKLoginKit)) <FBSDKURLOpening> |
|
831 |
+ (FBSDKLoginManager * _Nonnull)makeOpener SWIFT_WARN_UNUSED_RESULT; |
|
832 |
- (BOOL)application:(UIApplication * _Nullable)application openURL:(NSURL * _Nullable)url sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
833 |
- (BOOL)canOpenURL:(NSURL * _Nonnull)url forApplication:(UIApplication * _Nullable)application sourceApplication:(NSString * _Nullable)sourceApplication annotation:(id _Nullable)annotation SWIFT_WARN_UNUSED_RESULT; |
|
834 |
- (void)applicationDidBecomeActive:(UIApplication * _Nonnull)application; |
|
835 |
- (BOOL)isAuthenticationURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
836 |
- (BOOL)shouldStopPropagationOfURL:(NSURL * _Nonnull)url SWIFT_WARN_UNUSED_RESULT; |
|
837 |
@end |
|
838 |
|
|
839 |
@class FBSDKAuthenticationToken; |
|
840 |
|
|
841 |
/// Describes the result of a login attempt. |
|
842 |
SWIFT_CLASS_NAMED("LoginManagerLoginResult") |
|
843 |
@interface FBSDKLoginManagerLoginResult : NSObject |
|
844 |
/// The access token |
|
845 |
@property (nonatomic, readonly, strong) FBSDKAccessToken * _Nullable token; |
|
846 |
/// The authentication token |
|
847 |
@property (nonatomic, readonly, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
848 |
/// Whether the login was cancelled by the user |
|
849 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
850 |
/// The set of permissions granted by the user in the associated request. |
|
851 |
/// Inspect the token’s permissions set for a complete list. |
|
852 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull grantedPermissions; |
|
853 |
/// The set of permissions declined by the user in the associated request. |
|
854 |
/// Inspect the token’s permissions set for a complete list. |
|
855 |
@property (nonatomic, readonly, copy) NSSet<NSString *> * _Nonnull declinedPermissions; |
|
856 |
/// Creates a new result |
|
857 |
/// @param token The access token |
|
858 |
/// @param authenticationToken The authentication token |
|
859 |
/// @param isCancelled whether The login was cancelled by the user |
|
860 |
/// @param grantedPermissions The set of granted permissions |
|
861 |
/// @param declinedPermissions The set of declined permissions |
|
862 |
- (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; |
|
863 |
- (nonnull instancetype)init SWIFT_UNAVAILABLE; |
|
864 |
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable"); |
|
865 |
@end |
|
866 |
|
|
867 |
|
|
868 |
/// The <code>LoginTooltipViewDelegate</code> protocol defines the methods used to receive event |
|
869 |
/// notifications from <code>FBLoginTooltipView</code> objects. |
|
870 |
SWIFT_PROTOCOL_NAMED("LoginTooltipViewDelegate") |
|
871 |
@protocol FBSDKLoginTooltipViewDelegate |
|
872 |
@optional |
|
873 |
/// Asks the delegate if the tooltip view should appear |
|
874 |
/// @param view The tooltip view. |
|
875 |
/// @param appIsEligible The value fetched from the server identifying if the app |
|
876 |
/// is eligible for the new login experience. |
|
877 |
/// Use this method to customize display behavior. |
|
878 |
- (BOOL)loginTooltipView:(FBSDKLoginTooltipView * _Nonnull)view shouldAppear:(BOOL)appIsEligible SWIFT_WARN_UNUSED_RESULT; |
|
879 |
/// Tells the delegate the tooltip view will appear, specifically after it’s been |
|
880 |
/// added to the super view but before the fade in animation. |
|
881 |
/// @param view The tooltip view. |
|
882 |
- (void)loginTooltipViewWillAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
883 |
/// Tells the delegate the tooltip view will not appear (i.e., was not |
|
884 |
/// added to the super view). |
|
885 |
/// @param view The tooltip view. |
|
886 |
- (void)loginTooltipViewWillNotAppear:(FBSDKLoginTooltipView * _Nonnull)view; |
|
887 |
@end |
|
888 |
|
|
889 |
/// <code>enabled</code> and <code>limited</code> see: https://developers.facebook.com/docs/facebook-login/ios/limited-login/ |
|
890 |
typedef SWIFT_ENUM_NAMED(NSUInteger, FBSDKLoginTracking, "LoginTracking", open) { |
|
891 |
FBSDKLoginTrackingEnabled = 0, |
|
892 |
FBSDKLoginTrackingLimited = 1, |
|
893 |
}; |
|
894 |
|
|
895 |
|
|
896 |
@class FBSDKProfile; |
|
897 |
|
|
898 |
/// Internal Type exposed to facilitate transition to Swift. |
|
899 |
/// API Subject to change or removal without warning. Do not use. |
|
900 |
/// <ul> |
|
901 |
/// <li> |
|
902 |
/// Warning INTERNAL: DO NOT USE |
|
903 |
/// </li> |
|
904 |
/// </ul> |
|
905 |
/// Structured interface for accessing the parameters used to complete a log in request. |
|
906 |
/// If <code>authenticationTokenString</code> is non-<code>nil</code>, the authentication succeeded. If <code>error</code> is |
|
907 |
/// non-<code>nil</code> the request failed. If both are <code>nil</code>, the request was cancelled. |
|
908 |
SWIFT_CLASS_NAMED("_LoginCompletionParameters") |
|
909 |
@interface FBSDKLoginCompletionParameters : NSObject |
|
910 |
@property (nonatomic, strong) FBSDKAuthenticationToken * _Nullable authenticationToken; |
|
911 |
@property (nonatomic, strong) FBSDKProfile * _Nullable profile; |
|
912 |
@property (nonatomic, copy) NSString * _Nullable accessTokenString; |
|
913 |
@property (nonatomic, copy) NSString * _Nullable nonceString; |
|
914 |
@property (nonatomic, copy) NSString * _Nullable authenticationTokenString; |
|
915 |
@property (nonatomic, copy) NSString * _Nullable code; |
|
916 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable permissions; |
|
917 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable declinedPermissions; |
|
918 |
@property (nonatomic, copy) NSSet<FBSDKPermission *> * _Nullable expiredPermissions; |
|
919 |
@property (nonatomic, copy) NSString * _Nullable appID; |
|
920 |
@property (nonatomic, copy) NSString * _Nullable userID; |
|
921 |
@property (nonatomic) NSError * _Nullable error; |
|
922 |
@property (nonatomic, copy) NSDate * _Nullable expirationDate; |
|
923 |
@property (nonatomic, copy) NSDate * _Nullable dataAccessExpirationDate; |
|
924 |
@property (nonatomic, copy) NSString * _Nullable challenge; |
|
925 |
@property (nonatomic, copy) NSString * _Nullable graphDomain; |
97fc0a
|
926 |
@property (nonatomic, copy) NSString * _Nullable userTokenNonce; |
e0ec42
|
927 |
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER; |
L |
928 |
@end |
|
929 |
|
|
930 |
#endif |
|
931 |
#if __has_attribute(external_source_symbol) |
|
932 |
# pragma clang attribute pop |
|
933 |
#endif |
97fc0a
|
934 |
#if defined(__cplusplus) |
L |
935 |
#endif |
e0ec42
|
936 |
#pragma clang diagnostic pop |
L |
937 |
#endif |
|
938 |
|
|
939 |
#else |
|
940 |
#error unsupported Swift architecture |
|
941 |
#endif |