目录

About This Kit

Calendar Kit provides calendar and event management capabilities, which usually refer to APIs that can be used to access and operate calendar data. These APIs allow you to integrate time-related event services (such as travel, catering, sports, and entertainment) in other applications with the system calendar to implement functions such as event management, creation, and query.

Available Capabilities

Calendar Kit provides management capability for accounts and events.

Features

One-tap event service: Through a persistent authorization mechanism, you can write a service DeepLink to a calendar event after the user grants the application permission to read and write the system calendar. Based on the configured reminder rules, a corresponding service button is displayed in the calendar application, calendar notifications, calendar widgets, and other entry points when the event is approaching or due. Users can tap this button to open the DeepLink and go directly to the target service page.

Working Principles

Calendar Kit provides a set of APIs for obtaining calendar accounts, and writing calendar events to or reading events from the obtained accounts. If an event has a reminder time set, the system sends a reminder to the user when the set time arrives.

Constraints

The operations supported after the corresponding permissions are granted are listed in the following table.

Requested Permission Supported Calendar Account Operation Supported Event Operation
ohos.permission.READ_CALENDAR

- Read the system default calendar account.

- Read calendar accounts created by the current application.

- Read events created by the current application under the system default calendar account.

- Read events created by the current application under calendar accounts created by the current application.

ohos.permission.WRITE_CALENDAR - Add, delete, or modify calendar accounts created by the current application.

- Add, delete, or modify events created by the current application under the system default calendar account.

- Add, delete, or modify events created by the current application under calendar accounts created by the current application.

ohos.permission.READ_WHOLE_CALENDAR - Read all calendar accounts. - Read events created by all applications.
ohos.permission.WRITE_WHOLE_CALENDAR - Add, delete, or modify all calendar accounts. - Add, delete, or modify events created by all applications.

Supported Countries/Regions

Currently, this kit is available only in the Chinese mainland.

Emulator Support

This kit is supported on the Emulator.

There are some general differences between the Emulator and real devices. For details, please refer to Differences Between the Emulator and the Real Device.