如何使用`$ cordovaOauth`登录google并访问谷歌日历?

时间:2016-07-10 17:31:11

标签: angularjs ionic-framework google-calendar-api ngcordova

我正试图访问谷歌日历,但我得到:

GET https://content.googleapis.com/calendar/v3/users/me/calendarList 401 (Unauthorized)

谷歌登录有效,但无法访问日历:

var scopes = [
    "https://www.googleapis.com/auth/calendar", 
    "https://www.googleapis.com/auth/userinfo.email", 
    "https://www.googleapis.com/auth/userinfo.profile", 
    "https://www.googleapis.com/auth/plus.me", 
    "https://www.googleapis.com/auth/plus.login"
]

$cordovaOauth.google(clientId, scopes).then(success, error);

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我会尝试转到Google Developer console并启用Calendar API