繁体   English   中英

使用联系人 javascript api 将联系人与谷歌联系人同步

[英]Syncing contacts with google contacts using contacts javascript api

您好,我有一个 web 门户网站,人们会在那里分享 email id。 我想添加与谷歌联系人的同步。 我为此使用 javascript api ,但面临很多问题。 我尝试了谷歌提供的示例代码http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html#Interactive_Samples首先我需要对用户进行身份验证才能访问 gmail id,我使用了这个代码

var contactsService;

function setupContactsService() {
  contactsService = new google.gdata.contacts.ContactsService('exampleCo-exampleApp-1.0');
}

function logMeIn() {
  var scope = 'https://www.google.com/m8/feeds';
  var token = google.accounts.user.login(scope);
}

function initFunc() {
  setupContactsService();
  logMeIn();
  getMyContacts();
}

但问题是当我单击授予访问按钮时,我能够看到谷歌身份验证页面,我被重定向到相同的身份验证页面,尽管我包括创建联系人 function 并在点击时调用。 我无法弄清楚如何进一步进行并将联系方式动态发送到 gmail。

请帮帮我

The solution for this problem what I followed was I created a iFrame and adding all the javascript and HTML inside that iframe and place that iframe in the mail page.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM