brave-browser icon indicating copy to clipboard operation
brave-browser copied to clipboard

Handle `data` scheme URLs for calendar invites

Open kylehickinson opened this issue 2 years ago • 2 comments

Description:

Some sites use data:text/calendar urls to handle calendar invites.

Brave currently does not support data URLs in general (brave/brave-ios#666) but to add to that, we currently handle calendar invites by presenting a SFSafariViewController to handle the load and present the appropriate UI. This is unfortunately not possible to handle with data URLs as SFSafariViewController only supports http/https schemes.

~One possible workaround is write the data in the URL (after the data:text/calendar prefix) to disk as a ics file and presenting it via QuickLook or the share sheet, at which point iOS may be able to show the appropriate flow for the calendar invite.~ This has been tested and does not work.

Another possible way would be to parse the actual invite and present an EKEventEditViewController. This will require a write-only permission prompt on iOS 16 and below, but on iOS 17 will be permission-free

kylehickinson avatar Nov 30 '23 18:11 kylehickinson

Just curious is NSContactsUsageDescription and NSCalendarsUsageDescription is not necessary on iOS17?

soner-yuksel avatar Dec 05 '23 16:12 soner-yuksel

We would only need NSCalendarsWriteOnlyAccessUsageDescription and it would only actually be used on iOS 15 & 16, the reason being that EKEventEditViewController runs in a separate process in iOS 17 and no longer requires a permission prompt. Described here: https://developer.apple.com/videos/play/wwdc2023/10052/?time=296

More info here: https://developer.apple.com/documentation/eventkit/accessing_the_event_store

kylehickinson avatar Dec 05 '23 17:12 kylehickinson