I'm trying to get the ID of a signed in user in Google Chrome using a separate function, however the gaiaId variable always seems to be 'undefined' even though userId contains the ID (I checked).
How do I retu the id from the function that's called?
function getGaia(){
chrome.identity.getProfileUserInfo(function(userInfo) {
var userId = userInfo.id;
alert(userId);
retu userId;
});
}
var gaiaId = getGaia();
alert(gaiaId);
