Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to support multiple Google Accounts when authorizing using the JS client API library on Safari on iOS 6?

On our site http://www.draw.io/ in the top right there's a Google Drive integration button that uses the JS API client library to authorize. This works fine everywhere, except for Safari on iOS 6. When clicking on it a new tab flicks up briefly then disappears. From our logging our authorize call is invoked, but our callback function is never reached.

We followed the tips in this thread to get a reasonable level of multiple account handling working and it works correctly in all other environments we've tested, including iOS 5. If we set the immediate parameter to true in the gapi.auth.authorize call the login works on iOS 6 because the popup is avoided. However, this only works for users with a single Google Account, if they have multiple accounts their default account is always used.

If, when, you read this question the main site doesn't show this behaviour, it's probably that we've patched it to detect Safari on iOS 6 and set the immediate flag to true. This fixes part of the problem so users on iOS 6 can use Drive with our app at all, but we still need to support multiple accounts.

like image 786
Thomas the Tank Engine Avatar asked Nov 12 '22 14:11

Thomas the Tank Engine


1 Answers

Tested again today and this works correctly on iOS 5, 6 and 7.

like image 88
Thomas the Tank Engine Avatar answered Dec 09 '22 13:12

Thomas the Tank Engine