R
R
Romas342016-12-28 17:03:49
Classmates
Romas34, 2016-12-28 17:03:49

Publishing to Odnoklassniki feed using stream.publish?

I'm trying to publish a post using stream.publish from ActionScript code via an ExternalInterface call. The code is taken from the examples. JavaScript code in js file:

/** Публикация в ленту. */
function publish(confirmation_message, text, attachment, links) {
  console.log("try publish:", text);

    // подготовка параметров для публикации
    feedPostingObject = {method: 'stream.publish',
                        message: text,
                     attachment: JSON.stringify(attachment),
                   action_links: JSON.stringify(links)};
    // расчет подписи
    sig = FAPI.Client.calcSignature(feedPostingObject);
    // вызов окна подтверждения
    FAPI.UI.showConfirmation('stream.publish', confirmation_message, sig);
}

Call in ActionScript:
ExternalInterface.call("publish", text, text,
                               {"caption":text2,"media":[{"type":"image","src":imgName}]},
                               [{"text":text2,"href":SocialService.instance.getAppUrl()}]);

In this case, the picture specified by imgName is not published. Only the default application icon is published. Why? This method can't post pictures?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vjacheslav Kanivetc, 2017-01-09
@Vjaka

How do you upload this picture?
Do https://apiok.ru/dev/methods/rest/photosV2/photosV...
then fill
it in and then specify a link to it in the media topic?
About uploading pictures https://apiok.ru/dev/examples/photo_upload

A
Alisher Taubaldy, 2021-04-15
@FlamelMamel

do you need some encodings to hash the signature for mediatopic.post?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question