1

このコードを使用して、Google から連絡先リストをインポートしています。すべて問題ありませんが、同じ結果を得ることができません。

fetchmail()メソッドが返すエラー: エラー {}

これが私の fetchmail() メソッドです:

fetchmail() {
console.log("check6");
gapi.load('client: auth2', () => {
  console.log('check7');
  gapi.auth2.getAuthInstance({
    apiKey: 'APIKEY',
    discoveryDocs: ['https://people.googleapis.com/$discovery/rest?version=v1'],
    clientId: '<MyClientID>.apps.googleusercontent.com',
    scope: 'profile email https://www.googleapis.com/auth/contacts.readonly'
  }).then(() => {
    console.log('check8');
    return gapi.client.people.people.connections.list({
      resourceName: 'people/me',
      personFields: 'emailAddresses, names'
    });
  }).then(
    (res) => {
      console.log("Res: " + JSON.stringify(res));
      this.userContacts.emit(this.transformToMailListModel(res.result));
      console.log("Res:" + JSON.stringify(res.result));
    },
    error => console.log("ERROR " + JSON.stringify(error))
  );
});

そしてブラウザコンソールから、私はこの結果を得ています:

ここに画像の説明を入力

誰でも問題を見つけるのを手伝ってくれますか、同じ問題の修正を提案してください。

前もって感謝します!

4

0 に答える 0