Skip to content

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

@sperochon

Description

@sperochon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions