Skip to content

Commit a196538

Browse files
author
盧彥辰
committed
feat: 加入Editor資料夾及GoogleSignInPostBuild
1. 解決 Xcode 的 exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|' 錯誤 issue #6
1 parent cded1aa commit a196538

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

Assets/Editor.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using UnityEditor;
2+
using UnityEditor.Callbacks;
3+
#if UNITY_IOS
4+
using UnityEditor.iOS.Xcode;
5+
#endif
6+
using UnityEngine;
7+
8+
public static class GoogleSignInPostBuild
9+
{
10+
11+
[PostProcessBuild(999)]
12+
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
13+
{
14+
#if UNITY_IOS
15+
var projPath = buildPath + "/Unity-iPhone.xcodeproj/project.pbxproj";
16+
var proj = new PBXProject();
17+
proj.ReadFromFile(projPath);
18+
var targetGuid = proj.GetUnityMainTargetGuid();
19+
proj.AddFileToBuild(targetGuid, proj.AddFile("Data/Raw/GoogleService-Info.plist", "GoogleService-Info.plist"));
20+
proj.WriteToFile(projPath);
21+
#endif
22+
23+
}
24+
25+
}

Assets/Editor/GoogleSignInPostBuild.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)