FAPI.Client.calcSignature

Calculating signature manually when it is necessary.

Пример

function API_callback(method, result, data) {
    alert("Method "+method+" finished with result "+result+", "+data);
    if (method == "showConfirmation" && result == "ok") {
        FAPI.Client.call(feedPostingObject, function(status, data, error) {
            console.log(status + "   " + data + " " + error["error_msg"]);
        }, data);
    }
}

function publish() {
    var description_utf8 = "Can I publish?";
    var caption_utf8 = "Published text";
    feedPostingObject = { method: 'stream.publish',
                         message: description_utf8,
                      attachment: JSON.stringify({'caption': caption_utf8}),
                    action_links: '[]'
                        };
    sig = FAPI.Client.calcSignature(feedPostingObject);
    FAPI.UI.showConfirmation('stream.publish', description_utf8, sig);
}