NativeScript / NativeScript/firebase

initializeApp not working on iOS device

Abierto
#166 25 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
TypeScript
Estrellas
62
Forks
53
Merge medio
8 d 4 h
PR fusionados (30 d)
2

Descripción

I'm converting an app from the old @nativescript/firebase library, and this is just about complete and fully functional on Android. I just tried running this on iOS, and the app is not initializing properly. In looking through firebase-core/index.ios.js, I've discovered that my initialization request is being added to the launchQueue array, but launchCallback is never being called.

There are no errors shown in the logs, so from what I can see the issue is just that this launchQueue is never being used.

I have the same GoogleService-Info.plist file as before in App_Resources/iOS. These are the relevant parts of the main.js file that's acting as the entry point:

import { firebase } from '@nativescript/firebase-core'
import '@nativescript/firebase-auth';
import '@nativescript/firebase-crashlytics';
import '@nativescript/firebase-analytics';
import '@nativescript/firebase-messaging';

// Initialize Firebase
firebase().initializeApp().then(() => {
  console.warn('🔥 Firebase initialized');
}).catch(error => {
  console.error('🔥 Firebase initialization error: ', error)
});

If I log to the console right before firebase().initializeApp() on iOS I see the log, but the 'Firebase initialized' log never appears. Adding additional logs in firebase-core/index.ios.js shows me that UIApplication.sharedApplication is null when checked, so the call to initApp is appended to the launchQueue array and then never used.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con firebase-core/index.ios.js y la llamada a initializeApp en main.js. Rastrea cómo se gestionan UIApplication.sharedApplication, launchQueue y launchCallback durante el inicio de iOS. Se considera terminado cuando la inicialización se resuelve en un dispositivo iOS y se alcanzan los callbacks de éxito o error existentes; verifícalo con el escenario de logging reportado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
firebase, ios, typescript
Área
mobile-dev
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.