Files
firebase-ios-sdk/FirebaseDatabase/Sources/Api/FIRDatabaseConfig.h
T

71 lines
2.7 KiB
Objective-C
Raw Normal View History

2017-05-15 12:27:07 -07:00
/*
* Copyright 2017 Google
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>
@protocol FAuthTokenProvider;
NS_ASSUME_NONNULL_BEGIN
/**
* TODO: Merge FIRDatabaseConfig into FIRDatabase.
*/
@interface FIRDatabaseConfig : NSObject
2019-08-05 13:27:47 -07:00
- (id)initWithSessionIdentifier:(NSString *)identifier
2020-06-08 14:37:07 -07:00
googleAppID:(NSString *)googleAppID
2019-08-05 13:27:47 -07:00
authTokenProvider:(id<FAuthTokenProvider>)authTokenProvider;
2017-05-15 12:27:07 -07:00
/**
2019-08-05 13:27:47 -07:00
* By default the Firebase Database client will keep data in memory while your
* application is running, but not when it is restarted. By setting this value
* to YES, the data will be persisted to on-device (disk) storage and will thus
* be available again when the app is restarted (even when there is no network
* connectivity at that time). Note that this property must be set before
* creating your first FIRDatabaseReference and only needs to be called once per
* application.
2017-05-15 12:27:07 -07:00
*
2019-08-05 13:27:47 -07:00
* If your app uses Firebase Authentication, the client will automatically
* persist the user's authentication token across restarts, even without
* persistence enabled. But if the auth token expired while offline and you've
* enabled persistence, the client will pause write operations until you
* successfully re-authenticate (or explicitly unauthenticate) to prevent your
* writes from being sent unauthenticated and failing due to security rules.
2017-05-15 12:27:07 -07:00
*/
2019-08-05 13:27:47 -07:00
@property(nonatomic) BOOL persistenceEnabled;
2017-05-15 12:27:07 -07:00
/**
2019-08-05 13:27:47 -07:00
* By default the Firebase Database client will use up to 10MB of disk space to
* cache data. If the cache grows beyond this size, the client will start
* removing data that hasn't been recently used. If you find that your
* application caches too little or too much data, call this method to change
* the cache size. This property must be set before creating your first
* FIRDatabaseReference and only needs to be called once per application.
2017-05-15 12:27:07 -07:00
*
2019-08-05 13:27:47 -07:00
* Note that the specified cache size is only an approximation and the size on
* disk may temporarily exceed it at times.
2017-05-15 12:27:07 -07:00
*/
2019-08-05 13:27:47 -07:00
@property(nonatomic) NSUInteger persistenceCacheSizeBytes;
2017-05-15 12:27:07 -07:00
/**
2019-08-05 13:27:47 -07:00
* Sets the dispatch queue on which all events are raised. The default queue is
* the main queue.
2017-05-15 12:27:07 -07:00
*/
2019-08-05 13:27:47 -07:00
@property(nonatomic, strong) dispatch_queue_t callbackQueue;
2017-05-15 12:27:07 -07:00
@end
NS_ASSUME_NONNULL_END