首页 > 解决方案 > 使用 Codeigniter 将完整日历中的数据发布到 Google 日历

问题描述

我正在使用构建应用程序codeigniter,现在我被困在一个地方。我已将其集成full calendar到运行良好的应用程序中。现在我需要像某人那样做一个insert an event on full calendar using my application事件automatically insert that event on google calendar also using google calendar API。我已经通过作曲家安装了谷歌客户端 api,但这也无济于事。我通过从谷歌日历为开发人员获取一个想法来制作一个功能,但它也给了我一个错误。请检查问题,我很感激任何帮助

这是我的控制器上的一个功能:

 function google_event(){
        $event = new Google_Service_Calendar_Event(array(
            'summary' => 'Google I/O 2015',
            'location' => '800 Howard St., San Francisco, CA 94103',
            'description' => 'A chance to hear more about Google\'s developer products.',
            'start' => array(
              'dateTime' => '2021-09-28T09:00:00-07:00',
              'timeZone' => 'America/Los_Angeles',
            ),
            'end' => array(
              'dateTime' => '2021-09-28T17:00:00-07:00',
              'timeZone' => 'America/Los_Angeles',
            ),
            'recurrence' => array(
              'RRULE:FREQ=DAILY;COUNT=2'
            ),
            'attendees' => array(
              array('email' => 'lpage@example.com'),
              array('email' => 'sbrin@example.com'),
            ),
            'reminders' => array(
              'useDefault' => FALSE,
              'overrides' => array(
                array('method' => 'email', 'minutes' => 24 * 60),
                array('method' => 'popup', 'minutes' => 10),
              ),
            ),
          ));
          
          $calendarId = 'cicuser3@gmail.com';
          $event = $service->events->insert($calendarId, $event);
          printf('Event created: %s\n', $event->htmlLink);
    }

错误图像

标签: phpgoogle-apigoogle-calendar-apigoogle-api-php-client

解决方案


推荐阅读