diff options
author | Greg Soltis <gsoltis@google.com> | 2017-12-18 18:50:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 18:50:08 -0800 |
commit | 52c7329f2a74ad457898afebe21b1f02e35d0d0f (patch) | |
tree | 8f5da4cb4ad1b61d46a0f3ad4195a59f2d95ebc4 /Firestore/Source/Public | |
parent | 8db0eb618d355c546e8f0894dc1e0799297c5659 (diff) |
Expose network management (#566)
* Expose network management in public API
* Clean up a few more references to the internal access of network management
* Move test
* Update comments
* Swap _Nullable for nullable
* Fix comment
* Add tests, including swift
* Styling
Diffstat (limited to 'Firestore/Source/Public')
-rw-r--r-- | Firestore/Source/Public/FIRFirestore.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Firestore/Source/Public/FIRFirestore.h b/Firestore/Source/Public/FIRFirestore.h index 91a96a5..4c85aba 100644 --- a/Firestore/Source/Public/FIRFirestore.h +++ b/Firestore/Source/Public/FIRFirestore.h @@ -139,6 +139,23 @@ NS_SWIFT_NAME(Firestore) + (void)enableLogging:(BOOL)logging DEPRECATED_MSG_ATTRIBUTE("Use FIRSetLoggerLevel(FIRLoggerLevelDebug) to enable logging"); +#pragma mark - Network + +/** + * Re-enables usage of the network by this Firestore instance after a prior call to + * `disableNetworkWithCompletion`. Completion block, if provided, will be called once network uasge + * has been enabled. + */ +- (void)enableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + +/** + * Disables usage of the network by this Firestore instance. It can be re-enabled by via + * `enableNetworkWithCompletion`. While the network is disabled, any snapshot listeners or get calls + * will return results from cache and any write operations will be queued until the network is + * restored. The completion block, if provided, will be called once network usage has been disabled. + */ +- (void)disableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; + @end NS_ASSUME_NONNULL_END |