Reputation: 1245
I am using Firebase to develop iOS app on Flutter,
My pubsec.yaml
file has
firebase_core: 0.4.3+3
firebase_auth: ^0.14.0+5
firebase_database: ^3.1.1
Below is the error I get,
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c710bc +[NSException raise:format:] + 188
3 Runner 0x0000000106000e9f +[FIRInstallations validateAppOptions:appName:] + 799
4 Runner 0x00000001060009eb -[FIRInstallations initWithAppOptions:appName:installationsIDController:prefe<…>
Upvotes: 1
Views: 789
Reputation: 21
You should add apiKey value to FirebaseOptions on iOS too, it worked for me!
FirebaseApp.configure(
name: 'name',
options: Platform.isIOS
? const FirebaseOptions(
googleAppID: '1:xxxx',
gcmSenderID: 'xxxx',
databaseURL: 'https://xxxx.firebaseio.com',
apiKey:'xxx',
)
: const FirebaseOptions(
googleAppID: '1:xxx',
apiKey: 'xxx',
databaseURL: 'https://xx.firebaseio.com',
)
);
Upvotes: 2
Reputation: 29572
Most likely is that you need to update the GoogleServices-Info.plist from the console to the app.
Full details in the source at https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseInstallations/Source/Library/FIRInstallations.m#L122
Upvotes: 0