0

I have a volunteering app that I made in Unity. When someone signs up for a volunteer event, I want to show them a confirmation page that lets them add the event to the calendar of their choice.

Google Calendar is easy because I can make a string for the URL, and use Application.OpenURL to take them out of my app and to the right link. From there they just need to (1) not touch anything AND (2) press OK and it's added to their calendar. (This is working fine!)

Microsoft Outlook and Apple Calendar are tougher, though. They use these ICS files. So I figured I would generate an ICS file and have them open it when they press the button, which should automatically take them to the correct calendar app on their phone. But it looks like Android and iOS don't allow Unity to use OpenURL to open local files on your phone anymore...

Has anyone solved this? What should I do?

TLDR: OpenURL works for Google Calendar links to the Internet, but not for local files.

  • Are you requesting permission for file system access? – Jay Nov 15 '22 at 01:20
  • [`Application.OpenURL`](https://docs.unity3d.com/ScriptReference/Application.OpenURL.html) -> `Android: Due to security changes in Android 7.0 (More information), Application.OpenURL can no longer be used for opening local app files, you need to use https://developer.android.com/reference/androidx/core/content/FileProvider which allows you to share files with other applications. iOS: Application.OpenURL cannot be used for opening local files.` – derHugo Nov 15 '22 at 07:43
  • @Jay I guess not, not sure how to do that. In this situation, am I supposed to generate an ICS file somewhere within Unity and then ask for file system access to open it? I don't suppose there's a way to link to these calendars via web URLs instead of local files URLs instead? That might be easier... – Game Revenant Nov 15 '22 at 16:12
  • Thanks @derHugo - I did see that in the documentation, which is why I'm seeking any workarounds that have worked for people. – Game Revenant Nov 15 '22 at 16:13

0 Answers0