使用联系人 javascript api 将联系人与谷歌联系人同步
您好,我有一个门户网站,人们会在那里分享电子邮件 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();
}
,但问题是,当我单击“授予访问权限”按钮时,我能够看到 google 身份验证页面,尽管我包含了创建联系人,但我仍被重定向到相同的身份验证页面函数并在单击时调用。我无法弄清楚如何进一步进行并将联系方式动态发送到 gmail。
请帮助我
Hello I have a web portal and people would share there email id's. I would to add the sync with google contacts. I am using javascript api for that, but facing lot of problems. I tried the example code provided by google http://code.google.com/apis/contacts/docs/1.0/developers_guide_js.html#Interactive_Samples
First I need to authenticate users to access there gmail id, i used this code
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();
}
But the problem is I am able to see the google authentication page when I click on the grant access button,I am redirected to same authentication page though I included create contact function and called on click. I am not able to figure how to proceed further and send contact details dynamically to gmail.
Kindly help me out
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遵循的这个问题的解决方案是创建一个 iFrame 并在该 iframe 中添加所有 javascript 和 HTML,并将该 iframe 放置在邮件页面中。
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.