I have an Ionic 5/Angular 12/Capacitor 3 mobile app that I am upgrading to Firebase 9 and Angular/Fire 7. Using the Angular/Fire upgrade command: ng update @angular/fire which uses the Firebase compat layer, the app works fine in browser running ionic serve. Next I created a production build to test on my phones, ionic cap sync --prod, and built to my Android and iPhones. The app works perfectly on Android, but does not on either of my iPhones, X and 6S. Debugging this a bit, shows that no response is coming from Firestore, including no error message. We even built the app and pushed to TestFlight and see the same inoperable app on iPhones.
Interesting note, running ionic cap run ios -l --external --prod directly to my iPhoneX does work!
The app is only using Firestore part of Firebase. User authentication is performed on a different backend and works normally.
Pertinent dependencies:
"@angular/...": "^12.0.1",
"@angular/fire": "^7.1.0",
"@capacitor/...": "^3.0.0",
"@ionic/angular": "^5.6.7",
"firebase": "^9.1.0",
NgModule imports:
provideFirebaseApp(() => initializeApp(environment.firebase)),
provideFirestore(() => {
const firestore = getFirestore();
enableIndexedDbPersistence(firestore);
return firestore;
}),
I am running Xcode 13.0 and iOS 15.0.1 on the iPhoneX and 14.6 on the iPhone6S.
I have tried dropping the compat layer and going directly to the new Angular/Fire 7 api for Firestore. But same result.
Even suggestions on what I can try to gain some more insight would be welcomed.
I fully removed the Angular/Fire compat layer, converted all Firestore calls to use the new modular SDK. When I posted my question I only partially removed the compat SDK.
Now with the app fully off Angular/Fire V7 compat, it works on both iOS and Android.
Not sure why compat layer was causing problems for iOS builds.