Skip to content
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

firebasex addDocumentToFirestoreCollection not returning document Id #3385

Closed
aalshberi opened this issue Apr 20, 2020 · 1 comment
Closed

Comments

@aalshberi
Copy link
Contributor

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior:
FirebaseX.addDocumentToFirestoreCollection() success function doesn't return the document Id.

Expected behavior:
FirebaseX.addDocumentToFirestoreCollection() success function returns the document Id

Steps to reproduce:
Try to add document to Firestore from the app using this code:
FirebaseX.addDocumentToFirestoreCollection(doc,"users",(docId)=>{
console.log(docId);
},(error)=>{
console.error(error);
})
Then in cmd :
ionic cordova build android --prod
will result in:
Argument of type '(docId: any) => void' is not assignable to parameter of type '() => void'.

If I changed the success callback in the index.d.ts file to "success: (id:string)" instead of "success: ()" the build succeeds.

Related code:
in the steps to produce section.

Ionic info::

Ionic:

Ionic CLI : 6.3.0
Ionic Framework : @ionic/angular 5.0.5
@angular-devkit/build-angular : 0.803.25
@angular-devkit/schematics : 8.3.25
@angular/cli : 8.3.8
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : not available
Cordova Plugins : not available

Utility:

cordova-res (update available: 0.12.1) : 0.8.0
native-run (update available: 1.0.0) : 0.2.8

System:

Android SDK Tools : 26.1.1
NodeJS : v10.16.3
npm : 6.11.3
OS : Windows 10

aalshberi added a commit to aalshberi/ionic-native that referenced this issue Apr 20, 2020
@aalshberi
Copy link
Contributor Author

Created a PR for it:
#3386

danielsogl pushed a commit that referenced this issue May 5, 2020
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

No branches or pull requests

2 participants