@@ -3,6 +3,7 @@ import { AndroidActivityResultEventData } from "tns-core-modules/application";
33import lazy from "tns-core-modules/utils/lazy" ;
44import { ad as AndroidUtils } from "tns-core-modules/utils/utils" ;
55import {
6+ ActionCodeSettings ,
67 DataSnapshot ,
78 FBDataSingleEvent ,
89 FBErrorData ,
@@ -631,7 +632,7 @@ firebase.getCurrentUser = arg => {
631632 } ) ;
632633} ;
633634
634- firebase . sendEmailVerification = ( ) => {
635+ firebase . sendEmailVerification = ( actionCodeSettings ?: ActionCodeSettings ) => {
635636 return new Promise ( ( resolve , reject ) => {
636637 try {
637638 const firebaseAuth = com . google . firebase . auth . FirebaseAuth . getInstance ( ) ;
@@ -647,7 +648,24 @@ firebase.sendEmailVerification = () => {
647648 }
648649 } ) ;
649650
650- user . sendEmailVerification ( ) . addOnCompleteListener ( addOnCompleteListener ) ;
651+ if ( actionCodeSettings ) {
652+ const settingsBuilder = new com . google . firebase . auth . ActionCodeSettings . newBuilder ( ) ;
653+ if ( actionCodeSettings . handleCodeInApp !== undefined ) {
654+ settingsBuilder . setHandleCodeInApp ( actionCodeSettings . handleCodeInApp ) ;
655+ }
656+ if ( actionCodeSettings . url ) {
657+ settingsBuilder . setUrl ( actionCodeSettings . url ) ;
658+ }
659+ if ( actionCodeSettings . iOS && actionCodeSettings . iOS . bundleId ) {
660+ settingsBuilder . setIOSBundleId ( actionCodeSettings . iOS . bundleId ) ;
661+ }
662+ if ( actionCodeSettings . android && actionCodeSettings . android . packageName ) {
663+ settingsBuilder . setAndroidPackageName ( actionCodeSettings . android . packageName , actionCodeSettings . android . installApp , actionCodeSettings . android . minimumVersion || null ) ;
664+ }
665+ user . sendEmailVerification ( settingsBuilder . build ( ) ) . addOnCompleteListener ( addOnCompleteListener ) ;
666+ } else {
667+ user . sendEmailVerification ( ) . addOnCompleteListener ( addOnCompleteListener ) ;
668+ }
651669 } else {
652670 reject ( "Log in first" ) ;
653671 }
@@ -783,7 +801,8 @@ function toLoginResult(user, additionalUserInfo?): User {
783801 metadata : {
784802 creationTimestamp : user . getMetadata ( ) ? new Date ( user . getMetadata ( ) . getCreationTimestamp ( ) as number ) : null ,
785803 lastSignInTimestamp : user . getMetadata ( ) ? new Date ( user . getMetadata ( ) . getLastSignInTimestamp ( ) as number ) : null
786- }
804+ } ,
805+ sendEmailVerification : ( actionCodeSettings ?: ActionCodeSettings ) => firebase . sendEmailVerification ( actionCodeSettings )
787806 } ;
788807
789808 if ( firebase . currentAdditionalUserInfo ) {
0 commit comments