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

fix(firebase-x): indicate callback methods to verifyPhoneNumber #3457

Conversation

vdias38
Copy link
Contributor

@vdias38 vdias38 commented Jun 12, 2020

indicate callback methods to verifyPhoneNumber and signInWithCredential functions.

Definition for the non-ionic methods are available as
https://github.com/dpa99c/cordova-plugin-firebasex/blob/master/types/index.d.ts#L120

- and remove callbacks methods on verifyNumber and signInWithCredential functions
@Sampath-Lokuge
Copy link

Hi @vdias38 Can we have release using this change?

@vdias38
Copy link
Contributor Author

vdias38 commented Jun 12, 2020

Hi @vdias38 Can we have release using this change?

I hope, but should wait owners to merge it, or use my branch... humm or not. Should wait for merge because you should install compiled code. If urgent, let me know and I'll find a way to share with you a compiled version.

@Sampath-Lokuge
Copy link

Thanks, @vdias38 I'll wait till the official release.

@CalumMurray
Copy link
Contributor

CalumMurray commented Jun 15, 2020

Partially duplicates #3443

@vdias38
Copy link
Contributor Author

vdias38 commented Jun 15, 2020

Partially duplicates #3443

Hi @CalumMurray , it's not exactly the same, I don't understand why you use callbacks as arguments and how/why you use them.
As far as I understand to use callbacks you can use directly the plugin interface. The ionic-native provides an interface to replace callbacks by Promise or Observable, then verifyPhoneNumber for example, could be called as below:

this.firebaseX.verifyPhoneNumber(phone, this.timeOutDuration)
.then( credential => {...})
.catch(error => {...})

Implementation above is compatible with following declaration I've submitted to ionic-native, but not with yours.

  @Cordova({
    callbackOrder: 'reverse'
  })
  verifyPhoneNumber(
    phoneNumber: string,
    timeOutDuration: number,
    fakeVerificationCode?: string
  ): Promise<any> {
    return;
  }

Make sense or do I miss something?
Following same logic I've added signOutUser on this #3458

@CalumMurray
Copy link
Contributor

Hi @vdias38, I think you're right. I had assumed they were removed during some build step perhaps as other had left the success/error callbacks in, so I also left them. Thanks for adding signOutUser(). Since yours is more complete, I think this can replace my PR #3443

@danielsogl danielsogl self-assigned this Jun 23, 2020
@danielsogl danielsogl added the target: patch This PR is targeted for the next patch release label Jun 23, 2020
@danielsogl danielsogl merged commit 66896b2 into danielsogl:master Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants