Skip to main content
Version: SDK-5.11.6

XCode Settings

To proceed with Google login in iOS, the following steps must be followed.
  1. Build Xcode in Unity
  2. Use CoCoaPod to add GoogleSignIn SDK to XCode

1. Build a project using XCode in Unity

In Unity, select Platform iOS and click Build.

2. Install Cocoapod

1) Run the terminal in Mac and enter the following command.

> sudo gem install cocoapods

2) Enter the PC password. The installation is complete when the following strings are printed.

Successfully installed cocoapods
Parsing documentation for cocoapods
Done installing documentation for cocoapods after 1 seconds
1 gem installed

2. Create Podfile

1) Move to the folder of the project built in Unity.

// Example
> cd Users/username/MyUnityProject/ios_Build

2) Check if PodFile exists inside the folder.
If PodFile does not exist, enter the 'pod init' command to create PodFile.
If you are using Firebase, PodFile may be generated automatically.

> pod init

3) Open the generated PodFile with a text editor and enter pod 'GoogleSignIn', '7.1.0'.

4) After saving the PodFile, enter 'pod install' in the terminal and create xcworkspace.
If it's successfully created, the following will be printed:

3. Build app

Afterward, build the app and check if Google login functions properly.

Error Case: When the app aborts

Inside the xcodeproj file, if the URL types is not properly set for 'Info,' the app may abort when calling methods. In this case, configure the iOS schema manually.

1) Open the created Unity-iPhone.xcworkspace.

2) Open Unity-iPhone > Info > URL Types and click the + button.

3) Among the generated URL entry fields, paste the iOS URL schema copied from Google Cloud Platform into URL Schemes.