commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
e81c27
|
21 |
NS_ASSUME_NONNULL_BEGIN |
H |
22 |
|
49b883
|
23 |
#if TARGET_OS_TV |
L |
24 |
|
|
25 |
// This is an unfortunate hack for Swift Package Manager support. |
|
26 |
// SPM does not allow us to conditionally exclude Swift files for compilation by platform. |
|
27 |
// |
|
28 |
// So to support tvOS with SPM we need to use runtime availability checks in the Swift files. |
|
29 |
// This means that even though the code in `LoginManager.swift` will never be run for tvOS |
|
30 |
// targets, it still needs to be able to compile. Hence we need to declare it here. |
|
31 |
// |
|
32 |
// The way to fix this is to remove extensions of ObjC types in Swift. |
|
33 |
|
|
34 |
@interface LoginManagerLoginResult : NSObject |
|
35 |
|
|
36 |
@property (copy, nonatomic, nullable) FBSDKAccessToken *token; |
b19a78
|
37 |
@property (copy, nonatomic, nullable) FBSDKAuthenticationToken *authenticationToken; |
49b883
|
38 |
@property (readonly, nonatomic) BOOL isCancelled; |
L |
39 |
@property (copy, nonatomic) NSSet<NSString *> *grantedPermissions; |
|
40 |
@property (copy, nonatomic) NSSet<NSString *> *declinedPermissions; |
|
41 |
|
|
42 |
@end |
|
43 |
|
|
44 |
#else |
|
45 |
|
bad748
|
46 |
@class FBSDKAccessToken; |
b19a78
|
47 |
@class FBSDKAuthenticationToken; |
bad748
|
48 |
|
9febd9
|
49 |
/** |
W |
50 |
Describes the result of a login attempt. |
bad748
|
51 |
*/ |
e81c27
|
52 |
NS_SWIFT_NAME(LoginManagerLoginResult) |
bad748
|
53 |
@interface FBSDKLoginManagerLoginResult : NSObject |
W |
54 |
|
13e53a
|
55 |
- (instancetype)init NS_UNAVAILABLE; |
H |
56 |
+ (instancetype)new NS_UNAVAILABLE; |
|
57 |
|
9febd9
|
58 |
/** |
W |
59 |
the access token. |
bad748
|
60 |
*/ |
e81c27
|
61 |
@property (copy, nonatomic, nullable) FBSDKAccessToken *token; |
b19a78
|
62 |
|
L |
63 |
/** |
|
64 |
the authentication token. |
|
65 |
*/ |
|
66 |
@property (copy, nonatomic, nullable) FBSDKAuthenticationToken *authenticationToken; |
bad748
|
67 |
|
9febd9
|
68 |
/** |
W |
69 |
whether the login was cancelled by the user. |
bad748
|
70 |
*/ |
W |
71 |
@property (readonly, nonatomic) BOOL isCancelled; |
|
72 |
|
9febd9
|
73 |
/** |
W |
74 |
the set of permissions granted by the user in the associated request. |
|
75 |
|
|
76 |
inspect the token's permissions set for a complete list. |
bad748
|
77 |
*/ |
e81c27
|
78 |
@property (copy, nonatomic) NSSet<NSString *> *grantedPermissions; |
bad748
|
79 |
|
9febd9
|
80 |
/** |
W |
81 |
the set of permissions declined by the user in the associated request. |
|
82 |
|
|
83 |
inspect the token's permissions set for a complete list. |
bad748
|
84 |
*/ |
e81c27
|
85 |
@property (copy, nonatomic) NSSet<NSString *> *declinedPermissions; |
bad748
|
86 |
|
9febd9
|
87 |
/** |
W |
88 |
Initializes a new instance. |
13e53a
|
89 |
@param token the access token |
b19a78
|
90 |
@param authenticationToken the authentication token |
13e53a
|
91 |
@param isCancelled whether the login was cancelled by the user |
H |
92 |
@param grantedPermissions the set of granted permissions |
|
93 |
@param declinedPermissions the set of declined permissions |
bad748
|
94 |
*/ |
e81c27
|
95 |
- (instancetype)initWithToken:(nullable FBSDKAccessToken *)token |
b19a78
|
96 |
authenticationToken:(nullable FBSDKAuthenticationToken *)authenticationToken |
bad748
|
97 |
isCancelled:(BOOL)isCancelled |
e81c27
|
98 |
grantedPermissions:(NSSet<NSString *> *)grantedPermissions |
H |
99 |
declinedPermissions:(NSSet<NSString *> *)declinedPermissions |
bad748
|
100 |
NS_DESIGNATED_INITIALIZER; |
W |
101 |
@end |
e81c27
|
102 |
|
49b883
|
103 |
#endif |
L |
104 |
|
e81c27
|
105 |
NS_ASSUME_NONNULL_END |