Where to add GoogleService-Info.plist for Capacitor
Asked Answered
C

1

6

I found a lot of related questions, but none about the specifics for Capacitor.

When it comes to Capacitor, do we need to add GoogleService-Info.plist to:

  1. ios/App OR
  2. ios/App/App

The Firebase console says this... enter image description here

Clishmaclaver answered 9/2, 2021 at 6:25 Comment(0)
D
7

You have to add it from Xcode, because if you just copy it on any of those folders, Xcode won't see it.

With Xcode open, just drag the file anywhere inside the yellow App folder, Xcode will prompt you, make sure the "Copy items if needed" is checked and the radio button is in "Create groups" and Click finish prompt

example

Dishevel answered 9/2, 2021 at 18:51 Comment(4)
Maybe I missed it but this would be a great addition to the official docs!! Thanks again!!Clishmaclaver
It’s in the push notifications with firebase guide capacitorjs.com/docs/guides/…Dishevel
what about cicd? I can recall in the past it was enough to copy the file into the right place. Committing generated App to the repo is pretty dangerous as it's hard to control what changes made via Xcode are later committed.Serge
No, on iOS it as always been necessary to drag the files to Xcode as Xcode keeps reference of all the project files and if it’s not tracked y Xcode it won’t be seen. Maybe if you used Cordova you used the resource-file tag to copy those files. You can use node scripts to copy files and edit the project to reference those files so they are seen.Dishevel

© 2022 - 2024 — McMap. All rights reserved.