commit | author | age
|
b19a78
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
L |
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 |
|
|
21 |
NS_ASSUME_NONNULL_BEGIN |
|
22 |
|
|
23 |
@class FBSDKPermission; |
|
24 |
|
|
25 |
/// The login tracking preference to use for a login attempt. For more information on the differences between |
|
26 |
/// `enabled` and `limited` see: https://developers.facebook.com/docs/facebook-login/ios/limited-login/ |
|
27 |
typedef NS_ENUM(NSUInteger, FBSDKLoginTracking) |
|
28 |
{ |
|
29 |
FBSDKLoginTrackingEnabled, |
|
30 |
FBSDKLoginTrackingLimited, |
|
31 |
} NS_SWIFT_NAME(LoginTracking); |
|
32 |
|
|
33 |
/// A configuration to use for modifying the behavior of a login attempt. |
|
34 |
NS_SWIFT_NAME(LoginConfiguration) |
|
35 |
@interface FBSDKLoginConfiguration : NSObject |
|
36 |
|
|
37 |
/// The nonce that the configuration was created with. |
|
38 |
/// A unique nonce will be used if none is provided to the initializer. |
|
39 |
@property (nonatomic, readonly, copy) NSString *nonce; |
|
40 |
|
|
41 |
/// The tracking preference. Defaults to `.enabled`. |
|
42 |
@property (nonatomic, readonly) FBSDKLoginTracking tracking; |
|
43 |
|
|
44 |
/// The requested permissions for the login attempt. Defaults to an empty set. |
|
45 |
@property (nonatomic, readonly, copy) NSSet<FBSDKPermission *> *requestedPermissions; |
|
46 |
|
|
47 |
- (instancetype)init NS_UNAVAILABLE; |
|
48 |
+ (instancetype)new NS_UNAVAILABLE; |
|
49 |
|
|
50 |
/** |
|
51 |
Attempts to initialize a new configuration with the expected parameters. |
|
52 |
|
|
53 |
@param permissions the requested permissions for a login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
54 |
The only permissions allowed when the `loginTracking` is `.limited` are 'email', 'public_profile', 'gaming_profile' and 'gaming_user_picture' |
|
55 |
@param tracking the tracking preference to use for a login attempt. |
|
56 |
@param nonce an optional nonce to use for the login attempt. A valid nonce must be a non-empty string without whitespace. |
|
57 |
Creation of the configuration will fail if the nonce is invalid. |
|
58 |
*/ |
|
59 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
60 |
tracking:(FBSDKLoginTracking)tracking |
|
61 |
nonce:(NSString *)nonce |
|
62 |
NS_REFINED_FOR_SWIFT; |
|
63 |
|
|
64 |
/** |
|
65 |
Attempts to initialize a new configuration with the expected parameters. |
|
66 |
|
|
67 |
@param permissions the requested permissions for the login attempt. Permissions must be an array of strings that do not contain whitespace. |
|
68 |
The only permissions allowed when the `loginTracking` is `.limited` are 'email', 'public_profile', 'gaming_profile' and 'gaming_user_picture' |
|
69 |
@param tracking the tracking preference to use for a login attempt. |
|
70 |
*/ |
|
71 |
- (nullable instancetype)initWithPermissions:(NSArray<NSString *> *)permissions |
|
72 |
tracking:(FBSDKLoginTracking)tracking |
|
73 |
NS_REFINED_FOR_SWIFT; |
|
74 |
|
|
75 |
/** |
|
76 |
Attempts to initialize a new configuration with the expected parameters. |
|
77 |
|
|
78 |
@param tracking the login tracking preference to use for a login attempt. |
|
79 |
*/ |
|
80 |
- (nullable instancetype)initWithTracking:(FBSDKLoginTracking)tracking |
|
81 |
NS_REFINED_FOR_SWIFT; |
|
82 |
|
|
83 |
@end |
|
84 |
|
|
85 |
NS_ASSUME_NONNULL_END |