You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Directly copy the file GoogleService-Info.plist during xcode build through PostProcessBuild
Place BuildPostProcessorInfo.cs anywhere in your Unity project
#ifUNITY_EDITOR&&UNITY_IOSusing System.IO;using UnityEditor;using UnityEditor.Callbacks;using UnityEditor.iOS.Xcode;publicclassBuildPostProcessorInfo{[PostProcessBuild]publicstaticvoidOnPostProcessBuildAddFirebaseFile(BuildTargetbuildTarget,stringpathToBuiltProject){if(buildTarget== BuildTarget.iOS){// Go get pbxproj filestringprojPath=pathToBuiltProject+"/Unity-iPhone.xcodeproj/project.pbxproj";// PBXProject class represents a project build settings file,// here is how to read that in.PBXProjectproj=new PBXProject();
proj.ReadFromFile(projPath);// Copy plist from the project folder to the build folder
proj.AddFileToBuild(proj.GetUnityMainTargetGuid(), proj.AddFile("GoogleService-Info.plist","GoogleService-Info.plist"));// Write PBXProject object back to the file
proj.WriteToFile(projPath);}}}
#endif
The text was updated successfully, but these errors were encountered:
How to solve the problem
The text was updated successfully, but these errors were encountered: