我需要帮助才能获得谷歌联系方式电子邮件,电话号码为ion,cordova with $cordovaOauth
。
答案 0 :(得分:1)
在谷歌控制台api中创建谷歌oauth api,如'1234567890-qhjnn7du9jrnhchuu66cc08i7pbuaaod.apps.googleusercontent.com'
$scope.googleinvite = function() {
$cordovaOauth.google("1234567890-qhjnn7du9jrnhchuu66cc08i7pbuaaod.apps.googleusercontent.com", ["https://www.google.com/m8/feeds"]).then(function(result) {
console.log(result)
var googleaccount = $http({
method: 'GET',
url: 'https://www.google.com/m8/feeds/contacts/default/full?access_token=' + result.access_token + "&alt=json&max-results=5000",
dataType: "jsonp",
});
googleaccount.success(function(response) {
console.log(response);
});
},
function(error) {
console.log("Error -> " + error);
});
}