S
S
Sergey Sokolov2016-03-21 00:59:03
JavaScript
Sergey Sokolov, 2016-03-21 00:59:03

How to find out about an error in making a call to VKontakte api through OpenApi?

The site, actually a JS application on React, works with the VK api through their OpenApi : the VK.Api.call() method , which takes only 3 parameters: the name of the method, the parameter object, and the callback function, where the execution result will be passed.
I noticed that when working from Chrome on the phone, errors occur relatively often: there is simply no response, timeout. Moreover, the request was executed in only 124ms, judging by the Net tab.
c96c83110d564f2db7164bbd9dbac295.png
Console:
ee27a67265844b659a2733afc470911e.pngQuestion: how can I understand in my scripts that the callback is no longer worth waiting for?
Ps It is strange that such errors are quite frequent from a mobile phone, while there are no such errors at all from a computer through the same router - all requests are processed.
Pps so far, the working option is to try only authorize the user through OpenApi, and then VK.Auth.getLoginStatus()work with the received token (the sid parameter from the answer to ) through normal ajax.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question