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; |
|
37 |
@property (readonly, nonatomic) BOOL isCancelled; |
|
38 |
@property (copy, nonatomic) NSSet<NSString *> *grantedPermissions; |
|
39 |
@property (copy, nonatomic) NSSet<NSString *> *declinedPermissions; |
|
40 |
|
|
41 |
@end |
|
42 |
|
|
43 |
#else |
|
44 |
|
bad748
|
45 |
@class FBSDKAccessToken; |
W |
46 |
|
9febd9
|
47 |
/** |
W |
48 |
Describes the result of a login attempt. |
bad748
|
49 |
*/ |
e81c27
|
50 |
NS_SWIFT_NAME(LoginManagerLoginResult) |
bad748
|
51 |
@interface FBSDKLoginManagerLoginResult : NSObject |
W |
52 |
|
13e53a
|
53 |
- (instancetype)init NS_UNAVAILABLE; |
H |
54 |
+ (instancetype)new NS_UNAVAILABLE; |
|
55 |
|
9febd9
|
56 |
/** |
W |
57 |
the access token. |
bad748
|
58 |
*/ |
e81c27
|
59 |
@property (copy, nonatomic, nullable) FBSDKAccessToken *token; |
bad748
|
60 |
|
9febd9
|
61 |
/** |
W |
62 |
whether the login was cancelled by the user. |
bad748
|
63 |
*/ |
W |
64 |
@property (readonly, nonatomic) BOOL isCancelled; |
|
65 |
|
9febd9
|
66 |
/** |
W |
67 |
the set of permissions granted by the user in the associated request. |
|
68 |
|
|
69 |
inspect the token's permissions set for a complete list. |
bad748
|
70 |
*/ |
e81c27
|
71 |
@property (copy, nonatomic) NSSet<NSString *> *grantedPermissions; |
bad748
|
72 |
|
9febd9
|
73 |
/** |
W |
74 |
the set of permissions declined 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 *> *declinedPermissions; |
bad748
|
79 |
|
9febd9
|
80 |
/** |
W |
81 |
Initializes a new instance. |
13e53a
|
82 |
@param token the access token |
H |
83 |
@param isCancelled whether the login was cancelled by the user |
|
84 |
@param grantedPermissions the set of granted permissions |
|
85 |
@param declinedPermissions the set of declined permissions |
bad748
|
86 |
*/ |
e81c27
|
87 |
- (instancetype)initWithToken:(nullable FBSDKAccessToken *)token |
bad748
|
88 |
isCancelled:(BOOL)isCancelled |
e81c27
|
89 |
grantedPermissions:(NSSet<NSString *> *)grantedPermissions |
H |
90 |
declinedPermissions:(NSSet<NSString *> *)declinedPermissions |
bad748
|
91 |
NS_DESIGNATED_INITIALIZER; |
W |
92 |
@end |
e81c27
|
93 |
|
49b883
|
94 |
#endif |
L |
95 |
|
e81c27
|
96 |
NS_ASSUME_NONNULL_END |