Code Monkey home page Code Monkey logo

amgcalendarmanager's People

Contributors

albertmontserrat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amgcalendarmanager's Issues

How to save event with custom event Id?

I'm submitting same event title (Not all the time) but when trying to remove it, it's removing all those titles that are same content.

Is there any option to save a custom Event ID then I can iterate it for removing?

Thanks.

Event in another store after editing?

Hi, I love your calendar manager!
I had no issues until I'm trying to introduce events editing in my app.

When I create an event, everything is ok. Then when I change its recurrenceRules, it lands in another store or something, because later manager can't remove all events throwing error:

"NSInvalidArgumentException", "Attempt to remove an object that does not belong to this store."

0 CoreFoundation 0x0000000104af5d4b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010455721e objc_exception_throw + 48 2 EventKit 0x00000001056a0c22 __30-[EKEventStore _deleteObject:]_block_invoke + 0 3 EventKit 0x0000000105656657 -[EKPersistentObject _removeObjectCore:fromValues:relation:] + 544 4 EventKit 0x000000010565693c -[EKPersistentObject primitiveRemoveRelatedObject:forKey:] + 180 5 EventKit 0x0000000105681698 -[EKPersistentCalendarItem removeDetachedItem:] + 265 6 EventKit 0x000000010568178f -[EKPersistentCalendarItem deleteSelfAndDetached] + 224 7 EventKit 0x0000000105668c2f -[EKEvent _deleteWithSpan:error:] + 786 8 EventKit 0x000000010566a3a2 -[EKEvent removeWithSpan:error:] + 509 9 EventKit 0x000000010568f3da -[EKEventStore removeEvent:span:commit:error:] + 299 10 AMGCalendarManager 0x0000000101d3e3e9 _TFC18AMGCalendarManager18AMGCalendarManagerP33_72EF97C106556493E498DAB06AB2172B11deleteEventfT5eventCSo7EKEvent6commitSb_Sb + 153 11 AMGCalendarManager 0x0000000101d3c16f _TFFFC18AMGCalendarManager18AMGCalendarManager15removeAllEventsFT10completionGSqFGSqCSo7NSError_T___T_U_FSbT_U_FTGSqS1__GSqGSaCSo7EKEvent___T_ + 463 12 AMGCalendarManager 0x0000000101d3c2e3 _TTRXFo_oGSqCSo7NSError_oGSqGSaCSo7EKEvent____XFo_iTGSqS__GSqGSaS0_____iT__ + 35 13 AMGCalendarManager 0x0000000101d3f301 _TPA__TTRXFo_oGSqCSo7NSError_oGSqGSaCSo7EKEvent____XFo_iTGSqS__GSqGSaS0_____iT__ + 81 14 AMGCalendarManager 0x0000000101d3c9a3 _TFFC18AMGCalendarManager18AMGCalendarManager12getAllEventsFT10completionGSqFTGSqCSo7NSError_GSqGSaCSo7EKEvent___T___T_U_FSbT_ + 1411 15 AMGCalendarManager 0x0000000101d39ca9 _TFC18AMGCalendarManager18AMGCalendarManager20requestAuthorizationfT10completionFSbT__T_ + 393 16 AMGCalendarManager 0x0000000101d3c3f6 _TFC18AMGCalendarManager18AMGCalendarManager12getAllEventsfT10completionGSqFTGSqCSo7NSError_GSqGSaCSo7EKEvent___T___T_ + 262 17 AMGCalendarManager 0x0000000101d3bf57 _TFFC18AMGCalendarManager18AMGCalendarManager15removeAllEventsFT10completionGSqFGSqCSo7NSError_T___T_U_FSbT_ + 423 18 AMGCalendarManager 0x0000000101d39ca9 _TFC18AMGCalendarManager18AMGCalendarManager20requestAuthorizationfT10completionFSbT__T_ + 393 19 AMGCalendarManager 0x0000000101d3bd66 _TFC18AMGCalendarManager18AMGCalendarManager15removeAllEventsfT10completionGSqFGSqCSo7NSError_T___T_ + 262

This is my code

func changeRepeatEndDate(_ eventId: String, endRepeat: Date, completion: (() -> ())?) {
    
    AMGCalendarManager.shared.getEvent(eventId: eventId) { (error, event) in
        if let event = event {
            
            if let recurrenceRules = event.recurrenceRules, recurrenceRules.count > 0 {
                for rule in recurrenceRules {
                    rule.recurrenceEnd = EKRecurrenceEnd(end: endRepeat)
                }
                self.calendarManager.saveEvent(event: event, completion: { (error) in
                    if let error = error {
                        fatalError("Error during saving an Event with ID \(eventId) - \(error.localizedDescription)")
                    } else {
                        completion?()
                    }
                })
            }
            
        } else {
            if let error = error {
                fatalError("Error during getting an Event with ID \(eventId) - \(error.localizedDescription)")
            } else {
                fatalError("No event in the store")
            }
        }
    }
}

AMGCalendarManager.shared.removeAllEvents()

addRecurrenceRule fail

HI. I have a problem。when I used the manager add Recurrence rule to Event. I get a issues. that can't
add event to the calendar.

let rule = EKRecurrenceRule.init(recurrenceWith: .daily, interval: 1, end: nil) event.addRecurrenceRule(rule)

that is debug info: Error Domain=CalendarError Code=999 "Unknown Error" UserInfo={NSLocalizedDescription=Unknown Error, NSLocalizedFailureReason=An unknown error ocurred while trying to sync your calendar. Syncing will be turned off.}

is everyone has this issues?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.