-
-
Notifications
You must be signed in to change notification settings - Fork 184
Firestore: Aggregate Queries and SnapshotListenerOptions #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgraded all dependencies and structured them a bit clearer. Also moved NPM version here so its all in one place
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.