I am trying to move to firebase auth from digits and I have used Android studio firebase tool to configure firebase settings in my app. I am trying to use firebase auth ui for phone verification.
My code is:
authButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(
Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.PHONE_VERIFICATION_PROVIDER).build()
))
.build(),
RC_SIGN_IN);
}
});
Now, when I click on the auth button, I get the phone number input ui and I put in my phone number, but when I click on Verify my phone number...I get a popup saying An internal error has occurred [MISSING_CLIENT_IDENTIFIER].
As requested, my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.app.id"
minSdkVersion 16
targetSdkVersion 25
versionCode 258
versionName "1.2.40"
}
buildTypes {
staging {
applicationIdSuffix ".staging"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "IS_STAGING", "true"
signingConfig signingConfigs.configstaging
debuggable true
}
release {
signingConfig signingConfigs.releaseConfig
}
}
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
repositories {
mavenCentral()
maven { url "https://urbanairship.bintray.com/android" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Urban Airship SDK
// Recommended for in-app messaging
// compile 'com.google.android.gms:play-services-analytics:9.2.0'
// compile('com.digits.sdk.android:digits:1.11.1@aar') {
// transitive = true;
// }
compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
transitive = true;
}
compile 'info.hoang8f:android-segmented:1.0.6'
compile 'com.urbanairship.android:urbanairship-sdk:8.6.+'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile 'com.google.android.gms:play-services-location:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.code.gson:gson:2.4'
compile 'net.danlew:android.joda:2.9.9'
compile 'com.android.support:support-v13:25.3.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.prolificinteractive:material-calendarview:1.4.3'
compile 'com.rollbar:rollbar-android:0.2.0'
compile 'com.google.firebase:firebase-auth:10.0.1'
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.4.2'
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
compile 'com.appsee:appsee-android:+'
}
apply plugin: 'com.google.gms.google-services'
My onActivityResult is never hit. I tried to debug this. I am using an actual device not a simulator. I have added the SHA1 too in my firebase project. Has anyone else come across this?
I finally solved this problem, it's very frustrating that firebase doesn't document such a common issue.
Odds are you were testing and everything was working fine, then you started testing with a white listed phone number, while doing so you were presented with captchas which got annoying so you found documented code to disable the captchas. Now, after weeks of testing with that you go back to production phone numbers only to find this error w/ not information on what's causing it. ;)
[FIRAuth auth].settings.appVerificationDisabledForTesting = YES;
^Set this back to NO and you'll be good to go!