-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
getCountFromServer(...)
method (#792)
* feat(firestore): add getCountFromServer method Add method definition. * feat(firestore): add getCountFromServer method Implement method on web. * feat(firestore): add getCountFromServer method Implement method on ios. * feat(firestore): add getCountFromServer method Implement method on android. * feat(firestore): add getCountFromServer method Run format script. * feat(firestore): add getCountFromServer method Generate changeset file. * add missing documentation * reorder method --------- Co-authored-by: Robin Genz <[email protected]>
- Loading branch information
Showing
14 changed files
with
256 additions
and
5 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 `getCountFromServer` 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
18 changes: 18 additions & 0 deletions
18
...ome/capacitorjs/plugins/firebase/firestore/classes/options/GetCountFromServerOptions.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,18 @@ | ||
package io.capawesome.capacitorjs.plugins.firebase.firestore.classes.options; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
public class GetCountFromServerOptions { | ||
|
||
@NonNull | ||
private final String reference; | ||
|
||
public GetCountFromServerOptions(@NonNull String reference) { | ||
this.reference = reference; | ||
} | ||
|
||
@NonNull | ||
public String getReference() { | ||
return reference; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...some/capacitorjs/plugins/firebase/firestore/classes/results/GetCountFromServerResult.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,20 @@ | ||
package io.capawesome.capacitorjs.plugins.firebase.firestore.classes.results; | ||
|
||
import com.getcapacitor.JSObject; | ||
import io.capawesome.capacitorjs.plugins.firebase.firestore.interfaces.Result; | ||
|
||
public class GetCountFromServerResult implements Result { | ||
|
||
private final long count; | ||
|
||
public GetCountFromServerResult(long count) { | ||
this.count = count; | ||
} | ||
|
||
@Override | ||
public JSObject toJSObject() { | ||
JSObject result = new JSObject(); | ||
result.put("count", count); | ||
return result; | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
packages/firestore/ios/Plugin/Classes/Options/GetCountFromServerOptions.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,13 @@ | ||
import Foundation | ||
|
||
@objc public class GetCountFromServerOptions: NSObject { | ||
private let reference: String | ||
|
||
init(reference: String) { | ||
self.reference = reference | ||
} | ||
|
||
func getReference() -> String { | ||
return reference | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
packages/firestore/ios/Plugin/Classes/Results/GetCountFromServerResult.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,15 @@ | ||
import Capacitor | ||
|
||
@objc public class GetCountFromServerResult: NSObject, Result { | ||
let count: Int | ||
|
||
init(_ count: Int) { | ||
self.count = count | ||
} | ||
|
||
public func toJSObject() -> AnyObject { | ||
var result = JSObject() | ||
result["count"] = count | ||
return result as AnyObject | ||
} | ||
} |
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
Oops, something went wrong.