简体   繁体   中英

cordova-firebase-plugin configuration for iOS

I am developing an app with Cordova. On Android, the Firebase plugin works well, but I am facing this issue on iOS:

<Error> [Firebase/Core][I-COR000009] The GOOGLE_APP_ID either in the plist
file 'GoogleService-Info.plist' or the one set in the customized options
is invalid. If you are using the plist file, use the iOS version of bundle
identifier to download the file, and do not manually edit the
GOOGLE_APP_ID. You may change your app's bundle identifier to '(null)'. Or
you can download a new configuration file that matches your bundle
identifier from https://console.firebase.google.com/ and replace the
current one.

*** Terminating app due to uncaught exception 'com.firebase.core', reason:
'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in
GoogleService-Info.plist or set in the customized options.'

I placed GoogleService-Info.plist in the root folder of the project, in the same folder of the .xcodeproj file.

Probably too late for you, but in case somebody else gets here like me, this file should be placed in the root of your cordova project. the plugin has hooks to copy the file into your xcode project during the build.

I resolved this issue by doing following step:

  1. Add GoogleService-Info.plist file in project root folder.
  2. Create build for ios platform.
  3. Run project throw Xcode on a device. Check if an error occurs. Download fresh GoogleService-Info.plist file replace at following place.
  4. platforms/ios/ProjectName/Resources/Resources/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM