-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(firestore): add
addCollectionGroupSnapshotListener(...)
method (…
- Loading branch information
Showing
12 changed files
with
425 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@capacitor-firebase/firestore': minor | ||
--- | ||
|
||
feat: add `addCollectionGroupSnapshotListener(...)` method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...plugins/firebase/firestore/classes/options/AddCollectionGroupSnapshotListenerOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package io.capawesome.capacitorjs.plugins.firebase.firestore.classes.options; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import com.getcapacitor.JSArray; | ||
import com.getcapacitor.JSObject; | ||
import io.capawesome.capacitorjs.plugins.firebase.firestore.FirebaseFirestoreHelper; | ||
import io.capawesome.capacitorjs.plugins.firebase.firestore.classes.constraints.QueryCompositeFilterConstraint; | ||
import io.capawesome.capacitorjs.plugins.firebase.firestore.interfaces.QueryNonFilterConstraint; | ||
import org.json.JSONException; | ||
|
||
public class AddCollectionGroupSnapshotListenerOptions { | ||
|
||
@NonNull | ||
private String reference; | ||
|
||
@Nullable | ||
private QueryCompositeFilterConstraint compositeFilter; | ||
|
||
@NonNull | ||
private QueryNonFilterConstraint[] queryConstraints; | ||
|
||
private String callbackId; | ||
|
||
public AddCollectionGroupSnapshotListenerOptions( | ||
String reference, | ||
@Nullable JSObject compositeFilter, | ||
@Nullable JSArray queryConstraints, | ||
String callbackId | ||
) throws JSONException { | ||
this.reference = reference; | ||
this.compositeFilter = FirebaseFirestoreHelper.createQueryCompositeFilterConstraintFromJSObject(compositeFilter); | ||
this.queryConstraints = FirebaseFirestoreHelper.createQueryNonFilterConstraintArrayFromJSArray(queryConstraints); | ||
this.callbackId = callbackId; | ||
} | ||
|
||
public String getReference() { | ||
return reference; | ||
} | ||
|
||
@Nullable | ||
public QueryCompositeFilterConstraint getCompositeFilter() { | ||
return compositeFilter; | ||
} | ||
|
||
@NonNull | ||
public QueryNonFilterConstraint[] getQueryConstraints() { | ||
return queryConstraints; | ||
} | ||
|
||
public String getCallbackId() { | ||
return callbackId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...ages/firestore/ios/Plugin/Classes/Options/AddCollectionGroupSnapshotListenerOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Foundation | ||
import Capacitor | ||
|
||
@objc public class AddCollectionGroupSnapshotListenerOptions: NSObject { | ||
private var reference: String | ||
private var compositeFilter: QueryCompositeFilterConstraint? | ||
private var queryConstraints: [QueryNonFilterConstraint] | ||
private var callbackId: String | ||
|
||
init(reference: String, compositeFilter: JSObject?, queryConstraints: [JSObject]?, callbackId: String) { | ||
self.reference = reference | ||
self.compositeFilter = FirebaseFirestoreHelper.createQueryCompositeFilterConstraintFromJSObject(compositeFilter) | ||
self.queryConstraints = FirebaseFirestoreHelper.createQueryNonFilterConstraintArrayFromJSArray(queryConstraints) | ||
self.callbackId = callbackId | ||
} | ||
|
||
func getReference() -> String { | ||
return reference | ||
} | ||
|
||
func getCompositeFilter() -> QueryCompositeFilterConstraint? { | ||
return compositeFilter | ||
} | ||
|
||
func getQueryConstraints() -> [QueryNonFilterConstraint] { | ||
return queryConstraints | ||
} | ||
|
||
func getCallbackId() -> String { | ||
return callbackId | ||
} | ||
} |
Oops, something went wrong.