iOS Development

android – Error Code 403 | Fetch Objects from iCloud Calendar by CalDAV | Flutter

I’m utilizing Flutter and Dart so as to fetch Objects from my iCloud calendar by CalDAV protocol. I’ve already created an app-specific-password for my Apple account, certainly i’m utilizing that password so as to login, i’m able to carry out appropriately each step contained in the “Retrieving calendar info” part as proven on this information, however i can not proceed and fetch the objects as i get the error code 403.

The 403 Forbidden error signifies that the server understands the
request however cannot present extra entry.

That is the code i’m at the moment utilizing. I’m not positive if i needed to embrace the c-tag contained in the request or not.

That is the official documentation of CalDAV.

Future<http.Response> fetchObjects() async {
  ultimate request = http.Request(

  request.headers['Authorization'] =
      'Fundamental ' + base64Encode(utf8.encode('$appleId:$password'));
  request.headers['Depth'] = '1';
  request.headers['Prefer'] = 'return-minimal';
  request.headers['Content-Type'] = 'utility/xml; charset=utf-8';

  ultimate physique=""'
    <c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
        <d:getetag />
        <c:calendar-data />
        <c:comp-filter title="VCALENDAR" />

  request.physique = physique;

  ultimate response = await request.ship();

  // Convert the StreamedResponse to a Response.
  ultimate convertedResponse = await;
  ultimate parsedResponse =
      http.Response.bytes(convertedResponse, response.statusCode);

  return parsedResponse;


Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button