Firestore: Aggregate Queries and SnapshotListenerOptions#785
Firestore: Aggregate Queries and SnapshotListenerOptions#785Daeda88 wants to merge 8 commits intoGitLiveApp:masterfrom
Conversation
TODO: The Java SDK should be updated
|
Preliminary JVM PR is here GitLiveApp/firebase-java-sdk#65 but Im getting issues running it locally. Seems to be related to a mismatch in the Play Services libraries being linked |
| val compileSdkVersion by extra(34) | ||
| val targetSdkVersion by extra(34) | ||
| val minSdkVersion by extra(21) | ||
| val minSdkVersion by extra(23) |
There was a problem hiding this comment.
Required By Android FB 34+
| context, | ||
| FirebaseOptions( | ||
| applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a", | ||
| applicationId = "1:${Random.nextInt()}:ios:dd1f6688bad7af768c841a", |
There was a problem hiding this comment.
On Android, the HeartBeatInfoStorage somewhat annoyingly does not clear properly between tests. Since it uses the applicationId as a persistenceKey and this ID doesnt really matter in tests, the easiest solution is to just randomize it
| get() = ios.name | ||
| actual val options: FirebaseOptions | ||
| get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, trackingID, storageBucket, projectID, GCMSenderID) } | ||
| get() = ios.options.run { FirebaseOptions(bundleID, APIKey!!, databaseURL!!, null, storageBucket, projectID, GCMSenderID) } |
There was a problem hiding this comment.
Removed on the iOS SDK
| actual fun getDouble(aggregateField: AggregateField): Double? = get(aggregateField)?.toDouble() | ||
| actual fun getLong(aggregateField: AggregateField): Long? = get(aggregateField)?.toLong() | ||
|
|
||
| private fun aggregateFields(): List<AggregateField> { |
There was a problem hiding this comment.
Since JS does not have the concept of AggregateQuery (a snapshot is created directly from a query) and I wanted to maintain the Android Feature set, im reverse engineering the AggregateFields from the received JSON. Knowing the format of the key allows for determining them at runtime instead.
| override fun hashCode(): Int = js.hashCode() | ||
| override fun toString(): String = js.toString() | ||
|
|
||
| internal val pathString: String get() = js.asDynamic()["_internalPath"].toString() |
There was a problem hiding this comment.
For FieldPath("a", "b", "c"), this should yield a.b.c
| @@ -1,28 +1,40 @@ | |||
| [versions] | |||
| agp = "8.12.0" | |||
There was a problem hiding this comment.
Upgraded all dependencies and structured them a bit clearer. Also moved NPM version here so its all in one place
|
@Reedyuk I see some activity again. Any chance this can be looked at? |
Fixes #657
This adds support for Aggregate Queries, SnapshotListenerOptions and upgrades to the latest Firebase SDK.
Impact:
Android Min sdk raised to 23
iOS Deployment Target raised to 15
TVOS Deployment Target raised to 15
Open Issue: This is breaking for JVM at the moment as the Java SDK requires an update.