OfficeDev / Office-365-SDK-for-iOS

Microsoft Services SDKs for iOS Preview produced by MS Open Tech.
https://dev.office.com/
Other
96 stars 49 forks source link

Calendar addEvent API doesn't populate the returned object with the newly created event's ID and other details #51

Closed umasubra closed 9 years ago

umasubra commented 9 years ago

The Calendar addEvent API doesn't populate the returned event with the newly created object details such as the ID, Subject, etc. The returned object is always empty. Because of this, there's no way to get the newly created event object and perform an update or delete operation. If this is a bug in the API or in our code?

//Updates an existing calendar event. -(BOOL)updateEvent { MSOutlookEvent event = [selfgetSampleEvent]; //Get event [[BaseControlleralloc]getMailClient:^(MSOutlookClient *client) { NSURLSessionDataTask task = [[[client getMe] getEvents] addEvent:event withCallback:^(MSOutlookEvent addedEvent, MSODataException error) {

        NSString *updatedSubject = [@"Updated"stringByAppendingString:event.Subject];
        [event setSubject:updatedSubject];
        // Update Event
        [[[[[client getMe] getEvents] getById:addedEvent.Id]updateEvent:event withCallback:^(MSOutlookEvent *updatedEvent, MSODataException *error) {

            if(error == nil && updatedEvent != nil && [updatedEvent.SubjectisEqualToString:updatedSubject]){

                dispatch_async(dispatch_get_main_queue(),
                               ^{
                                   self.output_txt.text = @"Successfully updated an existing calendar event.";
                               });
            }

        }] resume];
    }];

    [task resume];

}];

return TRUE;

}

Could you please tell us if we're doing anything wrong? How can we get a hold of the newly created object?

Thanks, Uma