| 728 | } |
| 729 | |
| 730 | static provider(auth?: Auth) { |
| 731 | const provider = new PhoneAuthProvider(); |
| 732 | const timeout = java.lang.Long.valueOf(60); |
| 733 | if (auth) { |
| 734 | provider._native = com.google.firebase.auth.PhoneAuthOptions.newBuilder(auth.native).setTimeout(timeout as any, java.util.concurrent.TimeUnit.SECONDS); |
| 735 | } else { |
| 736 | provider._native = com.google.firebase.auth.PhoneAuthOptions.newBuilder().setTimeout(timeout, java.util.concurrent.TimeUnit.SECONDS); |
| 737 | } |
| 738 | |
| 739 | provider._native.setActivity(Application.android.foregroundActivity || Application.android.startActivity); |
| 740 | |
| 741 | return provider; |
| 742 | } |
| 743 | |
| 744 | credential(verificationId: string, verificationCode: string) { |
| 745 | return AuthCredential.fromNative(com.google.firebase.auth.PhoneAuthProvider.getCredential(verificationId, verificationCode)); |