Google User serverAuthCode nil in Objective-C
<p>I'm trying to integrate the <code>GoogleSignIn</code> framework in an iOS app and also authenticate an user on a server. I managed to log in the user, but in the <code>- (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error</code> delegate method, <code>user.serverAuthCode</code> is <code>nil</code>, and I need to pass this server authentication code to, uhm, authenticate the user on the server.</p>

<p>I read <a href="https://developers.google.com/identity/sign-in/ios/offline-access" rel="noreferrer">this documentation page</a> and it states that I have to set the <code>serverClientID</code> property of the <code>[GIDSignIn sharedInstance]</code>, but <strong>nowhere</strong> is it stated where do I find this "server client id". I ran tests with all the keys in the world to no avail.</p>

<p>I then found out <a href="https://developers.google.com/identity/sign-in/android/start-integrating#get_your_backend_servers_oauth_20_client_id" rel="noreferrer">this documentation page</a> which looks like it's trying to tell us where to find this magical id, but it's using poor wording and didn't help. I do have OAuth2 credentials with type <code>Web application</code>, but:</p>

<ol>
<li>They are used for the web (client) app, that corresponds to my iOS app, which also communicates with the server</li>
<li>I tried using it, and it didn't work.</li>
</ol>

<p>Did anyone manage to successfully escape from the Google <em>(poor)</em> documentation's clutches?</p>