So, I have the following code on my site:
if ( kik.hasPermission() ) {
// do something
} else {
kik.getUser(function (user) {
if ( !user ) {
// error
} else {
typeof user.username; // 'string'
typeof user.fullName; // 'string'
typeof user.firstName; // 'string'
typeof user.lastName; // 'string'
typeof user.pic; // 'string'
typeof user.thumbnail; // 'string'
// set them ^ to vars here
}
});
}
But I would like to set the data (user.username, etc.) into variables. I can't seem to work it out. All help is appreciated.
The
user
paramter is an object containing the data you need. You can access and store the data like thisBe aware that
user.pic
anduser.thumbnail
are links to the images. If you want to store the image data you have to fetch it from the link first.