2

I have integrated Google Calendar API and able to create meetings properly. Since google also allows for creation of Google Meet conferences through Google Calendar API - I have been trying to access the ConferenceData object throught the event object from the Calendar API. ConferenceData as such is being referenced everywhere on StackOverflow but am unable to connect it to a library on Android Studio - am building the app in Kotlin so a java/kotlin solution works.

below is the code I am using

            val event = Event().setSummary("Event")
                .setDescription(eventDes.toString())

            val _startTime = createCal(booking)
            val startEvent = EventDateTime()
                .setDateTime(DateTime(_startTime.time))

            //add duration to start date to get end date
            _startTime.add(Calendar.MINUTE, booking.getduration()!!.toInt())
            val endEvent = EventDateTime()
                .setDateTime(DateTime(_startTime.time))

            event.start = startEvent
            event.end = endEvent
            event.location = ""


            val map = HashMap<String, String>()
            map["priority"] = "High"
            event.extendedProperties = Event.ExtendedProperties()
            event.extendedProperties.private = map

Can anybody guide as to the right way to access and use the ConferenceData object for Google Meet? ConferenceData is currently unrecognized...

Any inputs will be great

Thanks

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
madhall
  • 162
  • 1
  • 13

2 Answers2

0

I did this a while back I had two issues the first being the conference type.

I had this same issue a while back. Do a calendar.get and make sure that you are setting the same to one of the allowedConferenceSolutionTypes.

{
 "kind": "calendar#calendar",
 "etag": "\"di3Ml2Fd7A\"",
 "id": "ddddd@gmail.com",
 "summary": "Linda Lawton ",
 "description": "test",
 "timeZone": "Europe/Copenhagen",
 "conferenceProperties": {
  "allowedConferenceSolutionTypes": [
   "hangoutsMeet"
  ]
 }
}

The second issue is remember to set the setConferenceDataVersion to 1.

  Event event = new Event();

    event.setStart(new EventDateTime().setDateTime(new DateTime(currentTimeMillis())));
    event.setEnd(new EventDateTime().setDateTime(new DateTime(currentTimeMillis() + 10000000)));

    ConferenceData conferenceData = new ConferenceData();

    conferenceData.setCreateRequest(
            new CreateConferenceRequest()
                    .setConferenceSolutionKey(
                            new ConferenceSolutionKey()
                                    .setType("hangoutsMeet")));

    event.setConferenceData(conferenceData);
    service.events().insert("primary", event).setConferenceDataVersion(1).execute();
Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • Hi Dalmo, thanks for your input, but the issue I am facing is that I cant even access the conferenceData object - it is unrecognized and not part of the event obect in the library. I feel the google team needs to clear this properly - enables to create meet or not – madhall Mar 05 '22 at 18:11
  • 1
    if you cant see it then i would question wither or not you have the correct package its there [ConferenceData](https://developers.google.com/resources/api-libraries/documentation/calendar/v3/java/latest/com/google/api/services/calendar/model/ConferenceData.html) – Linda Lawton - DaImTo Mar 07 '22 at 07:49
  • Hi DalmTo, you were right, figured out there are two google calendar packages, please add your comment as an answer and I will accept it!! Thank you so much! // implementation 'com.google.apis:google-api-services-calendar:v3-rev119-1.19.1' implementation 'com.google.apis:google-api-services-calendar:v3-rev20211026-1.32.1' – madhall Mar 07 '22 at 13:48
0

Posting this for documentation purposes.

As mentioned by DaImTo, you have to import the package ConferenceData.

Iamblichus
  • 18,540
  • 2
  • 11
  • 27