initializeApp not working on iOS device
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- firebase, ios, typescript
- Domain
- mobile-dev
Research direction
Start with firebase-core/index.ios.js and the initializeApp call in main.js. Trace how UIApplication.sharedApplication, launchQueue, and launchCallback are handled during iOS startup. Done means initialization resolves on an iOS device and the existing success or error callbacks are reached; verify with the reported logging scenario.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 62
- Forks
- 53
- Avg merge
- 8d 4h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NativeScript/firebase
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
NativeScript/firebase#292 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
NativeScript/firebase#289 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NativeScript/firebase#288 · 4 reactions ·
-
bug ios
NativeScript/firebase#287 · 1 assignee ·
-
Uh-Oh Shazam Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
NativeScript/firebase#286 ·
All issues in NativeScript/firebase
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100