| | |
| | | |
| | | #import <UIKit/UIKit.h> |
| | | |
| | | #import <FBSDKCoreKit/FBSDKMacros.h> |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | /* |
| | | * Constants defining logging behavior. Use with <[FBSDKSettings setLoggingBehavior]>. |
| | | */ |
| | | |
| | | /*! Include access token in logging. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAccessTokens; |
| | | /// typedef for FBSDKAppEventName |
| | | typedef NSString *const FBSDKLoggingBehavior NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(LoggingBehavior); |
| | | |
| | | /*! Log performance characteristics */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorPerformanceCharacteristics; |
| | | /** Include access token in logging. */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorAccessTokens; |
| | | |
| | | /*! Log FBSDKAppEvents interactions */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorAppEvents; |
| | | /** Log performance characteristics */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorPerformanceCharacteristics; |
| | | |
| | | /*! Log Informational occurrences */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorInformational; |
| | | /** Log FBSDKAppEvents interactions */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorAppEvents; |
| | | |
| | | /*! Log cache errors. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorCacheErrors; |
| | | /** Log Informational occurrences */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorInformational; |
| | | |
| | | /*! Log errors from SDK UI controls */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorUIControlErrors; |
| | | /** Log cache errors. */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorCacheErrors; |
| | | |
| | | /*! Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugWarning; |
| | | /** Log errors from SDK UI controls */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorUIControlErrors; |
| | | |
| | | /*! Log warnings from API response, i.e. when requested feature will be deprecated in next version of API. |
| | | /** Log debug warnings from API response, i.e. when friends fields requested, but user_friends permission isn't granted. */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorGraphAPIDebugWarning; |
| | | |
| | | /** Log warnings from API response, i.e. when requested feature will be deprecated in next version of API. |
| | | Info is the lowest level of severity, using it will result in logging all previously mentioned levels. |
| | | */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorGraphAPIDebugInfo; |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorGraphAPIDebugInfo; |
| | | |
| | | /*! Log errors from SDK network requests */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorNetworkRequests; |
| | | /** Log errors from SDK network requests */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorNetworkRequests; |
| | | |
| | | /*! Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ |
| | | FBSDK_EXTERN NSString *const FBSDKLoggingBehaviorDeveloperErrors; |
| | | /** Log errors likely to be preventable by the developer. This is in the default set of enabled logging behaviors. */ |
| | | FOUNDATION_EXPORT FBSDKLoggingBehavior FBSDKLoggingBehaviorDeveloperErrors; |
| | | |
| | | NS_SWIFT_NAME(Settings) |
| | | @interface FBSDKSettings : NSObject |
| | | |
| | | /*! |
| | | @abstract Get the Facebook App ID used by the SDK. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookAppID). |
| | | */ |
| | | + (NSString *)appID; |
| | | - (instancetype)init NS_UNAVAILABLE; |
| | | + (instancetype)new NS_UNAVAILABLE; |
| | | |
| | | /*! |
| | | @abstract Set the Facebook App ID to be used by the SDK. |
| | | @param appID The Facebook App ID to be used by the SDK. |
| | | /** |
| | | Retrieve the current iOS SDK version. |
| | | */ |
| | | + (void)setAppID:(NSString *)appID; |
| | | @property (class, nonatomic, copy, readonly) NSString *sdkVersion; |
| | | |
| | | /*! |
| | | @abstract Get the default url scheme suffix used for sessions. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). |
| | | /** |
| | | Retrieve the current default Graph API version. |
| | | */ |
| | | + (NSString *)appURLSchemeSuffix; |
| | | @property (class, nonatomic, copy, readonly) NSString *defaultGraphAPIVersion; |
| | | |
| | | /*! |
| | | @abstract Set the app url scheme suffix used by the SDK. |
| | | @param appURLSchemeSuffix The url scheme suffix to be used by the SDK. |
| | | /** |
| | | The quality of JPEG images sent to Facebook from the SDK, |
| | | expressed as a value from 0.0 to 1.0. |
| | | |
| | | If not explicitly set, the default is 0.9. |
| | | |
| | | @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ |
| | | @property (class, nonatomic, assign) CGFloat JPEGCompressionQuality |
| | | NS_SWIFT_NAME(jpegCompressionQuality); |
| | | |
| | | /** |
| | | Controls sdk auto initailization. |
| | | If not explicitly set, the default is true |
| | | */ |
| | | + (void)setAppURLSchemeSuffix:(NSString *)appURLSchemeSuffix; |
| | | @property (class, nonatomic, assign, getter=isAutoInitEnabled) BOOL autoInitEnabled |
| | | DEPRECATED_MSG_ATTRIBUTE("Auto-initialization will be removed in the next major version release."); |
| | | |
| | | /*! |
| | | @abstract Retrieve the Client Token that has been set via [FBSDKSettings setClientToken]. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookClientToken). |
| | | /** |
| | | Controls the auto logging of basic app events, such as activateApp and deactivateApp. |
| | | If not explicitly set, the default is true |
| | | */ |
| | | + (NSString *)clientToken; |
| | | @property (class, nonatomic, assign, getter=isAutoLogAppEventsEnabled) BOOL autoLogAppEventsEnabled; |
| | | |
| | | /*! |
| | | @abstract Sets the Client Token for the Facebook App. |
| | | @discussion This is needed for certain API calls when made anonymously, without a user-based access token. |
| | | @param clientToken The Facebook App's "client token", which, for a given appid can be found in the Security |
| | | /** |
| | | Controls the fb_codeless_debug logging event |
| | | If not explicitly set, the default is true |
| | | */ |
| | | @property (class, nonatomic, assign, getter=isCodelessDebugLogEnabled) BOOL codelessDebugLogEnabled; |
| | | |
| | | /** |
| | | Controls the access to IDFA |
| | | If not explicitly set, the default is true |
| | | */ |
| | | @property (class, nonatomic, assign, getter=isAdvertiserIDCollectionEnabled) BOOL advertiserIDCollectionEnabled; |
| | | |
| | | /** |
| | | 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. |
| | | */ |
| | | @property (class, nonatomic, assign, getter=shouldLimitEventAndDataUsage) BOOL limitEventAndDataUsage; |
| | | |
| | | /** |
| | | A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. |
| | | */ |
| | | @property (class, nonatomic, assign, getter=isGraphErrorRecoveryEnabled) BOOL graphErrorRecoveryEnabled; |
| | | |
| | | /** |
| | | The Facebook App ID used by the SDK. |
| | | |
| | | If not explicitly set, the default will be read from the application's plist (FacebookAppID). |
| | | */ |
| | | @property (class, nonatomic, copy, nullable) NSString *appID; |
| | | |
| | | /** |
| | | The default url scheme suffix used for sessions. |
| | | |
| | | If not explicitly set, the default will be read from the application's plist (FacebookUrlSchemeSuffix). |
| | | */ |
| | | @property (class, nonatomic, copy, nullable) NSString *appURLSchemeSuffix; |
| | | |
| | | /** |
| | | The Client Token that has been set via [FBSDKSettings setClientToken]. |
| | | This is needed for certain API calls when made anonymously, without a user-based access token. |
| | | |
| | | The Facebook App's "client token", which, for a given appid can be found in the Security |
| | | section of the Advanced tab of the Facebook App settings found at <https://developers.facebook.com/apps/[your-app-id]> |
| | | */ |
| | | + (void)setClientToken:(NSString *)clientToken; |
| | | |
| | | /*! |
| | | @abstract A convenient way to toggle error recovery for all FBSDKGraphRequest instances created after this is set. |
| | | @param disableGraphErrorRecovery YES or NO. |
| | | If not explicitly set, the default will be read from the application's plist (FacebookClientToken). |
| | | */ |
| | | + (void)setGraphErrorRecoveryDisabled:(BOOL)disableGraphErrorRecovery; |
| | | @property (class, nonatomic, copy, nullable) NSString *clientToken; |
| | | |
| | | /*! |
| | | @abstract Get the Facebook Display Name used by the SDK. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). |
| | | */ |
| | | + (NSString *)displayName; |
| | | /** |
| | | The Facebook Display Name used by the SDK. |
| | | |
| | | /*! |
| | | @abstract Set the default Facebook Display Name to be used by the SDK. |
| | | @discussion This should match the Display Name that has been set for the app with the corresponding Facebook App ID, |
| | | This should match the Display Name that has been set for the app with the corresponding Facebook App ID, |
| | | in the Facebook App Dashboard. |
| | | @param displayName The Facebook Display Name to be used by the SDK. |
| | | |
| | | If not explicitly set, the default will be read from the application's plist (FacebookDisplayName). |
| | | */ |
| | | + (void)setDisplayName:(NSString *)displayName; |
| | | @property (class, nonatomic, copy, nullable) NSString *displayName; |
| | | |
| | | /*! |
| | | @abstract Get the Facebook domain part. |
| | | @discussion If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). |
| | | /** |
| | | The Facebook domain part. This can be used to change the Facebook domain |
| | | (e.g. @"beta") so that requests will be sent to `graph.beta.facebook.com` |
| | | |
| | | If not explicitly set, the default will be read from the application's plist (FacebookDomainPart). |
| | | */ |
| | | + (NSString *)facebookDomainPart; |
| | | @property (class, nonatomic, copy, nullable) NSString *facebookDomainPart; |
| | | |
| | | /*! |
| | | @abstract Set the subpart of the Facebook domain. |
| | | @discussion This can be used to change the Facebook domain (e.g. @"beta") so that requests will be sent to |
| | | graph.beta.facebook.com |
| | | @param facebookDomainPart The domain part to be inserted into facebook.com. |
| | | /** |
| | | The current Facebook SDK logging behavior. This should consist of strings |
| | | defined as constants with FBSDKLoggingBehavior*. |
| | | |
| | | This should consist a set of strings indicating what information should be logged |
| | | defined as constants with FBSDKLoggingBehavior*. Set to an empty set in order to disable all logging. |
| | | |
| | | 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: |
| | | |
| | | The default is a set consisting of FBSDKLoggingBehaviorDeveloperErrors |
| | | */ |
| | | + (void)setFacebookDomainPart:(NSString *)facebookDomainPart; |
| | | @property (class, nonatomic, copy) NSSet<FBSDKLoggingBehavior> *loggingBehaviors |
| | | NS_REFINED_FOR_SWIFT; |
| | | |
| | | /*! |
| | | @abstract The quality of JPEG images sent to Facebook from the SDK. |
| | | @discussion If not explicitly set, the default is 0.9. |
| | | @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ |
| | | + (CGFloat)JPEGCompressionQuality; |
| | | /** |
| | | Overrides the default Graph API version to use with `FBSDKGraphRequests`. This overrides `FBSDK_TARGET_PLATFORM_VERSION`. |
| | | |
| | | /*! |
| | | @abstract Set the quality of JPEG images sent to Facebook from the SDK. |
| | | @param JPEGCompressionQuality The quality for JPEG images, expressed as a value from 0.0 to 1.0. |
| | | @see [UIImageJPEGRepresentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIImageJPEGRepresentation) */ |
| | | + (void)setJPEGCompressionQuality:(CGFloat)JPEGCompressionQuality; |
| | | The string should be of the form `@"v2.7"`. |
| | | |
| | | /*! |
| | | @abstract |
| | | 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. |
| | | Defaults to `FBSDK_TARGET_PLATFORM_VERSION`. |
| | | */ |
| | | @property (class, nonatomic, copy, null_resettable) NSString *graphAPIVersion; |
| | | |
| | | /** |
| | | The value of the flag advertiser_tracking_enabled that controls the advertiser tracking status of the data sent to Facebook |
| | | If not explicitly set in iOS14 or above, the default is false in iOS14 or above. |
| | | */ |
| | | + (BOOL)limitEventAndDataUsage; |
| | | + (BOOL)isAdvertiserTrackingEnabled; |
| | | |
| | | /*! |
| | | @abstract |
| | | 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. |
| | | |
| | | @param limitEventAndDataUsage The desired value. |
| | | /** |
| | | Set the advertiser_tracking_enabled flag. It only works in iOS14 and above. |
| | | |
| | | @param advertiserTrackingEnabled the value of the flag |
| | | @return Whether the the value is set successfully. It will always return NO in iOS 13 and below. |
| | | */ |
| | | + (void)setLimitEventAndDataUsage:(BOOL)limitEventAndDataUsage; |
| | | + (BOOL)setAdvertiserTrackingEnabled:(BOOL)advertiserTrackingEnabled; |
| | | |
| | | /*! |
| | | @abstract Retrieve the current iOS SDK version. |
| | | */ |
| | | + (NSString *)sdkVersion; |
| | | /** |
| | | Set the data processing options. |
| | | |
| | | /*! |
| | | @abstract Retrieve the current Facebook SDK logging behavior. |
| | | */ |
| | | + (NSSet *)loggingBehavior; |
| | | @param options list of options |
| | | */ |
| | | + (void)setDataProcessingOptions:(nullable NSArray<NSString *> *)options; |
| | | |
| | | /*! |
| | | @abstract Set the current Facebook SDK logging behavior. This should consist of strings defined as |
| | | constants with FBSDKLoggingBehavior*. |
| | | /** |
| | | Set the data processing options. |
| | | |
| | | @param loggingBehavior A set of strings indicating what information should be logged. If nil is provided, the logging |
| | | behavior is reset to the default set of enabled behaviors. Set to an empty set in order to disable all logging. |
| | | @param options list of the options |
| | | @param country code of the country |
| | | @param state code of the state |
| | | */ |
| | | + (void)setDataProcessingOptions:(nullable NSArray<NSString *> *)options |
| | | country:(int)country |
| | | state:(int)state; |
| | | |
| | | @discussion 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: |
| | | */ |
| | | + (void)setLoggingBehavior:(NSSet *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Enable a particular Facebook SDK logging behavior. |
| | | /** |
| | | Enable a particular Facebook SDK logging behavior. |
| | | |
| | | @param loggingBehavior The LoggingBehavior to enable. This should be a string defined as a constant with FBSDKLoggingBehavior*. |
| | | */ |
| | | + (void)enableLoggingBehavior:(NSString *)loggingBehavior; |
| | | + (void)enableLoggingBehavior:(FBSDKLoggingBehavior)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Disable a particular Facebook SDK logging behavior. |
| | | /** |
| | | Disable a particular Facebook SDK logging behavior. |
| | | |
| | | @param loggingBehavior The LoggingBehavior to disable. This should be a string defined as a constant with FBSDKLoggingBehavior*. |
| | | */ |
| | | + (void)disableLoggingBehavior:(NSString *)loggingBehavior; |
| | | |
| | | /*! |
| | | @abstract Set the user defaults key used by legacy token caches. |
| | | |
| | | @param tokenInformationKeyName the key used by legacy token caches. |
| | | |
| | | @discussion Use this only if you customized FBSessionTokenCachingStrategy in v3.x of |
| | | the Facebook SDK for iOS. |
| | | */ |
| | | + (void)setLegacyUserDefaultTokenInformationKeyName:(NSString *)tokenInformationKeyName; |
| | | |
| | | /*! |
| | | @abstract Get the user defaults key used by legacy token caches. |
| | | */ |
| | | + (NSString *)legacyUserDefaultTokenInformationKeyName; |
| | | + (void)disableLoggingBehavior:(FBSDKLoggingBehavior)loggingBehavior; |
| | | |
| | | @end |
| | | |
| | | NS_ASSUME_NONNULL_END |