Closed MIchaelMainer closed 9 years ago
Good day, I have same issue, it is actually returning data but parser crashes with exception.
Workaround for me was to return data as raw and parse myself.
Here is fast example: [[BaseController alloc] getClient:^(MSOutlookClient client) { NSURLSessionTask task = [[[client getMe] getContacts ] readRaw:^(NSString contact, NSError error) {
if(error == nil){
dispatch_async(dispatch_get_main_queue(),
^{
NSArray * jsonArray = [NSJSONSerialization JSONObjectWithData:[contact dataUsingEncoding:NSUTF8StringEncoding] options: NSJSONReadingMutableContainers error:nil];
NSArray *jsonResult;
jsonResult = [jsonArray valueForKey:@"value"];
});
}
mikolalv123, Thank you! I need to update my pods so I can use that. Great find!
Code to get contacts (contacts NSArray is empty):
Response
{ "@odata.context": "https://outlook.office365.com/api/v1.0/$metadata#Me/Contacts", "value": [{ "@odata.id": "https://outlook.office365.com/api/v1.0/Users('systemadmin@XXXXX.onmicrosoft.com')/Contacts('AAMkADg5ZDhjZTYC7AAA=')", "@odata.etag": "W/\"EQAARp1VTV+24eiEAAATULRr\"", "Id": "A7AAA=", "ChangeKey": "EQAAATULRr", "Categories": [], "DateTimeCreated": "2015-02-05T07:17:29Z", "DateTimeLastModified": "2015-02-05T07:17:29Z", "ParentFolderId": "AAMOAAA=", "Birthday": null, "FileAs": "", "DisplayName": "John Brown", "GivenName": "John", "Initials": null, "MiddleName": null, "NickName": null, "Surname": "Brown", "Title": null, "Generation": null, "EmailAddresses": [null, null, null], "ImAddresses": [null, null, null], "JobTitle": null, "CompanyName": null, "Department": null, "OfficeLocation": null, "Profession": null, "BusinessHomePage": null, "AssistantName": null, "Manager": null, "HomePhones": [null, null], "BusinessPhones": [null, null], "MobilePhone1": "4255551212", "HomeAddress": { "Street": null, "City": null, "State": null, "CountryOrRegion": null, "PostalCode": null }, "BusinessAddress": { "Street": null, "City": null, "State": null, "CountryOrRegion": null, "PostalCode": null }, "OtherAddress": { "Street": null, "City": null, "State": null, "CountryOrRegion": null, "PostalCode": null }, "YomiCompanyName": null, "YomiGivenName": null, "YomiSurname": null }
This result is not accessible in the object model. The contacts array is empty.