I am supposed to display an default image set by my app, in case no profile image has been set by the user. For which i need to detect whether user has set any profile image or not in his google account.
Now, upon accessing profile image for a user who has not set any image yet, api is returning default profile image set by google. Also, hasImage property resulted to be of no use, as it always returns true, even for this case.
Following is the API, which i used to access the profileImage
GoogleSignIn (3.0.0)
GIDProfileData->hasImage : "Whether or not the user has profile image"
GIDProfileData->imageURLWithDimension : "Gets the user's profile image URL for the given dimension in pixels for each side of the square"
Here's the snippet for accessing the profile image :
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];
}
Last resort for this seems to compare the image, that will also break in case default image changes.
