Reputation: 424
I have searched quite a bit, but all results I find deal with calendar apps, how to register apps as ics file handlers, etc.
Instead, the problem I have is the following: We have a list of events on our page. We use PHP to dynamically create an *.ics file for each event, so that it can be directly imported into the user's calendar software. This works well with Outlook and on iOS (download prompt on PC so I can open in Outlook, iPhone displays a file symbol and name and gives me an "open in calendar" option), but when I click the link from an Android device (Galaxy S3), the browser just displays the .ics file as raw text, instead of opening it in a calendar or at least letting me download it.
Is there any way to make the browser open the file in the user's calendar or at least download it, so that the user 1) doesn't see ugly text and 2) can import the file using some app of his own? Or is there maybe a different file format that I could use or any other way, so that similar functionality can be achieved?
Requiring the users to change some settings or use this or that app is not really an option, so it would be nice if there was a way to trigger such behaviour just using a link.
Edit: Or, now that I think about it - is there even a standard format that would work across all (or at least most) Android devices? They don't share any standard inbuilt calendar as far as I know, do they?
Update: I have now managed to make it download the file: had an error in my header information (text/x-vCalendar instead of the correct text/calendar), that PC browser and iOS don't seem to notice, but Android did). I then had some parsing error, but that seems to come from empty lines that sometimes got into the files.
Upvotes: 3
Views: 3842
Reputation: 424
Sorry, already got everything working. It was a mixture of my own stupidity and Android being a lot stricter than the other systems.
I have now managed to make it download the file: had an error in my header information (Content type text/x-vCalendar
instead of the correct text/calendar
), that PC browser and iOS don't seem to notice, but Android did). I then had some parsing error, but that seems to come from empty lines that sometimes got into the files, which neither of the other two systems complained about, so nobody noticed that.
Upvotes: 4