googlesamples / google-services

A collection of quickstart samples demonstrating the Google APIs for Android and iOS
https://developers.google.com
Apache License 2.0
3.08k stars 2.53k forks source link

IOS signin does not display accounts to choose from for connected gmail and google apps accounts #403

Open guylando opened 5 years ago

guylando commented 5 years ago

Using ios 12 sdk version 4.4.0, after "app wants to use google.com to sign in" the opened view asks for user details instead of displaying the currently signed in users in the gmail and google app (can see screenshot of the problem in the stackoverflow link below). Does this app support automatically getting users from gmail and google app for signin and if so then why doesn't it work?

On the same device in the same app when signing-in with Facebook then after "app wants to use facebook.com to sign in" the facebook app (not safari) account IS discovered and appears in accounts to select.

This exact problem was asked without answer (for almost a year) here: https://stackoverflow.com/questions/51557817/how-to-get-google-accounts-chooser-in-ionic-3-ios

Help will be appreciated

guylando commented 5 years ago

I found out the problem of why account is not shown in accounts chooser (at least after upgrading the ios sdk to SFAuthenticationSession, I don't know if it happened from same reason before upgrade): The google sso authentication accounts are saved in safari data and if you clear safari cache then the accounts are removed. This can be easily reproduced by logging in, in one app (such as yelp, tripadvisor and others) and then you WILL see accounts in other apps on google login. Then clean safari cache and offline data and then you will not see the accounts in other apps on google login. Facebook solved it using custom scheme redirect in a "open in app" button displayed in the SFAuthenticationSession.

I think google should implement similar solution to facebook.