我正在尝试获取电子邮件地址。成功登录后,我有名字、姓氏,除了电子邮件之外的所有信息。请帮忙。
VK.Auth.login(function (response) {
if (response.session) {
} else {
}
}, 4194304);
我正在尝试获取电子邮件地址。成功登录后,我有名字、姓氏,除了电子邮件之外的所有信息。请帮忙。
VK.Auth.login(function (response) {
if (response.session) {
} else {
}
}, 4194304);
是的,这种方法无法获取电子邮件。但是可以通过OAuth方式(对于vk.com/dev/auth_sites网站)获取电子邮件,电子邮件将与令牌一起在GET参数中返回。
在Coffescript/Javascript中,您可以使用window.open(...)。
appId = 'your app id'
redirectUri = 'your redirect uri'
url = 'https://oauth.vk.com/authorize?client_id='+appId+'&display=popup&redirect_uri='+redirectUri+'&response_type=token&scope=email'
newWin = window.open(url, 'vk-login', 'width=665,height=370')
之后您有两种方法获取电子邮件
现在,vk.com具备该功能。请尝试查看此文档页面:https://vk.com/dev/permissions
没有办法做到这一点,Vk是一个特定的社交网络。
您可以使用 window.open
var url = 'https://oauth.vk.com/authorize?client_id=APP_ID&scope=email&redirect_uri=http://yoursite.com&response_type=token'
var newWin = window.open(url, 'vk-login', 'width=665,height=370')
newWin.onload = function() {
var hash = newWin.location.hash
console.log(hash)
}