M
M
max_mara2011-10-27 08:34:03
API
max_mara, 2011-10-27 08:34:03

VK OpenAPI method VK.Api.call() Callback not called?

Hello, I have the following code

window.vkAsyncInit = function() {
    VK.init({
        apiId: 2396558,
        nameTransportPath: '/xd_receiver.html',
        vk: 1
    });

    VK.Auth.getLoginStatus(function authInfo(response) {
        if (response.session) {
            document.getElementsByTagName('body')[0].style.display = "block";
            document.location.href = "#!/id" + response.session.mid;
            
            VK.Api.call('getUserSettings', {}, function(user) {
                // There should be called callback
            });
        } else {
            VK.Auth.login(function(response) {
                if (!response.session) {
                    alert('You have to allow app use your account');
                }
            }, VK.access.FRIENDS | VK.access.WIKI);
        }  
    });
}

The callback in the VK.Api.call method is not called, but the
Ajax request is sent, the following is received in the response
VK.Api._callbacks[6877234]({"error":{"error_code":4,"error_msg":"Incorrect signature: server authorization","request_params":[{"key":"api_id","value":"2396558"},{"key":"callback","value":"VK.Api._callbacks[6877234]"},{"key":"format","value":"JSON"},{"key":"method","value":"getUserSettings"},{"key":"sid","value":"4cf8fae8f9f07ef4ba765c58027d262b7f25de3afb1a1a6380cf7d693f669a"},{"key":"sig","value":"1107692927cb4a6242d205b2fba29d45"},{"key":"v","value":"3.0"}]}});

What is the problem???

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
max_mara, 2011-10-28
@max_mara

The app_id from the desktop application was used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question