Calendar/Dates synchronization. Research of implementation options.
Acceptance criteria:
The mobile application must be able to sync course events with the phone's calendar.
Any changes to the event dates in the course should be automatically reflected in the phone's calendar.
The synchronization of events should ideally continue even if the user signs out or uninstalls the application, through a webCal subscription.
The app should offer an intuitive and user-friendly interface for managing calendar synchronization settings.
The app should not share or use calendar data for any purpose other than synchronization.
Researched mobile applications:
edx.org. Calendar feature
Coursera. Calendar feature
Udemy. Calendar feature
Khan Academy. Calendar feature
1. Manual synchronization (Coursera flow).
Flow:
A user initiates the process by pressing the sync button.
An iCal file with the course dates is created by the API.
The application requests the system to launch the URL linked to the generated iCal file.
The system identifies the file type and navigates the user to the calendar app.
The calendar app adds events from the .ics file to the user's calendar.
Pros:
- Compatible with both iOS and Android.
- Implementation is straightforward and quick.
Cons:
- If the course date is changed, the old events are saved in the calendar.
2. Subscription to the interactive events calendar (webcal).
Flow:
A user initiates the process by pressing the sync button.
API generates a webcal:// URL that leads to the iCal file.
The application requests the system to launch the URL with webcal:// schema linked to the generated iCal file.
The system identifies the file type and navigates the user to the calendar app.
The calendar app subscribes to the calendar and shows it events.
Pros:
- The server manages the dates and web calendar, ensuring that users always have access to the most recent events, even if they log out from the app.
- User can configure calendar color and easily hide/delete all events or unsubscribe.
Cons:
- Android OS doesn’t support webcal:// schema and ignores all URL
3. Android workaround.
Subscription to the interactive events calendar via deep link to the calendar app (webcal).
Flow:
A user initiates the process by pressing the sync button.
API generates a webcal:// URL that leads to the iCal file.
The application checks what calendar apps are installed on the user’s phone and builds a deep link URL to the calendar app. (https://calendar.google.com/calendar?cid=WEBCALURL)
The system navigates the user to the calendar app.
The calendar app subscribes to the calendar and shows it events.
Cons:
- Android displays a success message, but in reality, it doesn't subscribe to the calendar.
4. Android workaround.
Subscription to the interactive events calendar through the calendar website (webcal).
Flow:
A user initiates the process by pressing the sync button.
API generates a webcal:// URL that leads to the iCal file.
The application checks what calendar apps are installed on the user’s phone and builds a link URL to the calendar site. (https://calendar.google.com/calendar/u/0/r?cid=WEBCALURL)
The system navigates the user to the web browser.
A user subscribes to the calendar on the website.
Cons:
The web calendar doesn't automatically integrate with the user's calendar app.
Users must manually go to settings and enable synchronization to view events in their calendar.
It works, but it's not user-friendly.
5. Synchronization via mobile OS calendar APIs.
EventKit | Apple Developer Documentation
https://developer.android.com/guide/topics/providers/calendar-provider
Flow:
A user initiates the process by pressing the sync button.
The app fetches course dates from the API.
The app generates a calendar using the course name within the phone's system calendar app and populates this newly created calendar with course dates as events with reminders.
Subsequently, the app saves the calendar and event IDs in the database for potential future updates as needed.The app periodically verifies course dates and updates the events in the calendar as necessary.
Pros:
- Compatible with both iOS and Android.
- User can configure calendar color and easily hide/delete all events or unsubscribe.
Cons:
If the user logs out or deletes the application, the synchronization of events stops.