GoogleSignIn, It is not possible to determine whether the user has configured an image for any profile or not.

I have to show the default image installed by my application if the user has not set the profile image. Why do I need to determine if the user has configured any profile or not in their google account.

Now, having received the profile image for a user who has not yet installed any image, api returns the default profile image set by google. In addition, the hasImage property turned out to be useless, since it always returns true even for this case.

enter image description here

The following is the API that I used to access the profile.
GoogleSignIn (3.0.0)

GIDProfileData->hasImage : "Whether or not the user has profile image"
GIDProfileData->imageURLWithDimension : "Gets the user profile image URL for the given dimension in pixels for each side of the square"

link to the documentation page

:

if([GIDSignIn sharedInstance].currentUser.profile.hasImage) {

        NSUInteger imgSize = usrImgV.frame.size.height * 2;
        NSURL *imgUrl = [[GIDSignIn sharedInstance].currentUser.profile imageURLWithDimension:imgSize];
        [usrImgV setImageWithURL:imgUrl placeholderImage:placeholderImg];

    }



, , , .

+4

All Articles