commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
NS_ASSUME_NONNULL_BEGIN |
|
12 |
|
|
13 |
#if TARGET_OS_TV |
|
14 |
|
|
15 |
// This is an unfortunate hack for Swift Package Manager support. |
|
16 |
// SPM does not allow us to conditionally exclude Swift files for compilation by platform. |
|
17 |
// |
|
18 |
// So to support tvOS with SPM we need to use runtime availability checks in the Swift files. |
|
19 |
// This means that even though the code in `LoginManager.swift` will never be run for tvOS |
|
20 |
// targets, it still needs to be able to compile. Hence we need to declare it here. |
|
21 |
// |
|
22 |
// The way to fix this is to remove extensions of ObjC types in Swift. |
|
23 |
|
|
24 |
@interface LoginManagerLoginResult : NSObject |
|
25 |
|
|
26 |
@property (nullable, nonatomic, copy) FBSDKAccessToken *token; |
|
27 |
@property (nullable, nonatomic, copy) FBSDKAuthenticationToken *authenticationToken; |
|
28 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
29 |
@property (nonatomic, copy) NSSet<NSString *> *grantedPermissions; |
|
30 |
@property (nonatomic, copy) NSSet<NSString *> *declinedPermissions; |
|
31 |
|
|
32 |
@end |
|
33 |
|
|
34 |
#else |
|
35 |
|
|
36 |
@class FBSDKAccessToken; |
|
37 |
@class FBSDKAuthenticationToken; |
|
38 |
|
|
39 |
/** |
|
40 |
Describes the result of a login attempt. |
|
41 |
*/ |
|
42 |
NS_SWIFT_NAME(LoginManagerLoginResult) |
|
43 |
@interface FBSDKLoginManagerLoginResult : NSObject |
|
44 |
|
|
45 |
- (instancetype)init NS_UNAVAILABLE; |
|
46 |
+ (instancetype)new NS_UNAVAILABLE; |
|
47 |
|
|
48 |
/** |
|
49 |
the access token. |
|
50 |
*/ |
|
51 |
@property (nullable, nonatomic, copy) FBSDKAccessToken *token; |
|
52 |
|
|
53 |
/** |
|
54 |
the authentication token. |
|
55 |
*/ |
|
56 |
@property (nullable, nonatomic, copy) FBSDKAuthenticationToken *authenticationToken; |
|
57 |
|
|
58 |
/** |
|
59 |
whether the login was cancelled by the user. |
|
60 |
*/ |
|
61 |
@property (nonatomic, readonly) BOOL isCancelled; |
|
62 |
|
|
63 |
/** |
|
64 |
the set of permissions granted by the user in the associated request. |
|
65 |
|
|
66 |
inspect the token's permissions set for a complete list. |
|
67 |
*/ |
|
68 |
@property (nonatomic, copy) NSSet<NSString *> *grantedPermissions; |
|
69 |
|
|
70 |
/** |
|
71 |
the set of permissions declined by the user in the associated request. |
|
72 |
|
|
73 |
inspect the token's permissions set for a complete list. |
|
74 |
*/ |
|
75 |
@property (nonatomic, copy) NSSet<NSString *> *declinedPermissions; |
|
76 |
|
|
77 |
/** |
|
78 |
Initializes a new instance. |
|
79 |
@param token the access token |
|
80 |
@param authenticationToken the authentication token |
|
81 |
@param isCancelled whether the login was cancelled by the user |
|
82 |
@param grantedPermissions the set of granted permissions |
|
83 |
@param declinedPermissions the set of declined permissions |
|
84 |
*/ |
|
85 |
- (instancetype)initWithToken:(nullable FBSDKAccessToken *)token |
|
86 |
authenticationToken:(nullable FBSDKAuthenticationToken *)authenticationToken |
|
87 |
isCancelled:(BOOL)isCancelled |
|
88 |
grantedPermissions:(NSSet<NSString *> *)grantedPermissions |
|
89 |
declinedPermissions:(NSSet<NSString *> *)declinedPermissions |
|
90 |
NS_DESIGNATED_INITIALIZER; |
|
91 |
@end |
|
92 |
|
|
93 |
#endif |
|
94 |
|
|
95 |
NS_ASSUME_NONNULL_END |