commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
#import <FBSDKLoginKit/FBSDKDeviceLoginCodeInfo.h> |
|
12 |
#import <FBSDKLoginKit/FBSDKDeviceLoginManagerResult.h> |
|
13 |
|
|
14 |
NS_ASSUME_NONNULL_BEGIN |
|
15 |
|
|
16 |
@protocol FBSDKDeviceLoginManagerDelegate; |
|
17 |
|
|
18 |
/*! |
|
19 |
@abstract Use this class to perform a device login flow. |
|
20 |
@discussion The device login flow starts by requesting a code from the device login API. |
|
21 |
This class informs the delegate when this code is received. You should then present the |
|
22 |
code to the user to enter. In the meantime, this class polls the device login API |
|
23 |
periodically and informs the delegate of the results. |
|
24 |
|
|
25 |
See [Facebook Device Login](https://developers.facebook.com/docs/facebook-login/for-devices). |
|
26 |
*/ |
|
27 |
NS_SWIFT_NAME(DeviceLoginManager) |
|
28 |
@interface FBSDKDeviceLoginManager : NSObject <NSNetServiceDelegate> |
|
29 |
|
|
30 |
/*! |
|
31 |
@abstract Initializes a new instance. |
|
32 |
@param permissions permissions to request. |
|
33 |
*/ |
|
34 |
- (instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
35 |
enableSmartLogin:(BOOL)enableSmartLogin; |
|
36 |
|
|
37 |
- (instancetype)init NS_UNAVAILABLE; |
|
38 |
+ (instancetype)new NS_UNAVAILABLE; |
|
39 |
|
|
40 |
/*! |
|
41 |
@abstract the delegate. |
|
42 |
*/ |
|
43 |
@property (nonatomic, weak) id<FBSDKDeviceLoginManagerDelegate> delegate; |
|
44 |
|
|
45 |
/*! |
|
46 |
@abstract the requested permissions. |
|
47 |
*/ |
|
48 |
@property (nonatomic, readonly, copy) NSArray<NSString *> *permissions; |
|
49 |
|
|
50 |
/*! |
|
51 |
@abstract the optional URL to redirect the user to after they complete the login. |
|
52 |
@discussion the URL must be configured in your App Settings -> Advanced -> OAuth Redirect URIs |
|
53 |
*/ |
|
54 |
@property (nullable, nonatomic, copy) NSURL *redirectURL; |
|
55 |
|
|
56 |
/*! |
|
57 |
@abstract Starts the device login flow |
|
58 |
@discussion This instance will retain self until the flow is finished or cancelled. |
|
59 |
*/ |
|
60 |
- (void)start; |
|
61 |
|
|
62 |
/*! |
|
63 |
@abstract Attempts to cancel the device login flow. |
|
64 |
*/ |
|
65 |
- (void)cancel; |
|
66 |
|
|
67 |
@end |
|
68 |
|
|
69 |
NS_ASSUME_NONNULL_END |