Question about firebase unity and the GoogleService-Info.plist

1,617 views
Skip to first unread message

Josh

unread,
May 25, 2017, 7:06:39 PM5/25/17
to Firebase Google Group
This is for iOS. So the docs say to put the GoogleService-Info.plist anywhere in the project. I'm going to assume this gets put into the xcode project, but I can't seem to find it in the xcode project after I build. What happens to the plist? Does it get combined with the main plist?

Also, will the plist get put in if I don't use the PlayServicesResolver? The reason I ask that is because I add all the needed dependencies outside of unity... after it's built.

Also while we're add it, do you need the PlayServicesResolver for the android side? I see that it generates an xml file from the google-services.json and gets put into the firebase folder. 

Josh

unread,
May 26, 2017, 11:04:12 AM5/26/17
to Firebase Google Group
Oh, also forgot to ask this question too.

Can I put 2 GoogleService-Info.plist into the app? Will it be smart enough to know which one to use? My app has 2 different bundle ids, one for paid and one for free. If this isn't the correct way of doing it, then how should I go about this?

Gary Hooper

unread,
May 26, 2017, 5:46:56 PM5/26/17
to Firebase Google Group
I'm not using Unity, just iOS.

Yes, you can have multiple .plist files.  I have three, one each for development, beta, and production.

In Xcode, my configurations are named Dev, Beta, AppStore.  I've created a Configurations folder and placed in it a folder for each of these, and placed the appropriate GoogleService-Info.plist in the corresponding folder.  Then, in Build Phases, you can copy the correct plist to the target destination, e.g.

set config=`echo "${CONFIGURATION}" | sed -e 's/^.*-//'`

cp "${PROJECT_DIR}/YourApp/Configurations/$config/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"

Stewart Miles

unread,
May 30, 2017, 5:59:11 PM5/30/17
to Firebase Google Group
For Unity you drop them anywhere in your Unity project.

The config file is injected into the generated Xcode project by the Firebase Editor plugin.  You can verify that the Firebase Editor plugin is active by selecting "Window -> Firebase" from the menu.  You'll also need to verify the iOS resolver plugin is enabled under "Assets -> Play Services Resolver -> iOS Resolver -> Settings".  Each plugin is provided in the following DLLs:
  • Firebase/Editor/Firebase.Editor.dll
  • PlayServicesResolver/Editor/Google.IOSResolver.dll
They need to be enabled for the Unity editor, if they're not it's possible your project metadata ended up in a bad state.  Check the "Editor" box when selecting each DLL under these directories.

Regarding supporting multiple GoogleServices-Info.plist files, yes we support that use case.  We search all files in the project and select the one that matches the bundle ID of the Unity project to inject into the generated Xcode project.

Cheers,
Stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/58544159-ee2b-4291-9e98-a5f3f07d6564%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Josh

unread,
Jun 5, 2017, 3:18:29 PM6/5/17
to Firebase Google Group
That's good to know in terms of the multiple plist. Thank you.

I don't think I stated this before, but I am not using the google resolver to add files into the project because I am doing that on my own after the project is build by unity. I found out that the plist can be at the root level of the xcode project, so I just add whichever plist I need using PBXProject.

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages