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

[iOS17] call to Add2Calendar.addEvent2Cal never returns #151

Open
sperochon opened this issue Dec 28, 2023 · 2 comments · May be fixed by #154
Open

[iOS17] call to Add2Calendar.addEvent2Cal never returns #151

sperochon opened this issue Dec 28, 2023 · 2 comments · May be fixed by #154

Comments

@sperochon
Copy link

Hello,

Using:
Flutter 3.16.5
add_2_calendar 3.0.1
Testing on iPhone with iOS 17
And compiling with Xcode 15 + sdk iOS 17

The issue is:
the call to addEvent2Cal never returns. It is stuck (= the second line return isNativeCalendarShown; is never executed)

final isNativeCalendarShown = await Add2Calendar.addEvent2Cal(event);
return isNativeCalendarShown;

After spending a few hours, I've finally found the cause of this bug which is only 1 missing line 🤯😭. The fix #136 forgot to call completion callback completion?(true) line 105 of file Add2CalendarPlugin.swift

if #available(iOS 17, *) {
    OperationQueue.main.addOperation {
        self.presentEventCalendarDetailModal(event: event, eventStore: eventStore)
    }
}

should be

if #available(iOS 17, *) {
    OperationQueue.main.addOperation {
        self.presentEventCalendarDetailModal(event: event, eventStore: eventStore)
    }
    completion?(true)
}

Thanks

@sperochon
Copy link
Author

It seems that the PR #150 will indirectly fix this issue too when it will be merged on master...

@vbuberen vbuberen linked a pull request Jan 31, 2024 that will close this issue
@michaeljajou
Copy link

Can we get this merged?

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

Successfully merging a pull request may close this issue.

2 participants