Open perexlautaro opened 5 years ago
As you have got as far as compiling and it is falling over at runtime, do you have some example code?
Yes, I created a repo that contains an example app that gets the same error at runtime: Ionic-Firestore-App
I could fix this error:
2019-01-15 12:03:09.150246-0300 XXX[1263:341484] 5.15.0 - [Firebase/Core][I-COR000003] The default Firebase app has not yet been configured. Add `[FIRApp configure];` (`FirebaseApp.configure()` in Swift) to your application initialization. Read more: https://goo.gl/ctyzm8.
The solution was remove this block:
if(![FIRApp defaultApp]) {
[FIRApp configure];
}
And add:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
// if file is successfully found, use it
if(filePath){
NSLog(@"GoogleService-Info.plist found, setup: [FIRApp configureWithOptions]");
// create firebase configure options passing .plist as content
FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
// configure FIRApp with options
[FIRApp configureWithOptions:options];
}
// no .plist found, try default App
if (![FIRApp defaultApp] && !filePath) {
NSLog(@"GoogleService-Info.plist NOT FOUND, setup: [FIRApp defaultApp]");
[FIRApp configure];
}
The solution is related to this comment
Trying a little more I found that line: [FIRApp configureWithOptions:options];
(before [FIRApp configure];
) crash the app
Any update on this?
Sorry, I will try and take a look in the next few days, although I would expect the GoogleService-Info.plist to always be present. Is there a reason why it isn't?
No, there is no reason. The GoogleService-Info.plist is always present. Don't worry, when you can. Thanks for answering!
Expected Behavior
Work and compile in ios like in android.
Actual Behavior
Adding the plugin:
ionic cordova plugin add cordova-plugin-firestore --save --variable ANDROID_FIREBASE_CORE_VERSION=+ --variable ANDROID_FIREBASE_FIRESTORE_VERSION=17.1.0
Compile:
ionic cordova build ios
Then open
.xcworkspace
in xcode and run in real device, I get the following error:To fix this error, I add two
pods
:FirebaseMessaging
FirebaseRemoteConfig
Resulting in:
Then:
pod install
After that, the app compile, but I get an error in Runtime:
Steps to Reproduce the Problem
Open
platforms/ios/MyApp.xcworkspace
in xcode and runSpecifications
1.3.2
Framework: Ionic
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 7.1.4, ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 26 other plugins)
System:
ios-deploy : 1.9.4 NodeJS : v11.1.0 (/usr/local/Cellar/node/11.1.0/bin/node) npm : 6.4.1 OS : macOS Xcode : Xcode 10.1 Build version 10B61