Skip to content

Conversation

@Daeda88
Copy link
Contributor

@Daeda88 Daeda88 commented Dec 8, 2025

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.

@Daeda88
Copy link
Contributor Author

Daeda88 commented Dec 9, 2025

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)
Copy link
Contributor Author

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",
Copy link
Contributor Author

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) }
Copy link
Contributor Author

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> {
Copy link
Contributor Author

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()
Copy link
Contributor Author

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"
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Query.count to FireStore for Android, iOS

1 participant