[auth][android] attempt to get verificationId from writeToParcel

This commit is contained in:
Salakar 2017-09-29 11:34:44 +01:00
parent d3ea57f76d
commit fe74c36e5b
1 changed files with 6 additions and 8 deletions

View File

@ -746,15 +746,13 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
public void onVerificationCompleted(final PhoneAuthCredential phoneAuthCredential) { public void onVerificationCompleted(final PhoneAuthCredential phoneAuthCredential) {
Log.d(TAG, "verifyPhoneNumber:verification:onVerificationCompleted"); Log.d(TAG, "verifyPhoneNumber:verification:onVerificationCompleted");
WritableMap state = Arguments.createMap(); WritableMap state = Arguments.createMap();
Parcel p1 = Parcel.obtain();
phoneAuthCredential.writeToParcel(p1, 0); Parcel parcel = Parcel.obtain();
String verificationId = p1.readString(); phoneAuthCredential.writeToParcel(parcel, 0);
String smsCode = p1.readString(); // TODO Read values - to get verification id
parcel.recycle();
p1.recycle(); state.putString("code", phoneAuthCredential.getSmsCode());
state.putString("code", smsCode); state.putString("verificationId", "");
state.putString("verificationId", verificationId);
sendPhoneStateEvent(appName, requestKey, "onVerificationComplete", state); sendPhoneStateEvent(appName, requestKey, "onVerificationComplete", state);
} }