Does anyone know how to retrieve an image from SharePoint Online - Office 365 into an iOS app?

The image logo has the following returned format: https://"TENANT".sharepoint.com/"SITE NAME"/SiteAssets/domain1.png

I've implemented a custom Web API to retrieve the site collections. A specific site might have a logo and from my iOS app I could get its url after calling the service.

The problem is that I receive 401 or 403 for getting the image no matter if I pass or not the obtained token for the Web Api call as an authorisation header.

SDWebImageDownloader *manager = [SDWebImageManager sharedManager].imageDownloader;
[manager setValue:authHeader forHTTPHeaderField:@"Authorization"];

[logo sd_setImageWithURL:[NSURL URLWithString:site.logo] placeholderImage:[UIImage imageNamed:@"cross"] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        NSLog(@"Error: %@", error);

Error: Error Domain=NSURLErrorDomain Code=401 "The operation couldn’t be completed. (NSURLErrorDomain error 401.)"

Also my logs contains the following info: Access denied. Before opening files in this location.

  • Is "Display images" option in safari enabled? – 404 Jan 20 '15 at 10:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.