NativeScript / NativeScript/firebase

initializeApp not working on iOS device

Offen
#166 25 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
62
Forks
53
Ø Merge
8 T. 4 Std.
Gemergte PRs (30 T.)
2

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit firebase-core/index.ios.js und dem initializeApp-Aufruf in main.js. Verfolge, wie UIApplication.sharedApplication, launchQueue und launchCallback während des iOS-Starts behandelt werden. Erledigt ist die Aufgabe, wenn die Initialisierung auf einem iOS-Gerät erfolgreich abgeschlossen wird und die vorhandenen Erfolgs- oder Fehler-Callbacks erreicht werden; überprüfe dies anhand des gemeldeten Logging-Szenarios.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
firebase, ios, typescript
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.