I am developing a web app to manage events using the Blazor server-side framework. One of the requirements is a button that allows the users to add events to a calendar of choice, mainly google calendar, outlook calendar, and the local calendar of the device they are using. I managed the google and outlook calendars using tag with the appropriate links and parameters, now the last thing I want is to have a button that when clicked opens the default calendar app and displays the event info. I managed to convert the event model into an appropriate icalendar standard format file, but couldn't figure out how to open the calendar app and send it the event file.
Asked
Active
Viewed 274 times
0
-
Hi Ahmed can you please post some source code? Ideally a minimally reproducible example would be great. https://stackoverflow.com/help/minimal-reproducible-example – Jason D Apr 12 '22 at 18:44
-
1You don't; blazor is a web based technology - you simply don't have the necessary access to trigger the opening of apps on the client machine, you can only offer it for download and let the user choose whether to open it or not – Caius Jard Apr 12 '22 at 19:01
-
@CaiusJard I'm not certain that is true. From HTML5 you can you use something like described here: https://stackoverflow.com/questions/7700530/how-to-add-an-entry-in-the-android-calendar-from-an-html5-mobile-web-page – Paul Sinnema Apr 12 '22 at 20:15
-
Given your design requirements, you should consider building a native app that has the needed permissions and libraries. Blazor, even as a PWA, runs with limited device permission. Have a look a [Xamarin](https://dotnet.microsoft.com/en-us/apps/xamarin), which is just one of many possible alternatives. – Yogi Apr 12 '22 at 22:05
-
You can sort of trigger opening an app by the default behaviour when downloading a particular file extension. – Brian Parker Apr 13 '22 at 01:32
-
Please provide enough code so others can better understand or reproduce the problem. – Community Apr 13 '22 at 07:49
-
@BrianParker I guess this is the way to go, I will try to see if there are some javascript methods that tell the system to open a file once it is downloaded. – aRt_bitw Apr 13 '22 at 12:26
-
@Yogi I am limited to the use of Blazor, so right now I am considering invoking javascript code from Blazor to approach the problem. – aRt_bitw Apr 13 '22 at 12:29