How to check if user is currently signed in to Chrome?

57 views
Skip to first unread message

Aleksander Świtalski

unread,
Aug 16, 2014, 3:02:09 AM8/16/14
to gcm-for-chr...@googlegroups.com
Hi,

The chrome.identity API allows to add a listener which reacts when the sign in information changes.
But is there a way to get the same information (obfuscated account id and signed in flag) directly (current state)?

Adding a listener does not cause it being called with the current information right away...

Cheers.
Alex

Filip Gorski

unread,
Aug 18, 2014, 1:38:29 PM8/18/14
to gcm-for-chr...@googlegroups.com
Hi, Alex,

I believe you are looking for GetAccounts function: https://developer.chrome.com/extensions/identity#method-getAccounts
It is only available in the dev channel currently, but should be on its way up to stable.

Of course if you only care about the identity of the sync user, getProfileUserInfo seems to be doing the job:
This function ships with 37.

Let me know if it doesn't help.

Thanks,
Filip
Reply all
Reply to author
Forward
0 new messages