A Builder for creating FirebaseFirestoreSettings.
|
FirebaseFirestoreSettings.Builder()
Constructs a new FirebaseFirestoreSettings Builder object.
|
|
|
FirebaseFirestoreSettings.Builder(FirebaseFirestoreSettings settings)
Constructs a new FirebaseFirestoreSettings Builder based on an existing
FirebaseFirestoreSettings object.
|
| FirebaseFirestoreSettings |
build()
|
| FirebaseFirestoreSettings.Builder | |
| FirebaseFirestoreSettings.Builder |
setPersistenceEnabled(boolean value)
Enables or disables local persistent storage.
|
| FirebaseFirestoreSettings.Builder |
setSslEnabled(boolean value)
Enables or disables SSL for communication.
|
| FirebaseFirestoreSettings.Builder |
setTimestampsInSnapshotsEnabled(boolean value)
Enables the use of
Timestamps for timestamp fields in
DocumentSnapshots. |
Constructs a new FirebaseFirestoreSettings Builder object.
Constructs a new FirebaseFirestoreSettings Builder based on an existing FirebaseFirestoreSettings object.
| settings |
|---|
Sets the host of the Firestore backend.
| host | The host string |
|---|
Enables or disables local persistent storage. The default is to use local persistent storage.
| value |
|---|
Enables or disables SSL for communication. The default is to use SSL.
| value |
|---|
Enables the use of Timestamps for timestamp fields in
DocumentSnapshots.
Currently, Firestore returns timestamp fields as Date but Date only supports millisecond precision, which leads to truncation and
causes unexpected behavior when using a timestamp from a snapshot as a part of a subsequent
query.
Setting setTimestampsInSnapshotsEnabled(true) will cause Firestore to return
Timestamp values instead of Date, avoiding this kind of problem. To make this work you must also change any code that
uses Date to use Timestamp
instead.
NOTE: in the future areTimestampsInSnapshotsEnabled() will
default to true and this option will be removed so you should change your code to use
Timestamp now and opt-in to this new behavior as soon as you can.
| value |
|---|
value.