[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) {
Log.d(TAG, "verifyPhoneNumber:verification:onVerificationCompleted");
WritableMap state = Arguments.createMap();
Parcel p1 = Parcel.obtain();
phoneAuthCredential.writeToParcel(p1, 0);
String verificationId = p1.readString();
String smsCode = p1.readString();
p1.recycle();
state.putString("code", smsCode);
state.putString("verificationId", verificationId);
Parcel parcel = Parcel.obtain();
phoneAuthCredential.writeToParcel(parcel, 0);
// TODO Read values - to get verification id
parcel.recycle();
state.putString("code", phoneAuthCredential.getSmsCode());
state.putString("verificationId", "");
sendPhoneStateEvent(appName, requestKey, "onVerificationComplete", state);
}