hank
2019-01-22 bf63695cd124ba0c3127f4cc8aa99c737729dd1d
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 <UIKit/UIKit.h>
20
21 /*
22  * Constants defining logging behavior.  Use with <[FBSDKSettings setLoggingBehavior]>.
23  */
24
9febd9 25 /** Include access token in logging. */
13e53a 26 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorAccessTokens;
bad748 27
9febd9 28 /** Log performance characteristics */
13e53a 29 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorPerformanceCharacteristics;
bad748 30
9febd9 31 /** Log FBSDKAppEvents interactions */
13e53a 32 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorAppEvents;
bad748 33
9febd9 34 /** Log Informational occurrences */
13e53a 35 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorInformational;
bad748 36
9febd9 37 /** Log cache errors. */
13e53a 38 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorCacheErrors;
bad748 39
9febd9 40 /** Log errors from SDK UI controls */
13e53a 41 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorUIControlErrors;
bad748 42
9febd9 43 /** Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */
13e53a 44 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorGraphAPIDebugWarning;
bad748 45
9febd9 46 /** Log warnings from API response, i.e. when requested feature will be deprecated in next version of API.
bad748 47  Info is the lowest level of severity, using it will result in logging all previously mentioned levels.
W 48  */
13e53a 49 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorGraphAPIDebugInfo;
bad748 50
9febd9 51 /** Log errors from SDK network requests */
13e53a 52 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorNetworkRequests;
bad748 53
9febd9 54 /** Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */
13e53a 55 FOUNDATION_EXPORT NSString *const FBSDKLoggingBehaviorDeveloperErrors;
bad748 56
W 57 @interface FBSDKSettings : NSObject
13e53a 58
H 59 - (instancetype)init NS_UNAVAILABLE;
60 + (instancetype)new NS_UNAVAILABLE;
bad748 61
9febd9 62 /**
W 63   Get the Facebook App ID used by the SDK.
64
65  If not explicitly set, the default will be read from the application's plist (FacebookAppID).
bad748 66  */
W 67 + (NSString *)appID;
68
9febd9 69 /**
W 70   Set the Facebook App ID to be used by the SDK.
13e53a 71  @param appID The Facebook App ID to be used by the SDK.
bad748 72  */
W 73 + (void)setAppID:(NSString *)appID;
74
9febd9 75 /**
W 76   Get the default url scheme suffix used for sessions.
77
78  If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix).
bad748 79  */
W 80 + (NSString *)appURLSchemeSuffix;
81
9febd9 82 /**
W 83   Set the app url scheme suffix used by the SDK.
13e53a 84  @param appURLSchemeSuffix The url scheme suffix to be used by the SDK.
bad748 85  */
W 86 + (void)setAppURLSchemeSuffix:(NSString *)appURLSchemeSuffix;
87
9febd9 88 /**
W 89   Retrieve the Client Token that has been set via [FBSDKSettings setClientToken].
90
91  If not explicitly set, the default will be read from the application's plist (FacebookClientToken).
bad748 92  */
W 93 + (NSString *)clientToken;
94
9febd9 95 /**
W 96   Sets the Client Token for the Facebook App.
97
98  This is needed for certain API calls when made anonymously, without a user-based access token.
13e53a 99  @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security
bad748 100  section of the Advanced tab of the Facebook App settings found at <https://developers.facebook.com/apps/[your-app-id]>
W 101  */
102 + (void)setClientToken:(NSString *)clientToken;
103
9febd9 104 /**
W 105   A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set.
13e53a 106  @param disableGraphErrorRecovery YES or NO.
bad748 107  */
W 108 + (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery;
109
9febd9 110 /**
W 111   Get the Facebook Display Name used by the SDK.
112
113  If not explicitly set, the default will be read from the application's plist (FacebookDisplayName).
bad748 114  */
W 115 + (NSString *)displayName;
116
9febd9 117 /**
W 118   Set the default Facebook Display Name to be used by the SDK.
119
120   This should match the Display Name that has been set for the app with the corresponding Facebook App ID,
bad748 121  in the Facebook App Dashboard.
13e53a 122  @param displayName The Facebook Display Name to be used by the SDK.
bad748 123  */
W 124 + (void)setDisplayName:(NSString *)displayName;
125
9febd9 126 /**
W 127   Get the Facebook domain part.
128
129  If not explicitly set, the default will be read from the application's plist (FacebookDomainPart).
bad748 130  */
W 131 + (NSString *)facebookDomainPart;
132
9febd9 133 /**
W 134   Set the subpart of the Facebook domain.
135
136  This can be used to change the Facebook domain (e.g. @"beta") so that requests will be sent to
bad748 137  graph.beta.facebook.com
13e53a 138  @param facebookDomainPart The domain part to be inserted into facebook.com.
bad748 139  */
W 140 + (void)setFacebookDomainPart:(NSString *)facebookDomainPart;
141
9febd9 142 /**
W 143   The quality of JPEG images sent to Facebook from the SDK.
144
145  If not explicitly set, the default is 0.9.
146
13e53a 147  @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */
bad748 148 + (CGFloat)JPEGCompressionQuality;
W 149
9febd9 150 /**
W 151   Set the quality of JPEG images sent to Facebook from the SDK.
13e53a 152  @param JPEGCompressionQuality The quality for JPEG images, expressed as a value from 0.0 to 1.0.
9febd9 153
13e53a 154  @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */
bad748 155 + (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality;
W 156
9febd9 157 /**
37c026 158   Flag which controls the auto logging of basic app events, such as activateApp and deactivateApp.
H 159  If not explicitly set, the default is 1 - true
160  */
161 + (NSNumber *)autoLogAppEventsEnabled;
162
163 /**
164  Set the flag which controls the auto logging of basic app events, such as activateApp and deactivateApp.
13e53a 165  @param AutoLogAppEventsEnabled Flag value, expressed as a value from 0 - false or 1 - true.
37c026 166  */
H 167 + (void)setAutoLogAppEventsEnabled:(NSNumber *)AutoLogAppEventsEnabled;
168
169 /**
9f077b 170  Flag which controls the fb_codeless_debug logging event
H 171  If not explicitly set, the default is 1 - true
172  */
173 + (NSNumber *)codelessDebugLogEnabled;
174
175 /**
176  Set the flag which controls the fb_codeless_debug logging event
13e53a 177  @param CodelessDebugLogEnabled Flag value, expressed as a value from 0 - false or 1 - true.
9f077b 178  */
H 179 + (void)setCodelessDebugLogEnabled:(NSNumber *)CodelessDebugLogEnabled;
13e53a 180
H 181 /**
182  Flag which controls whether advertiserID could be collected.
183  If not explicitly set, the default is 1 - true
184  */
185 + (NSNumber *)advertiserIDCollectionEnabled;
186
187 /**
188  Set the flag which controls ontrols whether advertiserID could be collected.
189  @param AdvertiserIDCollectionEnabled Flag value, expressed as a value from 0 - false or 1 - true.
190  */
191 + (void)setAdvertiserIDCollectionEnabled:(NSNumber *)AdvertiserIDCollectionEnabled;
9f077b 192
H 193 /**
9febd9 194   Gets whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions.  Defaults to NO.  This value is stored on the device and persists across app launches.
bad748 195  */
W 196 + (BOOL)limitEventAndDataUsage;
197
9febd9 198 /**
W 199   Sets whether data such as that generated through FBSDKAppEvents and sent to Facebook should be restricted from being used for other than analytics and conversions.  Defaults to NO.  This value is stored on the device and persists across app launches.
bad748 200
13e53a 201  @param limitEventAndDataUsage   The desired value.
bad748 202  */
W 203 + (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage;
204
9febd9 205 /**
W 206   Retrieve the current iOS SDK version.
bad748 207  */
W 208 + (NSString *)sdkVersion;
209
9febd9 210 /**
13e53a 211   The current Facebook SDK logging behavior.
bad748 212  */
13e53a 213 @property (class, nonatomic, copy) NSSet<NSString *> *loggingBehaviors;
H 214
215 + (NSSet *)loggingBehavior
216 DEPRECATED_MSG_ATTRIBUTE("Renamed `loggingBehaviors`");
bad748 217
9febd9 218 /**
W 219   Set the current Facebook SDK logging behavior.  This should consist of strings defined as
bad748 220  constants with FBSDKLoggingBehavior*.
W 221
13e53a 222  @param loggingBehavior A set of strings indicating what information should be logged.  If nil is provided, the logging
bad748 223  behavior is reset to the default set of enabled behaviors.  Set to an empty set in order to disable all logging.
W 224
9febd9 225
W 226  You can also define this via an array in your app plist with key "FacebookLoggingBehavior" or add and remove individual values via enableLoggingBehavior: or disableLogginBehavior:
bad748 227  */
W 228 + (void)setLoggingBehavior:(NSSet *)loggingBehavior;
229
9febd9 230 /**
W 231   Enable a particular Facebook SDK logging behavior.
bad748 232
13e53a 233  @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*.
bad748 234  */
W 235 + (void)enableLoggingBehavior:(NSString *)loggingBehavior;
236
9febd9 237 /**
W 238   Disable a particular Facebook SDK logging behavior.
bad748 239
13e53a 240  @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*.
bad748 241  */
W 242 + (void)disableLoggingBehavior:(NSString *)loggingBehavior;
243
9febd9 244 /**
W 245   Set the user defaults key used by legacy token caches.
bad748 246
13e53a 247  @param tokenInformationKeyName the key used by legacy token caches.
bad748 248
9febd9 249
W 250  Use this only if you customized FBSessionTokenCachingStrategy in v3.x of
bad748 251   the Facebook SDK for iOS.
W 252 */
253 + (void)setLegacyUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName;
254
9febd9 255 /**
W 256   Get the user defaults key used by legacy token caches.
bad748 257 */
W 258 + (NSString *)legacyUserDefaultTokenInformationKeyName;
259
9febd9 260 /**
W 261   Overrides the default Graph API version to use with `FBSDKGraphRequests`. This overrides `FBSDK_TARGET_PLATFORM_VERSION`.
262
263  The string should be of the form `@"v2.7"`.
264 */
265 + (void)setGraphAPIVersion:(NSString *)version;
266
267 /**
268   Returns the default Graph API version. Defaults to `FBSDK_TARGET_PLATFORM_VERSION`
269 */
270 + (NSString *)graphAPIVersion;
271
bad748 272 @end