Open Event Web app allows organizers to add a feature which enables the users to add any session to their google calendar. The organizer is required to generate an API key and client ID on Google developers console and add the generated credentials to web app generator. The credentials are added to the generated application and every session is added with an Add to calendar button, which on click makes the request to add the corresponding session to the calendar.
Creating Client ID and API key
Adding Client ID and API key to the generator
The Client ID and API key obtained from the developer console is added to the web app generator. The event generated uses these credentials to make a request to the server for adding any session to the calendar.
The added credentials are used to initialise the client in the procedure `initClient()` –
Adding session to the Google calendar
Every Google calendar enabled event is provided a button with every session, so that corresponding session can be added to the calendar. A procedure named `handleAuthClick` is called with the details of session being passed as parameter when the user clicks on the button. This function handles the authentication required for adding session to the calendar.
A function named `listUpcomingEvents` makes the request to insert the event object with details of the session to the calendar.
When the session with the corresponding data is added to calendar, an alert box notifying successful addition of session is shown up on the screen.
- Open Event Webapp Repository: https://github.com/fossasia/open-event-webapp
- Pull Request: https://github.com/fossasia/open-event-webapp/pull/1967
- Issue: https://github.com/fossasia/open-event-webapp/issues/1513
- Additional Resources: https://developers.google.com/calendar/quickstart/js, https://developers.google.com/calendar/