为何Google Calendar API接收会议参数却不生成会议链接?
问题:调用Google Calendar API创建含Hangouts Meet的日程未生成会议链接
我用React Native开发,已通过Google Authentication完成授权,调用Google Calendar API创建包含Hangouts Meet会议的日程时,请求体已携带conferenceData、conferenceDataVersion等会议相关参数,但返回的日程数据里没有生成会议链接。
授权相关代码
const configureGoogleSingin = async () => { GoogleSignin.configure({ androidClientId: 'some-id', scopes: ['https://www.googleapis.com/auth/calendar'], }); }; const continueWithGoogle = async () => { GoogleSignin.hasPlayServices() .then(hasPlayService => { if (hasPlayService) { GoogleSignin.signIn() .then(userInfo => { // console.log(userInfo); checkAuthenticationOnBE(userInfo.user); }) .catch(e => { console.log('ERROR IS: ' + JSON.stringify(e)); }); } }) .catch(e => { console.log('ERROR IS: ' + JSON.stringify(e)); }); };
日程创建代码
const conferenceData = { // 'allowedConferenceSolutionTypes': ['hangoutsMeet'], 'createRequest': { 'requestId': `meet-${Math.random().toString(36).substring(7)}`, 'conferenceSolutionKey': { 'type': 'hangoutsMeet', }, }, }; const event = { 'summary': 'ShopOnLive Meeting', 'description': "I want to buy something.", 'start': { 'dateTime': meetDateTime.toISOString(), 'timeZone': Intl.DateTimeFormat().resolvedOptions().timeZone // current timeZone }, 'end': { 'dateTime': moment(meetDateTime).add(40, 'minutes').toISOString(), 'timeZone': Intl.DateTimeFormat().resolvedOptions().timeZone // current timeZone }, 'conferenceDataVersion': 1, 'conferenceData': conferenceData, 'organizer': { 'email': 'sumit@shoponline.in', }, "attendees": [ // { // "email": shop.user.email, // "displayName": "Store Owner", // "organizer": false, // "self": true, // }, // { // "email": userEmail, // "displayName": "Client", // "organizer": false, // "self": true, // }, ], } console.log(event); if(!provider_token){ showToaster("ERROR: Please Logout and Login again."); } let eventData = null; await googleEventCreaterAPI(JSON.stringify(event), provider_token).then(async res=>{ console.log(res.data); eventData = res.data; }).catch(err=>console.log(err));
请求体日志
{ "summary": "ShopOnLive Meeting", "description": "I want to buy something.", "start": { "dateTime": "2023-04-21T14:33:00.000Z", "timeZone": "Asia/Calcutta" }, "end": { "dateTime": "2023-04-21T15:13:00.000Z", "timeZone": "Asia/Calcutta" }, "conferenceDataVersion": 1, "conferenceData": { "createRequest": { "requestId": "meet-dk8ncv", "conferenceSolutionKey": { "type": "hangoutsMeet" } } }, "organizer": { "email": "sumit@shoponline.in" }, "attendees": [] }
返回结果日志
{ "kind": "calendar#event", "etag": "\"3364017758736000\"", "id": "q7blnj6j4b4rjvrfu051ssgen4", "status": "confirmed", "htmlLink": "https://www.google.com/calendar/event?eid=cTdibG5qNmo0YjRyanZyZnUwNTFzc2dlbjQgc3VtaXRAc2hvcG9ubGl2ZS5pbg", "created": "2023-04-20T16:41:19.000Z", "updated": "2023-04-20T16:41:19.368Z", "summary": "ShopOnLive Meeting", "description": "I want to buy something.", "creator": { "email": "sumit@shoponlive.in", "self": true }, "organizer": { "email": "sumit@shoponlive.in", "self": true }, "start": { "dateTime": "2023-04-21T20:03:00+05:30", "timeZone": "Asia/Kolkata" }, "end": { "dateTime": "2023-04-21T20:43:00+05:30", "timeZone": "Asia/Kolkata" }, "iCalUID": "q7blnj6j4b4rjvrfu051ssgen4@google.com", "sequence": 0, "reminders": { "useDefault": true }, "eventType": "default" }
已尝试的排查方向
- 查阅过官方问题追踪及技术问答社区的类似问题,但未解决。
内容的提问来源于stack exchange,提问作者Sumit Dhakad
相关产品推荐
相关产品推荐

