0
크롬 확장에서 데이터를 저장하기 위해 드라이브를 사용하려고합니다.크롬 확장자에서 gapi.client.drive를 사용하는 올바른 방법
$.getScript("https://apis.google.com/js/client.js", function() {
gapi.load('client', function() {
console.log("gapi.client is loaded")
gapi.client.load('drive', 'v3', function() {
console.log("gapi.client.drive is loaded");
chrome.identity.getAuthToken({'interactive': true}, function (token) {
gapi.client.setToken({access_token: token});
console.log("token :", token);
gapi.client.drive.files.list().then(function (list) {
console.log(list)
})
});
});
});
});
콘솔 말했다 :
첫째, 나는
다음"oauth2": {
"client_id": "999999.apps.googleusercontent.com",
"scopes": [
"https://www.googleapis.com/auth/drive.appdata"
]
},
파일의 목록을 얻으려고 manifest.json을 할 수있는 옵션이 필요 세트
gapi.client is loaded
gapi.client.drive is loaded
token : [TOKEN]
을 그리고 오류입니다 이렇게 :
"code": 403,
"message": "The granted scopes do not give access to all of the requested spaces."