Home > front end >  How to open device's calendar app to add an event from React Native application?
How to open device's calendar app to add an event from React Native application?

Time:06-07

I make fetching data from API, whose results look like this

Object {
  "name": "HackForGood: Grab Hackathon 2022",
  "site": "HackerEarth",
  "start_time": "2022-05-29T18:30:00.000Z",
  "url": "https://grabhackforgood.hackerearth.com/",
}
Object {
  "name": "Microsoft Virtual Hackathon 2022",
  "site": "HackerEarth",
  "start_time": "2022-05-31T16:00:00.000Z",
  "url": "https://www.hackerearth.com/challenges/hackathon/microsoft-virtual-hackathon-2022/",
}

The data is shown inside a Flatlist. I want to implement a feature, where if we click on an flatlist item, it will open up the add event screen inside our phone's calendar app (like google calendar), setting an event on day and time fetched from start_time and event name as name. If the user clicks save, it will save the event.

(I have looked into https://github.com/vonovak/react-native-add-calendar-event but not sure it will work, since the author doesn't maintain the package anymore)

How to approach this problem?

CodePudding user response:

I think calendar-link (still maintained) using the ICS format might work? Otherwise, I'd recommend still giving react-native-add-calendar-event a try

  • Related