Calendar Kit provides one-tap services for calendar events, such as joining a meeting, watching a TV series, shopping, and viewing content. After a one-tap service is registered for a calendar event, users can tap the corresponding button to open the configured link and directly access the service page.
To use one-tap services for calendar events, complete the registration as follows:
Go to the Developer Management Center and sign in with an enterprise account. Personal developer accounts are not supported currently. No additional permissions need to be manually granted to the primary enterprise account. If you use a team member account, use the primary enterprise account to grant it the administrator permission for Celia Open Platform, as shown below.
Select the team member account, click Edit, and grant the required permission to the account.
Confirm the information and click Next.
Select the Celia Open Platform administrator and click Next.
After the login is successful, choose smart service under Ecosystem services in the sidebar and click Celia Open Platform.
On the displayed page, click Resource Management on the right and click Other Services.
On the displayed page, click Create Service on the right.
Select a service model.
Select Custom Model, set Service Name, Service Category, and Default Language, and click Create.
Service Name: The service name can be customized. You are advised to use the combination of the app name and the name of the one-tap calendar service.
Service Category: Select a service category based on the actual service type.
Default Language: Set this parameter based on the service.
After the service is created, set Basic Information and click Save.
Service Category: Select Tools or Calendar.
The Service Version and Version Description can be customized by developers. The platform review does not follow this information.
Service Level: Set this parameter based on the service.
Set Service Display Information and click Save.
The mandatory fields on this page are configured by developers based on the service. You are advised to upload a UI schematic diagram in the service preview area.
Go to the Configuration page and click Add User Intent.
Configure an intent.
Set the implementation type of the intent, select APK/RPK/FA/H5 link, click Add Implementation, and click Configure.
On the page for adding an implementation, set Basic Information and configuration method, and click Save.
Enter basic information. The implementation name is defined by the developer based on the service. You are advised to name it in the format of "App name + One-tap service type".
Select the configuration method and select HAP LINK.
Enter the correct App name (if no matching item is displayed in the drop-down list, you can directly enter the name) and App package name.
Enter the redirection link, that is, the landing page that is displayed when a user taps the one-tap service button in the system calendar. Do not enable the Redirection parameters switch.
The redirection link is a link template. The URI entered in the EventService must comply with this template. For example, if the redirection link is demo://mobile/player?params=, the corresponding URI is demo://mobile/player?params=AAAABBBBCCCCDDDD. The part before the equal sign (=) is strongly verified, and the part after the equal sign (=) can be customized by the service party as required.
Other mandatory fields are configured by developers based on service requirements.
After all the preceding configurations are complete, switch to the Release module, click Release, and wait for the background to review the intent. After the review is complete, the intent is released.
If the service has been released, you can adjust the service again by following the preceding steps. After the modification is complete, click Upgrade.
After the one-tap service is successfully registered, the system calendar redirection link is configured (the corresponding function button can be displayed on the system calendar page). To implement the one-tap service experience, you need to perform related configurations on the client.
configure the obfuscation scripts as follows:
In the module.json5 file, configure related fields.
The "exported" field must be set to true.
Configure the actions field in skills. The actions field indicates the set of action values that can be received. The value is usually a predefined action value in the system, but can also be customized. The actions field cannot be empty. If it is empty, the target party matching will fail. For details about common action values, see Action Constant Description.
Finally, you need to configure the "uris" field, which must match the link template used during registration.
For example, if the URI template link entered during server registration is "demo://mobile/player?params=", the content before the equal sign (=) is forcibly verified, and the content after the equal sign (=) is the list of parameters required by the service. You can specify the parameters based on the actual service requirements when using the calendar service to write a schedule. The parameter list cannot directly contain the equal sign (=) or ampersand (&). You are advised to use decodeURI() or encodeURI() to convert the characters.
{
"module": {
"name": "xxx",
"type": "xxx",
// ...
"abilities": [
{
"name": "xxxxxxx",
// ...
"exported": true,
"skills": [
{
// ...
"actions": [
"ohos.want.action.viewData"
],
"uris": [
{
"scheme":"demo",
"host":"mobile",
"pathStartWith": "player"
}
],
}
]
}
],
}
} The want object in the onCreate and onNewWant APIs of the launched landing page EntryAbility contains the corresponding launch information. You can implement the redirection logic using the corresponding parameters.
Call the addEvent API to add event data. Then, you can see an event with the one-tap service button in the calendar. Tap the button to go to the corresponding landing page.
For a common schedule (EventType.NORMAL), the one-touch service button can be displayed. However, for an important schedule (EventType.IMPORTANT), the one-touch service button cannot be displayed even if the configuration is correct due to restrictions on the data structure and product specifications.
The button will be displayed only after the consumer device is connected to the Internet and downloads the corresponding protocol, and the schedule is written by the developer.
The one-touch service button is always displayed in the schedule details, and displayed in the monthly view and on the home screen widget 15 minutes before the schedule starts.
After the service agreement registered on the server is released and approved, the function takes effect after the device is restored to factory settings or after 00:00 on the current day.
Ensure that the link template configured on the server, Event.Service.uri specified by the third-party app on the device, and the "uris" field in module.json5 match each other.