FIRFirestoreSettings.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2017 Google LLC
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. /** Used to set on-disk cache size to unlimited. Garbage collection will not run. */
  19. FOUNDATION_EXTERN const int64_t
  20. kFIRFirestoreCacheSizeUnlimited NS_SWIFT_NAME(FirestoreCacheSizeUnlimited);
  21. /** Settings used to configure a `Firestore` instance. */
  22. NS_SWIFT_NAME(FirestoreSettings)
  23. @interface FIRFirestoreSettings : NSObject <NSCopying>
  24. /**
  25. * Creates and returns an empty `FirestoreSettings` object.
  26. *
  27. * @return The created `FirestoreSettings` object.
  28. */
  29. - (instancetype)init NS_DESIGNATED_INITIALIZER;
  30. /** The hostname to connect to. */
  31. @property(nonatomic, copy) NSString *host;
  32. /** Whether to use SSL when connecting. */
  33. @property(nonatomic, getter=isSSLEnabled) BOOL sslEnabled;
  34. /**
  35. * A dispatch queue to be used to execute all completion handlers and event handlers. By default,
  36. * the main queue is used.
  37. */
  38. @property(nonatomic, strong) dispatch_queue_t dispatchQueue;
  39. /** Set to false to disable local persistent storage. */
  40. @property(nonatomic, getter=isPersistenceEnabled) BOOL persistenceEnabled;
  41. /**
  42. * Sets the cache size threshold above which the SDK will attempt to collect least-recently-used
  43. * documents. The size is not a guarantee that the cache will stay below that size, only that if
  44. * the cache exceeds the given size, cleanup will be attempted. Cannot be set lower than 1MB.
  45. *
  46. * Set to `FirestoreCacheSizeUnlimited` to disable garbage collection entirely.
  47. */
  48. @property(nonatomic, assign) int64_t cacheSizeBytes;
  49. @end
  50. NS_ASSUME_NONNULL_END