NativeScript / NativeScript/firebase
initializeApp not working on iOS device
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 62
- Fork
- 53
- Merge medio
- 8g 4h
- PR unite (30g)
- 2
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia da firebase-core/index.ios.js e dalla chiamata a initializeApp in main.js. Traccia come vengono gestiti UIApplication.sharedApplication, launchQueue e launchCallback durante l’avvio di iOS. Il lavoro è completato quando l’inizializzazione va a buon fine su un dispositivo iOS e vengono raggiunti i callback di successo o di errore esistenti; verifica usando lo scenario di logging segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- firebase, ios, typescript
- Ambito
- mobile-dev
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100