Open saravananmani1988 opened 5 years ago
How about in iOS ? can u getting it on iphone?
@uokivan sorry i don't have an IOS device to test.
I'm experiencing the same issue. instantVerification
is true, and the verified
is false, and nothing else is returned from the plugin. No verificationId
, no code
. This means I can't really log into AngularFire with Android phones that have auto-verification on at the moment.
Not really an Android developer, but I've dug around the code, and added a log statement in FirebasePlugin.java:
Field[] fields = credential.getClass().getDeclaredFields();
for (Field field : fields) {
Class type = field.getType();
if(type == String.class){
String value = getPrivateField(credential, field);
Log.d(TAG, "field value: " + value);
if(value == null) continue;
if(value.length() > 100) verificationId = value;
else if(value.length() >= 4 && value.length() <= 6) code = value;
}
}
The values I see in logcat are
field value: null
field value: null
field value: (my full phone number)
field value: null
So it seems that the plugin relies on certain private fields of PhoneAuthCredential that are not actually sent by Firebase anymore, during Android's auto-verify onVerificationCompleted.
Plugin version: 2.0.5. Using both @ionic-native/firebase@4.20.0 and directly via window.FirebasePlugin. Device: Huawei Mate 10 Pro, EMUI 9.0.0.179, Android 9
Describe the bug I'm using Ionic4 with this Native Firebase plugin by following https://beta.ionicframework.com/docs/native/firebase
When i call verifyPhoneNumber im getting the following response from the promise return.
{verified: false, instantVerification: true}
I dont see the code in the response. as per the API docs i should get code form the response if the instentverification is true.
here is my code in TypeScript. <<<<<<>>>>>>>>>>>>>>
import {Component, OnInit} from '@angular/core'; import {AlertController, NavController, ToastController, Platform } from '@ionic/angular'; import * as firebase from 'firebase'; import {AngularFireAuth} from '@angular/fire/auth'; import { Firebase } from '@ionic-native/firebase/ngx';
@Component({ selector: 'app-home', templateUrl: 'home.page.html', styleUrls: ['home.page.scss'], })
export class HomePage implements OnInit {
}
<<<<>>>>>>>>>>>>>>
To Reproduce Steps to reproduce the behavior: Create a new Ionic 4 blank project and all the plugin as described in the docs and call the method from a html page.
Expected behavior As per docs it should give the code as output if the verification is true.
Screenshots
Console Logs
Plugin Version "cordova-plugin-firebase@2.0.5",
Smartphone (please complete the following information):