Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saveCalendar doesnt appear in google calendar #450

Open
Shup04 opened this issue Jul 16, 2024 · 5 comments
Open

saveCalendar doesnt appear in google calendar #450

Shup04 opened this issue Jul 16, 2024 · 5 comments

Comments

@Shup04
Copy link

Shup04 commented Jul 16, 2024

when i call saveCalendar, it gets added and i can fetch it with fetchCalendars, i can add events to it and it works well. The calendar/events never show up in google calendar or any other app, despite it being synced. This calendar also gets deleted after some inactivity so when i go back to the app i have to remake all the events and calendar. Adding events to an existing calendar works fine.

Environment

using expo so 'react-native info' doesn't exist

Steps to Reproduce

  1. check/get calendar perms
  2. create calendar:

`const source = {
name: '[email protected]',
type: 'com.google',
isLocalAccount: false,
}

  if (!googleCalendar) {
    // Create a new calendar
    console.log("creating calendar...")
    const id = await RNCalendarEvents.saveCalendar({
      title: 'AquaFlora Reminders',
      color: 'blue',
      entityType: 'event',
      name: 'aquaflora',
      accessLevel: 'owner',
      ownerAccount: '[email protected]',
      source,
    });`
  1. sync google calendar
  2. nothing shows up

Expected Behavior

i expect the calendar i create to appear in google calendars and not to get deleted after a while

Actual Behavior

self explanatory

@Shup04
Copy link
Author

Shup04 commented Jul 17, 2024

got it somewhat fixed, its less than ideal but the calendar has to be set to local

@parthkanani93
Copy link

Same issue Please tell me solution if anyone has solved

@parthkanani93
Copy link

parthkanani93 commented Jul 18, 2024

const saveAllEventCalendar = events => {
ReactNativeCalendarEvents.requestPermissions().then(response => {
if (response === 'authorized')
try {
ReactNativeCalendarEvents.findCalendars().then(res => {
let phoneCalendars = res?.filter(c => c?.isPrimary)?.map(c => c?.id)

      const calendarId = phoneCalendars[0]

      const myCalendar = events
      myCalendar.forEach(cal => {
        let evtStartDate = moment(cal.start).toISOString()
        let evtEndDate = moment(cal.end).toISOString()

        ReactNativeCalendarEvents.saveEvent(
          cal?.label + ' ( ' + cal?.muhurta + ' ) ',
          {
            notes: cal?.short_description,
            startDate: evtStartDate,
            endDate: evtEndDate,
            description: cal?.long_description, // Only supported on Android
            calendarId: calendarId,
          },
          {
            sync: true,
          },
        )
      })
      Toast.show({
        type: 'successToast',
        text1: strings.allEventAddedSuccessfully,
        visibilityTime: 5000,
      })
    })
  } catch (error) {
    console.log('calendar error:', error)
  }

})
}

@Pathania777
Copy link

still not fixed

@Shup04
Copy link
Author

Shup04 commented Nov 4, 2024

still not fixed

Just use a local calendar, I never figured out what the issue was and this project doesn't seem to be maintained anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants