FBSDKGateKeeperManager.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. #import <FBSDKCoreKit/FBSDKGateKeeperManaging.h>
  9. #import <Foundation/Foundation.h>
  10. #define FBSDK_GATEKEEPER_MANAGER_CACHE_TIMEOUT (60 * 60)
  11. NS_ASSUME_NONNULL_BEGIN
  12. @protocol FBSDKSettings;
  13. @protocol FBSDKGraphRequestFactory;
  14. @protocol FBSDKGraphRequestConnectionFactory;
  15. @protocol FBSDKDataPersisting;
  16. /**
  17. Internal Type exposed to facilitate transition to Swift.
  18. API Subject to change or removal without warning. Do not use.
  19. @warning INTERNAL - DO NOT USE
  20. */
  21. typedef NSString *const FBSDKGateKeeperKey NS_TYPED_EXTENSIBLE_ENUM NS_SWIFT_NAME(_GateKeeperManager.GateKeeperKey);
  22. typedef void (^ FBSDKGKManagerBlock)(NSError *_Nullable error)
  23. NS_SWIFT_NAME(_GKManagerBlock);
  24. /**
  25. Internal Type exposed to facilitate transition to Swift.
  26. API Subject to change or removal without warning. Do not use.
  27. @warning INTERNAL - DO NOT USE
  28. */
  29. NS_SWIFT_NAME(_GateKeeperManager)
  30. @interface FBSDKGateKeeperManager : NSObject <FBSDKGateKeeperManaging>
  31. - (instancetype)init NS_UNAVAILABLE;
  32. + (instancetype)new NS_UNAVAILABLE;
  33. + (void) configureWithSettings:(id<FBSDKSettings>)settings
  34. graphRequestFactory:(id<FBSDKGraphRequestFactory>)graphRequestFactory
  35. graphRequestConnectionFactory:(id<FBSDKGraphRequestConnectionFactory>)graphRequestConnectionFactory
  36. store:(id<FBSDKDataPersisting>)store
  37. NS_SWIFT_NAME(configure(settings:graphRequestFactory:graphRequestConnectionFactory:store:));
  38. /// Returns the locally cached configuration.
  39. + (BOOL)boolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
  40. /**
  41. Load the gate keeper configurations from server
  42. WARNING: Must call `configure` before loading gate keepers.
  43. */
  44. + (void)loadGateKeepers:(nullable FBSDKGKManagerBlock)completionBlock;
  45. @end
  46. NS_ASSUME_NONNULL_END