Vincent Gigandet Vincent Gigandet - 1 year ago 138
iOS Question

iOS Google Sign-in fetching user profile picture impossible?(NOT Google plus sign-in)

I'm trying to make google sign-in work in my app but have an issue.

(NOT a google plus sign-in, I'm using google sign-in)

I followed this link and it works. I get userID, user.authentication.idToken,, and

But I can't find out the way how I get the user profile picture.
Above google docs have no comment on that.

I searched web for hours but found about google plus sign-in only which I don't want.

I implemented Facebook sign-in in my app and they provide the url that fetches user profile picture.

Does google sign-in serve something like that?

This is my working code fetching user info but no picture.

Please help

- (void)signIn:(GIDSignIn *)signIn didSignInForUser:(GIDGoogleUser *)user withError:(NSError *)error {

if (user) {
NSString *userId = user.userID; // For client-side use only!
NSString *token = user.authentication.idToken; // Safe to send to the server
NSString *name =;
NSString *email =;

Answer Source

you have to set [GIDSignIn sharedInstance].shouldFetchBasicProfile = YES; and the use below code for get profile pic

    if ([GIDSignIn sharedInstance].currentUser.profile.hasImage)
        NSUInteger dimension = round(thumbSize.width * [[UIScreen mainScreen] scale]);
        NSURL *imageURL = [user.profile imageURLWithDimension:dimension];

Swift Implementation:

let dimension = round(thumbSize.width * UIScreen.mainScreen().scale);
let pic = user.profile.imageURLWithDimension(dimension) 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download