android - Firebase phone auth response with null token -
i migrating digits authentication firebase authentication following these official links: https://firebase.google.com/support/guides/digits-android https://github.com/firebase/firebaseui-android/blob/master/auth/readme.md
google-services.json file exported firebase console it's integrated on project.
i using drop-in solution ui , code:
startactivityforresult( authui.getinstance() .createsigninintentbuilder() .setproviders(arrays.aslist( new authui.idpconfig.builder(authui.phone_verification_provider).build())).build(), rc_sign_in); @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == rc_sign_in) { idpresponse response = idpresponse.fromresultintent(data); // signed in if (resultcode == result_ok) { idpresponse idpresponse = idpresponse.fromresultintent(data); //here retreive token response idpresponse.getidptoken(); finish(); return; } else { // sign in failed if (response == null) { // user pressed button return; } if (response.geterrorcode() == errorcodes.no_network) { toast.maketext(this, getstring(r.string.connection_error), toast.length_short).show(); return; } if (response.geterrorcode() == errorcodes.unknown_error) { toast.maketext(this, getstring(r.string.error_default), toast.length_short).show(); return; } } toast.maketext(this, "error", toast.length_short).show(); } }
and interesting part of build.gradle:
android { compilesdkversion 26 buildtoolsversion '26.0.1'
}
compile 'com.firebaseui:firebase-ui-auth:2.3.0' compile 'com.android.support:appcompat-v7:26.0.1' compile 'com.android.support:support-v4:26.0.1' compile 'com.android.support:recyclerview-v7:26.0.1' compile 'com.android.support:design:26.0.1' compile 'com.android.support:support-core-utils:26.0.1' compile 'com.android.support:support-annotations:26.0.1' compile 'com.android.support:percent:26.0.1'
when onactivityresult it's fired, response successful token null.
i don't know if authentication provider, token it's null or i'm doing wrong.
thanks in advance!!
Comments
Post a Comment