Granit
Granit

Reputation: 1281

iOS FlickrKit: err code="95" msg="SSL is required"

I am developing a photo sharing application on iOS that shares pictures on various social networks including Flickr. In order to authorise the app and to upload photos on a Flickr photo-stream I use FlickrKit.

After successfully authorising the app I try to post the selected picture with the following code:

UIImage *img = self.itemsToShare[currentItem];

    NSDictionary *uploadArgs = @{@"title": @"Test Photo", @"description": @"A Test Photo via FlickrKitDemo", @"is_public": @"0", @"is_friend": @"0", @"is_family": @"0", @"hidden": @"2"};

    self.uploadOp = [[FlickrKit sharedFlickrKit] uploadImage:img args:uploadArgs completion:^(NSString *imageID, NSError *error) {
        dispatch_async(dispatch_get_main_queue(), ^{
            if (error) {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
                [alert show];
            } else {
                NSString *msg = [NSString stringWithFormat:@"Uploaded image ID %@", imageID];
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Done" message:msg delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
                [alert show];
            }

        });
    }]; 

My problem is that the following error occurs:

2014-07-02 10:16:23.710 myApp[805:3507] <?xml version="1.0" encoding="utf-8" ?>
<rsp stat="fail">
    <err code="95" msg="SSL is required" />
</rsp>

Does anyone have an idea where do I set an SSL connection for FlickrKit?

Thank you very much,

Granit

Upvotes: 2

Views: 1099

Answers (3)

Bijendra Singh
Bijendra Singh

Reputation: 647

Simply you need to replace http to https in flickr API, due to secure connection issue.

Upvotes: 0

K_G
K_G

Reputation: 2901

all you need to update is the URL, from HTTP to HTTPS:

https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=.............&photoset_id=...............&format=rest

worked for me!

Upvotes: 1

Granit
Granit

Reputation: 1281

During my research I saw that the Flickr API is now SSL-Only form June 27th 2014. The fix is to change upload URL in FKImageUploadNetworkOperation.m file to:

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://up.flickr.com/services/upload/"]];
    [request setHTTPMethod:@"POST"];

Upvotes: 4

Related Questions