M
M
marcus2015-12-03 19:32:12
Objective-C
marcus, 2015-12-03 19:32:12

I can't share a picture in Odnoklassniki from the iOS SDK - what could be the problem?

I'm trying to create a media topic with uploading photos using https://github.com/apiok/ok-ios-sdk After all the steps according to the instructions, I get an error:


Error Domain=ru.ok.api Code=100 "Parameter 'PHOTO id' is invalid." UserInfo={NSLocalizedDescription=Parameter 'PHOTO id' is invalid.}
Printing description of error:
Error Domain = ru.ok.api Code = 104 "PARAM_SIGNATURE: Invalid signature c3f164cc964b2da672ce7abd6d4414ac, calculated by string application_key = CBAMFQBKEBABABABAformat = jsonmethod = photosV2.commitphotos = [{" token ":" E0A6me2OTb91jj3dO7cx4nieJ Xl2tLuE3ztTN1385 \ / yvFOxIRb3TGGEpfimt bxxXiT5 EoQhI6WHNN605Lrj2OwO4VrNf9bC \ / uFRxwRjsUk5KW4DZsrvqSCu9L oIo " ,"photo_id":"vCStVnlb6WgbZnL1TX3l 8 lymYglS4VpsSkx5IZsR\/Yd3WYqFW3yA=="}]********SECRET KEY*******" UserInfo={NSLocalizedDescription=PARAM_SIGNATURE : Invalid signature c3f164cc964b2da672ce7abd6d44414ac, calculated by string application_key = CBAMFQBKEBABABABAformat = jsonmethod = photosV2.commitphotos = [{ "token": "E0A6me2OTb91jj3dO7cx4nieJ Xl2tLuE3ztTN1385 \ / yvFOxIRb3TGGEpfimt bxxXiT5 EoQhI6WHNN605Lrj2OwO4VrNf9bC \ / uFRxwRjsUk5KW4DZsrvqSCu9L oIo", "photo_id":"vCStVnlb6WgbZnL1TX3l 8 lymYglS4VpsSkx5IZsR\/Yd3WYqFW3yA=="}]********SECRET KEY*******}

Before that, I successfully get the url, upload the image at the received address and get an array with the photo id and the token. Apparently, as a result, the request signature is incorrectly calculated. But it is considered a ready-made method in the SDK. What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dgreen, 2015-12-04
@marcus

corrected https://github.com/apiok/ok-ios-sdk and https://github.com/apiok/ok-ios-sdk-examples with an example of uploading a photo. The problem was in the incorrect character expansion + which appeared in photo_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question