iOS设备Firebase手机号认证RecaptchaVerifier触发auth/internal-error求助
iOS设备上Firebase RecaptchaVerifier点击触发auth/internal-error错误
在iOS设备上使用手机号认证功能时,点击RecaptchaVerifier容器会触发以下内部错误,而通过ionic serve在Web端运行时功能完全正常,可正常显示reCaptcha。已确认设备上的Auth和AppCheck功能均无异常。
错误日志
Uncaught (in promise): FirebaseError: Firebase: Error (auth/internal-error). at@capacitor://localhost/main.52722ef3671ecb05.js:1:302281 create@capacitor://localhost/main.52722ef3671ecb05.js:1:302760 Ee@capacitor://localhost/main.52722ef3671ecb05.js:1:808106 @capacitor://localhost/main.52722ef3671ecb05.js:1:863588 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 @capacitor://localhost/main.52722ef3671ecb05.js:1:863349 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 render@capacitor://localhost/main.52722ef3671ecb05.js:1:862435 @capacitor://localhost/main.52722ef3671ecb05.js:1:862094 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 @capacitor://localhost/main.52722ef3671ecb05.js:1:864652 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 @capacitor://localhost/main.52722ef3671ecb05.js:1:864458 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 run@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:2004 @capacitor://localhost/main.52722ef3671ecb05.js:1:285236 @capacitor://localhost/main.52722ef3671ecb05.js:1:391388 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 @capacitor://localhost/1480.b05f7b47f5f0c77e.js:1:593 m@capacitor://localhost/main.52722ef3671ecb05.js:1:883073 We@capacitor://localhost/main.52722ef3671ecb05.js:1:883297 @capacitor://localhost/main.52722ef3671ecb05.js:1:883371 c@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:18436 @capacitor://localhost/main.52722ef3671ecb05.js:1:883241 Fv@capacitor://localhost/main.52722ef3671ecb05.js:1:543352 h@capacitor://localhost/main.52722ef3671ecb05.js:1:543520 @capacitor://localhost/main.52722ef3671ecb05.js:1:627862 onInvokeTask@capacitor://localhost/main.52722ef3671ecb05.js:1:514451 runTask@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:2625 invokeTask@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:8308 Z@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:20915 N@capacitor://localhost/polyfills.441dd4ca9dc0674f.js:1:21203
相关代码
app.module.ts
import { NgModule } from '@angular/core'; import { Capacitor } from '@capacitor/core' import { BrowserModule } from '@angular/platform-browser'; import { RouteReuseStrategy } from '@angular/router'; import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app-routing.module'; import { HttpClientModule } from '@angular/common/http'; import { getApp, initializeApp,provideFirebaseApp } from '@angular/fire/app'; import { environment } from '../environments/environment'; import { provideAuth,getAuth, initializeAuth, indexedDBLocalPersistence } from '@angular/fire/auth'; import { provideFirestore,getFirestore, initializeFirestore } from '@angular/fire/firestore'; import { provideStorage,getStorage } from '@angular/fire/storage'; import { initializeAppCheck, provideAppCheck, ReCaptchaV3Provider } from '@angular/fire/app-check'; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule, HttpClientModule, provideFirebaseApp(() => initializeApp(environment.firebase )), provideAppCheck(() => initializeAppCheck(undefined, { provider: new ReCaptchaV3Provider(environment.reCaptchaSiteKey), isTokenAutoRefreshEnabled: true }) ), provideAuth(() => { if(Capacitor.isNativePlatform()){ return initializeAuth(getApp(), { persistence: indexedDBLocalPersistence }); } else { return getAuth(); } }), provideFirestore(() => { if(Capacitor.isNativePlatform()){ return initializeFirestore(getApp(), { ignoreUndefinedProperties: true }); } else { return getFirestore(); } }), provideStorage(() => getStorage()), ], providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy}], bootstrap: [AppComponent], }) export class AppModule {}
capacitor.config.ts
import { CapacitorConfig } from '@capacitor/cli'; const config: CapacitorConfig = { appId: 'myPersonalAppId', appName: 'myPersonalAppName', webDir: 'www', server: { androidScheme: 'https', allowNavigation: ['*'], } }; export default config;
已尝试多种方法仍未解决,希望能找到在iOS设备上正常显示reCaptcha的方案。
内容的提问来源于stack exchange,提问作者TotoTricot
相关产品推荐
相关产品推荐

